summaryrefslogtreecommitdiff
path: root/extensions
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2016-09-20 16:41:39 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2016-10-05 06:51:20 +0000
commit954f752cf10fc6a8777af2a6a93e496688464687 (patch)
tree0fc776cdcb6ad9b1d2b9673ac044bb5b4f496972 /extensions
parentc1e18e05a53c1d55afe36a887ca25f74f3f1d32d (diff)
convert MapUnit to scoped enum
I left a prefix on the names "Map" so that I would not have to re-arrange each name too much, since I can't start identifiers with digits like "100thMM" And remove RSC_EXTRAMAPUNIT, which doesn't seem to be doing anything anymore. Change-Id: I5187824aa87e30caf5357b51b5384b5ab919d224 Reviewed-on: https://gerrit.libreoffice.org/29096 Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk> Tested-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/source/abpilot/abspilot.cxx2
-rw-r--r--extensions/source/bibliography/general.cxx2
-rw-r--r--extensions/source/dbpilots/controlwizard.cxx2
-rw-r--r--extensions/source/propctrlr/browserline.cxx2
-rw-r--r--extensions/source/propctrlr/browserlistbox.cxx4
-rw-r--r--extensions/source/propctrlr/fontdialog.cxx4
-rw-r--r--extensions/source/propctrlr/inspectorhelpwindow.cxx8
-rw-r--r--extensions/source/propctrlr/listselectiondlg.cxx2
-rw-r--r--extensions/source/scanner/grid.cxx4
-rw-r--r--extensions/source/scanner/sanedlg.cxx16
10 files changed, 23 insertions, 23 deletions
diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx
index c24f55da2a58..8ceb9e2054ca 100644
--- a/extensions/source/abpilot/abspilot.cxx
+++ b/extensions/source/abpilot/abspilot.cxx
@@ -60,7 +60,7 @@ namespace abp
,m_aNewDataSource(_rxORB)
,m_eNewDataSourceType( AST_INVALID )
{
- SetPageSizePixel(LogicToPixel(Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MAP_APPFONT));
+ SetPageSizePixel(LogicToPixel(Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapUnit::MapAppFont));
declarePath( PATH_COMPLETE,
{STATE_SELECT_ABTYPE,
diff --git a/extensions/source/bibliography/general.cxx b/extensions/source/bibliography/general.cxx
index 38188dfd525f..1cc434f8c0d9 100644
--- a/extensions/source/bibliography/general.cxx
+++ b/extensions/source/bibliography/general.cxx
@@ -336,7 +336,7 @@ BibGeneralPage::BibGeneralPage(vcl::Window* pParent, BibDataManager* pMan):
SetText(BIB_RESSTR(ST_TYPE_TITLE));
- Size aSize(LogicToPixel(Size(0, 209), MapMode(MAP_APPFONT)));
+ Size aSize(LogicToPixel(Size(0, 209), MapMode(MapUnit::MapAppFont)));
set_height_request(aSize.Height());
}
diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx
index 261918671f31..82ea3ea0d860 100644
--- a/extensions/source/dbpilots/controlwizard.cxx
+++ b/extensions/source/dbpilots/controlwizard.cxx
@@ -246,7 +246,7 @@ namespace dbp
m_aContext.xObjectModel = _rxObjectModel;
initContext();
- SetPageSizePixel(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MAP_APPFONT));
+ SetPageSizePixel(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapUnit::MapAppFont));
defaultButton(WizardButtonFlags::NEXT);
enableButtons(WizardButtonFlags::FINISH, false);
}
diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx
index c223cc6dc305..d40f9f31cee4 100644
--- a/extensions/source/propctrlr/browserline.cxx
+++ b/extensions/source/propctrlr/browserline.cxx
@@ -209,7 +209,7 @@ namespace pcr
if ( m_bIndentTitle )
{
- Size aIndent( m_pTheParent->LogicToPixel( Size( 8, 0 ), MAP_APPFONT ) );
+ Size aIndent( m_pTheParent->LogicToPixel( Size( 8, 0 ), MapUnit::MapAppFont ) );
aTitlePos.X() += aIndent.Width();
aTitleSize.Width() -= aIndent.Width();
}
diff --git a/extensions/source/propctrlr/browserlistbox.cxx b/extensions/source/propctrlr/browserlistbox.cxx
index bd9758a3fcf5..7036a7b22e8e 100644
--- a/extensions/source/propctrlr/browserlistbox.cxx
+++ b/extensions/source/propctrlr/browserlistbox.cxx
@@ -436,7 +436,7 @@ namespace pcr
void OBrowserListBox::Resize()
{
Rectangle aPlayground( Point( 0, 0 ), GetOutputSizePixel() );
- Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MAP_APPFONT ) );
+ Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MapUnit::MapAppFont ) );
long nHelpWindowHeight = m_nCurrentPreferredHelpHeight = impl_getPrefererredHelpHeight();
bool bPositionHelpWindow = ( nHelpWindowHeight != 0 );
@@ -773,7 +773,7 @@ namespace pcr
if ( HasHelpSection() )
{
- Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MAP_APPFONT ) );
+ Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MapUnit::MapAppFont ) );
nMinHeight += aHelpWindowDistance.Height();
nMinHeight += m_pHelpWindow->GetMinimalHeightPixel();
diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx
index 400739aa8e46..61a8a718e472 100644
--- a/extensions/source/propctrlr/fontdialog.cxx
+++ b/extensions/source/propctrlr/fontdialog.cxx
@@ -224,7 +224,7 @@ namespace pcr
// build SfxItems with the values
SvxFontItem aFontItem((FontFamily)nFontFamily, aFontName, aFontStyleName, PITCH_DONTKNOW, nFontCharset, CFID_FONT);
- nFontHeight = (float)OutputDevice::LogicToLogic(Size(0, (sal_Int32)nFontHeight), MAP_POINT, MAP_TWIP).Height();
+ nFontHeight = (float)OutputDevice::LogicToLogic(Size(0, (sal_Int32)nFontHeight), MapUnit::MapPoint, MapUnit::MapTwip).Height();
SvxFontHeightItem aSvxFontHeightItem((sal_uInt32)nFontHeight,100,CFID_HEIGHT);
FontWeight eWeight=VCLUnoHelper::ConvertFontWeight(nFontWeight);
@@ -328,7 +328,7 @@ namespace pcr
const SvxFontHeightItem& rSvxFontHeightItem =
static_cast<const SvxFontHeightItem&>(_rSet.Get(CFID_HEIGHT));
- float nHeight = (float)OutputDevice::LogicToLogic(Size(0, rSvxFontHeightItem.GetHeight()), MAP_TWIP, MAP_POINT).Height();
+ float nHeight = (float)OutputDevice::LogicToLogic(Size(0, rSvxFontHeightItem.GetHeight()), MapUnit::MapTwip, MapUnit::MapPoint).Height();
lcl_pushBackPropertyValue( _out_properties, PROPERTY_FONT_HEIGHT,makeAny(nHeight));
}
diff --git a/extensions/source/propctrlr/inspectorhelpwindow.cxx b/extensions/source/propctrlr/inspectorhelpwindow.cxx
index c0090fa582bd..ddf871e5e752 100644
--- a/extensions/source/propctrlr/inspectorhelpwindow.cxx
+++ b/extensions/source/propctrlr/inspectorhelpwindow.cxx
@@ -81,8 +81,8 @@ namespace pcr
long InspectorHelpWindow::impl_getSpaceAboveTextWindow()
{
- Size aSeparatorSize( LogicToPixel( Size( 0, 8 ), MAP_APPFONT ) );
- Size a3AppFontSize( LogicToPixel( Size( 3, 3 ), MAP_APPFONT ) );
+ Size aSeparatorSize( LogicToPixel( Size( 0, 8 ), MapUnit::MapAppFont ) );
+ Size a3AppFontSize( LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ) );
return aSeparatorSize.Height() + a3AppFontSize.Height();
}
@@ -125,12 +125,12 @@ namespace pcr
void InspectorHelpWindow::Resize()
{
- Size a3AppFont( LogicToPixel( Size( 3, 3 ), MAP_APPFONT ) );
+ Size a3AppFont( LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ) );
Rectangle aPlayground( Point( 0, 0 ), GetOutputSizePixel() );
Rectangle aSeparatorArea( aPlayground );
- aSeparatorArea.Bottom() = aSeparatorArea.Top() + LogicToPixel( Size( 0, 8 ), MAP_APPFONT ).Height();
+ aSeparatorArea.Bottom() = aSeparatorArea.Top() + LogicToPixel( Size( 0, 8 ), MapUnit::MapAppFont ).Height();
m_aSeparator->SetPosSizePixel( aSeparatorArea.TopLeft(), aSeparatorArea.GetSize() );
Rectangle aTextArea( aPlayground );
diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx
index 73afae7f3649..41fc4b57d982 100644
--- a/extensions/source/propctrlr/listselectiondlg.cxx
+++ b/extensions/source/propctrlr/listselectiondlg.cxx
@@ -39,7 +39,7 @@ namespace pcr
OSL_PRECOND( m_xListBox.is(), "ListSelectionDialog::ListSelectionDialog: invalid list box!" );
get(m_pEntries, "treeview");
- Size aSize(LogicToPixel(Size(85, 97), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(85, 97), MapUnit::MapAppFont));
m_pEntries->set_width_request(aSize.Width());
m_pEntries->set_height_request(aSize.Height());
diff --git a/extensions/source/scanner/grid.cxx b/extensions/source/scanner/grid.cxx
index 6a1cb1b5a9ad..90faba32e8fc 100644
--- a/extensions/source/scanner/grid.cxx
+++ b/extensions/source/scanner/grid.cxx
@@ -153,7 +153,7 @@ GridWindow::GridWindow(vcl::Window* pParent)
, m_aHandles()
, m_nDragIndex(0xffffffff)
{
- SetMapMode(MapMode(MAP_PIXEL));
+ SetMapMode(MapMode(MapUnit::MapPixel));
}
void GridWindow::Init(double* pXValues, double* pYValues, int nValues, bool bCutValues, const BitmapEx &rMarkerBitmap)
@@ -197,7 +197,7 @@ void GridWindow::onResize()
Size GridWindow::GetOptimalSize() const
{
- return LogicToPixel(Size(240, 200), MAP_APPFONT);
+ return LogicToPixel(Size(240, 200), MapUnit::MapAppFont);
}
GridDialog::GridDialog(double* pXValues, double* pYValues, int nValues, vcl::Window* pParent )
diff --git a/extensions/source/scanner/sanedlg.cxx b/extensions/source/scanner/sanedlg.cxx
index 80cdbdadd379..386bd3ef3eb5 100644
--- a/extensions/source/scanner/sanedlg.cxx
+++ b/extensions/source/scanner/sanedlg.cxx
@@ -192,7 +192,7 @@ public:
}
virtual Size GetOptimalSize() const override
{
- Size aSize(LogicToPixel(Size(PREVIEW_WIDTH, PREVIEW_HEIGHT), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(PREVIEW_WIDTH, PREVIEW_HEIGHT), MapUnit::MapAppFont));
aSize.setWidth(aSize.getWidth()+1);
aSize.setHeight(aSize.getHeight()+1);
return aSize;
@@ -226,7 +226,7 @@ SaneDlg::SaneDlg( vcl::Window* pParent, Sane& rSane, bool bScanEnabled ) :
get(mpScanButton, "scanButton");
get(mpButtonOption, "optionsButton");
get(mpOptionTitle, "optionTitleLabel");
- Size aSize(LogicToPixel(Size(130, 102), MAP_APPFONT));
+ Size aSize(LogicToPixel(Size(130, 102), MapUnit::MapAppFont));
mpOptionTitle->set_width_request(aSize.Width());
mpOptionTitle->set_height_request(aSize.Height() / 2);
get(mpOptionDescTxt, "optionsDescLabel");
@@ -952,12 +952,12 @@ void ScanPreview::UpdatePreviewBounds()
void ScanPreview::Paint(vcl::RenderContext& rRenderContext, const Rectangle& rRect)
{
Window::Paint(rRenderContext, rRect);
- rRenderContext.SetMapMode(MAP_APPFONT);
+ rRenderContext.SetMapMode(MapUnit::MapAppFont);
rRenderContext.SetFillColor(Color(COL_WHITE));
rRenderContext.SetLineColor(Color(COL_WHITE));
rRenderContext.DrawRect(Rectangle(Point(0, 0),
Size(PREVIEW_WIDTH, PREVIEW_HEIGHT)));
- rRenderContext.SetMapMode(MapMode(MAP_PIXEL));
+ rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel));
// check for sane values
rRenderContext.DrawBitmap(maPreviewRect.TopLeft(), maPreviewRect.GetSize(), maPreviewBitmap);
@@ -1244,7 +1244,7 @@ void ScanPreview::DrawDrag(vcl::RenderContext& rRenderContext)
RasterOp eROP = rRenderContext.GetRasterOp();
rRenderContext.SetRasterOp(RasterOp::Invert);
- rRenderContext.SetMapMode(MapMode(MAP_PIXEL));
+ rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel));
if (mbDragDrawn)
DrawRectangles(rRenderContext, aLastUL, aLastBR);
@@ -1255,7 +1255,7 @@ void ScanPreview::DrawDrag(vcl::RenderContext& rRenderContext)
mbDragDrawn = true;
rRenderContext.SetRasterOp(eROP);
- rRenderContext.SetMapMode(MAP_APPFONT);
+ rRenderContext.SetMapMode(MapUnit::MapAppFont);
}
Point ScanPreview::GetPixelPos( const Point& rIn) const
@@ -1268,12 +1268,12 @@ Point ScanPreview::GetPixelPos( const Point& rIn) const
/ ( maMaxBottomRight.Y() - maMinTopLeft.Y() ) )
);
- return LogicToPixel(aConvert, MAP_APPFONT);
+ return LogicToPixel(aConvert, MapUnit::MapAppFont);
}
Point ScanPreview::GetLogicPos(const Point& rIn) const
{
- Point aConvert = PixelToLogic(rIn, MAP_APPFONT);
+ Point aConvert = PixelToLogic(rIn, MapUnit::MapAppFont);
if( aConvert.X() < 0 )
aConvert.X() = 0;
if( aConvert.X() >= PREVIEW_WIDTH )