diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-09-20 16:41:39 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2016-10-05 06:51:20 +0000 |
commit | 954f752cf10fc6a8777af2a6a93e496688464687 (patch) | |
tree | 0fc776cdcb6ad9b1d2b9673ac044bb5b4f496972 /chart2 | |
parent | c1e18e05a53c1d55afe36a887ca25f74f3f1d32d (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 'chart2')
14 files changed, 25 insertions, 25 deletions
diff --git a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx index 30e2acc7051f..22dff81d646a 100644 --- a/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx +++ b/chart2/source/controller/accessibility/AccessibleViewForwarder.cxx @@ -30,7 +30,7 @@ namespace chart AccessibleViewForwarder::AccessibleViewForwarder( AccessibleChartView* pAccChartView, vcl::Window* pWindow ) :m_pAccChartView( pAccChartView ) ,m_pWindow( pWindow ) - ,m_aMapMode( MAP_100TH_MM ) + ,m_aMapMode( MapUnit::Map100thMM ) { } diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx index c256754ddb13..7ccda8441db3 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx @@ -409,7 +409,7 @@ void lcl_correctSymbolSizeForBitmaps( chart2::Symbol& rSymbol ) if( (xProp->getPropertyValue( "SizePixel" ) >>= aAWTPixelSize) ) { Size aPixelSize(aAWTPixelSize.Width,aAWTPixelSize.Height); - Size aNewSize = ( OutputDevice::LogicToLogic( aPixelSize, MAP_PIXEL, MAP_100TH_MM )); + Size aNewSize = ( OutputDevice::LogicToLogic( aPixelSize, MapUnit::MapPixel, MapUnit::Map100thMM )); aSize = awt::Size( aNewSize.Width(), aNewSize.Height() ); if( aSize.Width == 0 && aSize.Height == 0 ) diff --git a/chart2/source/controller/dialogs/DataBrowser.cxx b/chart2/source/controller/dialogs/DataBrowser.cxx index 79b214efd9a7..b6c7df5ae441 100644 --- a/chart2/source/controller/dialogs/DataBrowser.cxx +++ b/chart2/source/controller/dialogs/DataBrowser.cxx @@ -244,29 +244,29 @@ void SeriesHeader::SetPos( const Point & rPos ) // chart type symbol Size aSize( nSymbolHeight, nSymbolHeight ); - aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT ); + aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont ); m_spSymbol->set_width_request(aSize.Width()); m_spSymbol->set_height_request(aSize.Height()); // series name edit field aSize.setWidth(nSymbolDistance); - aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT ); + aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont ); m_spSeriesName->set_margin_left(aSize.Width() + 2); aSize.setWidth( m_nWidth - nSymbolHeight - nSymbolDistance ); sal_Int32 nHeight = 12; aSize.setHeight( nHeight ); - aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT ); + aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont ); m_spSeriesName->set_width_request(aSize.Width()); m_spSeriesName->set_height_request(aSize.Height()); // color bar aSize.setWidth(1); - aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT ); + aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont ); m_spColorBar->set_margin_left(aSize.Width() + 2); nHeight = 3; aSize.setWidth( m_nWidth - 1 ); aSize.setHeight( nHeight ); - aSize = m_pDevice->LogicToPixel( aSize, MAP_APPFONT ); + aSize = m_pDevice->LogicToPixel( aSize, MapUnit::MapAppFont ); m_spColorBar->set_width_request(aSize.Width()); m_spColorBar->set_height_request(aSize.Height()); } @@ -279,7 +279,7 @@ void SeriesHeader::SetWidth( sal_Int32 nWidth ) void SeriesHeader::SetPixelWidth( sal_Int32 nWidth ) { - SetWidth( m_pDevice->PixelToLogic( Size( nWidth, 0 ), MAP_APPFONT ).getWidth()); + SetWidth( m_pDevice->PixelToLogic( Size( nWidth, 0 ), MapUnit::MapAppFont ).getWidth()); } void SeriesHeader::SetChartType( @@ -555,7 +555,7 @@ void DataBrowser::RenewTable() OUString aDefaultSeriesName(SCH_RESSTR(STR_COLUMN_LABEL)); replaceParamterInString( aDefaultSeriesName, "%COLUMNNUMBER", OUString::number( 24 ) ); sal_Int32 nColumnWidth = GetDataWindow().GetTextWidth( aDefaultSeriesName ) - + GetDataWindow().LogicToPixel( Point( 4 + impl::SeriesHeader::GetRelativeAppFontXPosForNameField(), 0 ), MAP_APPFONT ).X(); + + GetDataWindow().LogicToPixel( Point( 4 + impl::SeriesHeader::GetRelativeAppFontXPosForNameField(), 0 ), MapUnit::MapAppFont ).X(); sal_Int32 nColumnCount = m_apDataBrowserModel->getColumnCount(); // nRowCount is a member of a base class sal_Int32 nRowCountLocal = m_apDataBrowserModel->getMaxRowCount(); diff --git a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx index 268cf58145c3..21f6e28d6726 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx @@ -68,8 +68,8 @@ CreationWizard::CreationWizard( vcl::Window* pParent, const uno::Reference< fram ); this->SetRoadmapHelpId( HID_SCH_WIZARD_ROADMAP ); this->SetRoadmapInteractive( true ); - Size aAdditionalRoadmapSize( LogicToPixel( Size( 85, 0 ), MAP_APPFONT ) ); - Size aSize(LogicToPixel(Size(CHART_WIZARD_PAGEWIDTH, CHART_WIZARD_PAGEHEIGHT), MAP_APPFONT)); + Size aAdditionalRoadmapSize( LogicToPixel( Size( 85, 0 ), MapUnit::MapAppFont ) ); + Size aSize(LogicToPixel(Size(CHART_WIZARD_PAGEWIDTH, CHART_WIZARD_PAGEHEIGHT), MapUnit::MapAppFont)); aSize.Width() += aAdditionalRoadmapSize.Width(); this->SetSizePixel( aSize ); diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx index 36af3ffcb78d..15971efc442e 100644 --- a/chart2/source/controller/dialogs/dlg_DataEditor.cxx +++ b/chart2/source/controller/dialogs/dlg_DataEditor.cxx @@ -52,7 +52,7 @@ DataEditor::DataEditor(vcl::Window* pParent, m_xBrwData->set_hexpand(true); m_xBrwData->set_vexpand(true); m_xBrwData->set_expand(true); - Size aSize(m_xBrwData->LogicToPixel(Size(232, 121), MAP_APPFONT)); + Size aSize(m_xBrwData->LogicToPixel(Size(232, 121), MapUnit::MapAppFont)); m_xBrwData->set_width_request(aSize.Width()); m_xBrwData->set_height_request(aSize.Height()); m_xBrwData->Show(); diff --git a/chart2/source/controller/dialogs/tp_ChartType.cxx b/chart2/source/controller/dialogs/tp_ChartType.cxx index 777297cb45c0..99447ea1ff61 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -700,7 +700,7 @@ ChartTypeTabPage::ChartTypeTabPage(vcl::Window* pParent get(m_pFT_ChooseType, "FT_CAPTION_FOR_WIZARD"); get(m_pMainTypeList, "charttype"); get(m_pSubTypeList, "subtype"); - Size aSize(m_pSubTypeList->LogicToPixel(Size(150, 50), MAP_APPFONT)); + Size aSize(m_pSubTypeList->LogicToPixel(Size(150, 50), MapUnit::MapAppFont)); m_pSubTypeList->set_width_request(aSize.Width()); m_pSubTypeList->set_height_request(aSize.Height()); diff --git a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx index 2a6e4097cf9c..9ff91385bc97 100644 --- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -143,7 +143,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co SdrObject* pObj = pSymbolList->GetObj(nStandardSymbol); ScopedVclPtrInstance< VirtualDevice > pVDev; - pVDev->SetMapMode(MapMode(MAP_100TH_MM)); + pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); SdrModel* pModel = new SdrModel(); pModel->GetItemPool().FreezeIdRanges(); SdrPage* pPage = new SdrPage( *pModel, false ); @@ -164,7 +164,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co Graphic aGraph(aMeta); Size aSize = pObj->GetSnapRect().GetSize(); aGraph.SetPrefSize(aSize); - aGraph.SetPrefMapMode(MAP_100TH_MM); + aGraph.SetPrefMapMode(MapUnit::Map100thMM); pView->UnmarkAll(); pObj=pPage->RemoveObject(0); diff --git a/chart2/source/controller/main/ChartController_Window.cxx b/chart2/source/controller/main/ChartController_Window.cxx index e55196f86521..b1daf046eaee 100644 --- a/chart2/source/controller/main/ChartController_Window.cxx +++ b/chart2/source/controller/main/ChartController_Window.cxx @@ -229,7 +229,7 @@ void SAL_CALL ChartController::setPosSize( if(xWindow.is() && m_pChartWindow) { - Size aLogicSize = m_pChartWindow->PixelToLogic( Size( Width, Height ), MapMode( MAP_100TH_MM ) ); + Size aLogicSize = m_pChartWindow->PixelToLogic( Size( Width, Height ), MapMode( MapUnit::Map100thMM ) ); //todo: for standalone chart: detect whether we are standalone //change map mode to fit new size @@ -239,7 +239,7 @@ void SAL_CALL ChartController::setPosSize( sal_Int32 nScaleYNumerator = aLogicSize.Height(); sal_Int32 nScaleYDenominator = aModelPageSize.Height; MapMode aNewMapMode( - MAP_100TH_MM, + MapUnit::Map100thMM, Point(0,0), Fraction(nScaleXNumerator, nScaleXDenominator), Fraction(nScaleYNumerator, nScaleYDenominator) ); diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx index ed053f67b8d4..21cc0cefc2ab 100644 --- a/chart2/source/controller/main/ChartWindow.cxx +++ b/chart2/source/controller/main/ChartWindow.cxx @@ -58,7 +58,7 @@ ChartWindow::ChartWindow( ChartController* pController, vcl::Window* pParent, Wi { set_id("chart_window"); this->SetHelpId( HID_SCH_WIN_DOCUMENT ); - this->SetMapMode( MapMode(MAP_100TH_MM) ); + this->SetMapMode( MapMode(MapUnit::Map100thMM) ); adjustHighContrastMode(); // chart does not depend on exact pixel painting => enable antialiased drawing SetAntialiasing( AntialiasingFlags::EnableB2dDraw | GetAntialiasing() ); diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx index 6d1453b581fa..e03a43c7e094 100644 --- a/chart2/source/controller/main/ElementSelector.cxx +++ b/chart2/source/controller/main/ElementSelector.cxx @@ -318,7 +318,7 @@ uno::Reference< awt::XWindow > SAL_CALL ElementSelectorToolbarController::create { m_apSelectorListBox.reset( VclPtr<SelectorListBox>::Create( pParent, WB_DROPDOWN|WB_AUTOHSCROLL|WB_BORDER ) ); ::Size aLogicalSize( 95, 160 ); - ::Size aPixelSize = m_apSelectorListBox->LogicToPixel( aLogicalSize, MAP_APPFONT ); + ::Size aPixelSize = m_apSelectorListBox->LogicToPixel( aLogicalSize, MapUnit::MapAppFont ); m_apSelectorListBox->SetSizePixel( aPixelSize ); m_apSelectorListBox->SetDropDownLineCount( 5 ); } diff --git a/chart2/source/controller/sidebar/ChartLinePanel.cxx b/chart2/source/controller/sidebar/ChartLinePanel.cxx index 8cc18b90dca6..8fefe156675e 100644 --- a/chart2/source/controller/sidebar/ChartLinePanel.cxx +++ b/chart2/source/controller/sidebar/ChartLinePanel.cxx @@ -174,7 +174,7 @@ void ChartLinePanel::Initialize() SvxColorToolBoxControl* pToolBoxColor = getColorToolBoxControl(mpTBColor.get()); pToolBoxColor->setColorSelectFunction(maLineColorWrapper); - setMapUnit(MAP_100TH_MM); + setMapUnit(MapUnit::Map100thMM); updateData(); } diff --git a/chart2/source/view/main/ChartItemPool.cxx b/chart2/source/view/main/ChartItemPool.cxx index 7ec565c406f0..4ec9554a3c96 100644 --- a/chart2/source/view/main/ChartItemPool.cxx +++ b/chart2/source/view/main/ChartItemPool.cxx @@ -203,7 +203,7 @@ SfxItemPool* ChartItemPool::Clone() const MapUnit ChartItemPool::GetMetric(sal_uInt16 /* nWhich */) const { - return MAP_100TH_MM; + return MapUnit::Map100thMM; } SfxItemPool* ChartItemPool::CreateChartItemPool() diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 3c27e6d1bb34..5f81d854f1ee 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -3347,7 +3347,7 @@ void ChartView::createShapes3D() if( pWindow->GetSizePixel().Width() == 0 || pWindow->GetSizePixel().Height() == 0 ) { awt::Size aPageSize = mrChartModel.getVisualAreaSize( embed::Aspects::MSOLE_CONTENT ); - Size aSize = pWindow->LogicToPixel( Size(aPageSize.Width,aPageSize.Height), MapUnit(MAP_100TH_MM) ); + Size aSize = pWindow->LogicToPixel( Size(aPageSize.Width,aPageSize.Height), MapUnit(MapUnit::Map100thMM) ); pWindow->SetSizePixel(aSize); } pWindow->Show(); diff --git a/chart2/source/view/main/DrawModelWrapper.cxx b/chart2/source/view/main/DrawModelWrapper.cxx index 4dda034eb916..826e02230f36 100644 --- a/chart2/source/view/main/DrawModelWrapper.cxx +++ b/chart2/source/view/main/DrawModelWrapper.cxx @@ -58,12 +58,12 @@ DrawModelWrapper::DrawModelWrapper( const uno::Reference<uno::XComponentContext> { m_pChartItemPool = ChartItemPool::CreateChartItemPool(); - SetScaleUnit(MAP_100TH_MM); + SetScaleUnit(MapUnit::Map100thMM); SetScaleFraction(Fraction(1, 1)); SetDefaultFontHeight(423); // 12pt SfxItemPool* pMasterPool = &GetItemPool(); - pMasterPool->SetDefaultMetric(MAP_100TH_MM); + pMasterPool->SetDefaultMetric(MapUnit::Map100thMM); pMasterPool->SetPoolDefaultItem(SfxBoolItem(EE_PARA_HYPHENATE, true) ); pMasterPool->SetPoolDefaultItem(makeSvx3DPercentDiagonalItem (5)); @@ -113,7 +113,7 @@ DrawModelWrapper::DrawModelWrapper( const uno::Reference<uno::XComponentContext> m_pRefDevice.disposeAndClear(); m_pRefDevice = VclPtr<VirtualDevice>::Create(*pDefaultDevice); MapMode aMapMode = m_pRefDevice->GetMapMode(); - aMapMode.SetMapUnit(MAP_100TH_MM); + aMapMode.SetMapUnit(MapUnit::Map100thMM); m_pRefDevice->SetMapMode(aMapMode); SetRefDevice(m_pRefDevice.get()); rOutliner.SetRefDevice(m_pRefDevice.get()); |