Merge pull request #1018 from JJones780/tidyMapper

minor touchup to mapper functions for readability
presentation
JJones780 7 years ago committed by GitHub
commit 539fb86789
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 14
      src/gui/LayoutMapper.cpp
  2. 10
      src/gui/LayoutMapper.h

@ -13,6 +13,11 @@ LayoutMapper::LayoutMapper(){
}
LayoutMapper::~LayoutMapper()
{
XOJ_RELEASE_TYPE(LayoutMapper);
}
void LayoutMapper::configureFromSettings(int numPages, Settings* settings)
{
@ -41,15 +46,10 @@ void LayoutMapper::configureFromSettings(int numPages, Settings* settings)
type |= isBottomToTop ? LayoutBitFlags::BottomToTop : 0;
layoutMapperInit(pages, numRows, numCols, fixRows, (LayoutType)type, isPairedPages, pairsOffset);
}
LayoutMapper::~LayoutMapper()
{
XOJ_RELEASE_TYPE(LayoutMapper);
this->configure(pages, numRows, numCols, fixRows, (LayoutType)type, isPairedPages, pairsOffset);
}
void LayoutMapper::layoutMapperInit(int pages, int numRows, int numCols, bool useRows, LayoutType type, bool isPaired,
void LayoutMapper::configure(int pages, int numRows, int numCols, bool useRows, LayoutType type, bool isPaired,
int firstPageOffset)
{
XOJ_CHECK_TYPE(LayoutMapper);

@ -49,8 +49,8 @@ public:
/**
* configureFromSettings
* configure layoutMapper from user settings settings
* configureFromSettings
* Obtain user settings to determine arguments to configure().
*
* @param pages The number of pages in the document
* @param settings The Settings from which users settings are obtained
@ -62,9 +62,9 @@ public:
virtual ~LayoutMapper();
private:
/**
* layoutMapperInit
* configure
*
* Initialize mapper of LayoutType with number of pages and of fixed rows or columns
* Set mapper to LayoutType with number of pages and of fixed rows or columns
* @param pages The number of pages in the document
* @param numRows Number of rows ( used if useRows )
* @param numCols Number of columns ( used if !useRows )
@ -73,7 +73,7 @@ private:
* @param isPaired Display pages in pairs including offset
* @param firstPageOffset Pages to offset - usually one or zero in order to pair up properly
*/
void layoutMapperInit(int pages, int numRows, int numCols, bool useRows, LayoutType type, bool paired,
void configure(int pages, int numRows, int numCols, bool useRows, LayoutType type, bool paired,
int firstPageOffset);
public:

Loading…
Cancel
Save