Formatting / check type

presentation
Andreas Butti 7 years ago
parent ac59e62a8e
commit f23bc12875
  1. 4
      src/control/tools/ArrowHandler.cpp
  2. 4
      src/control/tools/CircleHandler.cpp
  3. 2
      src/control/tools/CoordinateSystemHandler.cpp
  4. 20
      src/control/tools/EditSelection.cpp
  5. 18
      src/control/tools/EditSelectionContents.cpp
  6. 2
      src/control/tools/RectangleHandler.cpp
  7. 2
      src/control/tools/RulerHandler.cpp
  8. 2
      src/control/tools/Selection.cpp

@ -6,7 +6,7 @@
#include <cmath>
ArrowHandler::ArrowHandler(XournalView* xournal, XojPageView* redrawable, PageRef page)
: BaseStrokeHandler(xournal, redrawable, page)
: BaseStrokeHandler(xournal, redrawable, page)
{
XOJ_INIT_TYPE(ArrowHandler);
}
@ -20,6 +20,8 @@ ArrowHandler::~ArrowHandler()
void ArrowHandler::drawShape(Point& c, bool shiftDown)
{
XOJ_CHECK_TYPE(ArrowHandler);
/**
* Snap first point to grid (if enabled)
*/

@ -6,7 +6,7 @@
#include <cmath>
CircleHandler::CircleHandler(XournalView* xournal, XojPageView* redrawable, PageRef page)
: BaseStrokeHandler(xournal, redrawable, page)
: BaseStrokeHandler(xournal, redrawable, page)
{
XOJ_INIT_TYPE(CircleHandler);
}
@ -20,6 +20,8 @@ CircleHandler::~CircleHandler()
void CircleHandler::drawShape(Point& c, bool shiftDown)
{
XOJ_CHECK_TYPE(CircleHandler);
/**
* Snap first point to grid (if enabled)
*/

@ -27,6 +27,8 @@ CoordinateSystemHandler::~CoordinateSystemHandler()
*/
void CoordinateSystemHandler::drawShape(Point& currentPoint, bool shiftDown)
{
XOJ_CHECK_TYPE(CoordinateSystemHandler);
/**
* Snap first point to grid (if enabled)
*/

@ -343,6 +343,8 @@ UndoAction* EditSelection::setFont(XojFont& font)
*/
void EditSelection::fillUndoItem(DeleteUndoAction* undo)
{
XOJ_CHECK_TYPE(EditSelection);
this->contents->fillUndoItem(undo);
}
@ -401,6 +403,8 @@ void EditSelection::mouseUp()
*/
void EditSelection::mouseDown(CursorSelectionType type, double x, double y)
{
XOJ_CHECK_TYPE(EditSelection);
double zoom = this->view->getXournal()->getZoom();
x /= zoom;
y /= zoom;
@ -415,6 +419,8 @@ void EditSelection::mouseDown(CursorSelectionType type, double x, double y)
*/
void EditSelection::mouseMove(double x, double y)
{
XOJ_CHECK_TYPE(EditSelection);
double zoom = this->view->getXournal()->getZoom();
x /= zoom;
y /= zoom;
@ -553,6 +559,8 @@ void EditSelection::mouseMove(double x, double y)
XojPageView* EditSelection::getBestMatchingPageView()
{
XOJ_CHECK_TYPE(EditSelection);
PagePositionHandler* pp = this->view->getXournal()->getPagePositionHandler();
int rx = this->getXOnViewAbsolute();
int ry = this->getYOnViewAbsolute();
@ -566,6 +574,8 @@ XojPageView* EditSelection::getBestMatchingPageView()
*/
void EditSelection::translateToView(XojPageView* v)
{
XOJ_CHECK_TYPE(EditSelection);
double zoom = view->getXournal()->getZoom();
int aX1 = getXOnViewAbsolute();
@ -591,6 +601,8 @@ void EditSelection::translateToView(XojPageView* v)
void EditSelection::copySelection()
{
XOJ_CHECK_TYPE(EditSelection);
undo->addUndoAction(contents->copySelection(this->view->getPage(), this->view, this->x, this->y));
}
@ -599,6 +611,8 @@ void EditSelection::copySelection()
*/
bool EditSelection::isMoving()
{
XOJ_CHECK_TYPE(EditSelection);
return this->mouseDownType != CURSOR_SELECTION_NONE;
}
@ -712,6 +726,8 @@ CursorSelectionType EditSelection::getSelectionTypeForPos(double x, double y, do
void EditSelection::snapRotation()
{
XOJ_CHECK_TYPE(EditSelection);
bool snapping = this->view->getXournal()->getControl()->getSettings()->isSnapRotation();
if (!snapping)
{
@ -846,6 +862,8 @@ XojPageView* EditSelection::getView()
void EditSelection::serialize(ObjectOutputStream& out)
{
XOJ_CHECK_TYPE(EditSelection);
out.writeObject("EditSelection");
out.writeDouble(this->x);
@ -865,6 +883,8 @@ void EditSelection::serialize(ObjectOutputStream& out)
void EditSelection::readSerialized(ObjectInputStream& in)
{
XOJ_CHECK_TYPE(EditSelection);
in.readObject("EditSelection");
this->x = in.readDouble();
this->y = in.readDouble();

@ -318,6 +318,8 @@ UndoAction* EditSelectionContents::setColor(int color)
*/
void EditSelectionContents::fillUndoItem(DeleteUndoAction* undo)
{
XOJ_CHECK_TYPE(EditSelectionContents);
Layer* layer = this->sourceLayer;
// Always insert the elements on top
@ -368,6 +370,8 @@ void EditSelectionContents::deleteViewBuffer()
*/
double EditSelectionContents::getOriginalWidth()
{
XOJ_CHECK_TYPE(EditSelectionContents);
return this->originalWidth;
}
@ -376,6 +380,8 @@ double EditSelectionContents::getOriginalWidth()
*/
double EditSelectionContents::getOriginalHeight()
{
XOJ_CHECK_TYPE(EditSelectionContents);
return this->originalHeight;
}
@ -385,6 +391,8 @@ double EditSelectionContents::getOriginalHeight()
void EditSelectionContents::finalizeSelection(double x, double y, double width, double height, bool aspectRatio,
Layer* layer, PageRef targetPage, XojPageView* targetView, UndoRedoHandler* undo)
{
XOJ_CHECK_TYPE(EditSelectionContents);
double fx = width / this->originalWidth;
double fy = height / this->originalHeight;
@ -425,6 +433,8 @@ void EditSelectionContents::updateContent(double x, double y, double rotation, d
Layer* layer, PageRef targetPage, XojPageView* targetView,
UndoRedoHandler* undo, CursorSelectionType type)
{
XOJ_CHECK_TYPE(EditSelectionContents);
double mx = x - this->lastX;
double my = y - this->lastY;
this->rotation = rotation;
@ -503,6 +513,8 @@ void EditSelectionContents::updateContent(double x, double y, double rotation, d
*/
void EditSelectionContents::paint(cairo_t* cr, double x, double y, double rotation, double width, double height, double zoom)
{
XOJ_CHECK_TYPE(EditSelectionContents);
double fx = width / this->originalWidth;
double fy = height / this->originalHeight;
@ -565,6 +577,8 @@ void EditSelectionContents::paint(cairo_t* cr, double x, double y, double rotati
UndoAction* EditSelectionContents::copySelection(PageRef page, XojPageView *view, double x, double y)
{
XOJ_CHECK_TYPE(EditSelectionContents);
Layer* layer = page->getSelectedLayer();
vector<Element*> new_elems;
@ -586,6 +600,8 @@ UndoAction* EditSelectionContents::copySelection(PageRef page, XojPageView *view
void EditSelectionContents::serialize(ObjectOutputStream& out)
{
XOJ_CHECK_TYPE(EditSelectionContents);
out.writeObject("EditSelectionContents");
out.writeDouble(this->originalWidth);
@ -602,6 +618,8 @@ void EditSelectionContents::serialize(ObjectOutputStream& out)
void EditSelectionContents::readSerialized(ObjectInputStream& in)
{
XOJ_CHECK_TYPE(EditSelectionContents);
in.readObject("EditSelectionContents");
this->originalWidth = in.readDouble();

@ -5,7 +5,7 @@
#include "undo/InsertUndoAction.h"
RectangleHandler::RectangleHandler(XournalView* xournal, XojPageView* redrawable, PageRef page)
: BaseStrokeHandler(xournal, redrawable, page)
: BaseStrokeHandler(xournal, redrawable, page)
{
XOJ_INIT_TYPE(RectangleHandler);
}

@ -6,7 +6,7 @@
#include <cmath>
RulerHandler::RulerHandler(XournalView* xournal, XojPageView* redrawable, PageRef page)
: BaseStrokeHandler(xournal, redrawable, page)
: BaseStrokeHandler(xournal, redrawable, page)
{
XOJ_INIT_TYPE(RulerHandler);
}

@ -336,7 +336,7 @@ bool RegionSelect::contains(double x, double y)
}
}
return ((hits & 1) != 0);
return (hits & 1) != 0;
}
bool RegionSelect::finalize(PageRef page)

Loading…
Cancel
Save