diff options
339 files changed, 670 insertions, 656 deletions
diff --git a/basctl/source/basicide/baside2.cxx b/basctl/source/basicide/baside2.cxx index c8846b413615..e77e86dd1759 100644 --- a/basctl/source/basicide/baside2.cxx +++ b/basctl/source/basicide/baside2.cxx @@ -799,7 +799,7 @@ sal_Int32 ModulWindow::FormatAndPrint( Printer* pPrinter, sal_Int32 nPrintPage ) aFont.SetTransparent( true ); aFont.SetFontSize( Size( 0, 360 ) ); pPrinter->SetFont( aFont ); - pPrinter->SetMapMode( MapUnit::Map100thMM ); + pPrinter->SetMapMode(MapMode(MapUnit::Map100thMM)); OUString aTitle( CreateQualifiedName() ); diff --git a/basctl/source/basicide/baside2b.cxx b/basctl/source/basicide/baside2b.cxx index 877b8a9e26ef..34b3c62126af 100644 --- a/basctl/source/basicide/baside2b.cxx +++ b/basctl/source/basicide/baside2b.cxx @@ -1554,7 +1554,7 @@ WatchWindow::WatchWindow (Layout* pParent) { aXEdit->SetAccessibleName(IDEResId(RID_STR_WATCHNAME)); aXEdit->SetHelpId(HID_BASICIDE_WATCHWINDOW_EDIT); - aXEdit->SetSizePixel(aXEdit->LogicToPixel(Size(80, 12), MapUnit::MapAppFont)); + aXEdit->SetSizePixel(aXEdit->LogicToPixel(Size(80, 12), MapMode(MapUnit::MapAppFont))); aTreeListBox->SetAccessibleName(IDEResId(RID_STR_WATCHNAME)); long nTextLen = GetTextWidth( aWatchStr ) + DWBORDER + 3; diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx index f2a7aa054833..827474abfbce 100644 --- a/basctl/source/basicide/moduldl2.cxx +++ b/basctl/source/basicide/moduldl2.cxx @@ -474,7 +474,7 @@ LibPage::LibPage(vcl::Window * pParent) { get(m_pBasicsBox, "location"); get(m_pLibBox, "library"); - Size aSize(m_pLibBox->LogicToPixel(Size(130, 87), MapUnit::MapAppFont)); + Size aSize(m_pLibBox->LogicToPixel(Size(130, 87), MapMode(MapUnit::MapAppFont))); m_pLibBox->set_height_request(aSize.Height()); m_pLibBox->set_width_request(aSize.Width()); get(m_pEditButton, "edit"); diff --git a/basctl/source/basicide/moduldlg.cxx b/basctl/source/basicide/moduldlg.cxx index dd5b4697f135..91a90c608d5f 100644 --- a/basctl/source/basicide/moduldlg.cxx +++ b/basctl/source/basicide/moduldlg.cxx @@ -550,7 +550,7 @@ ObjectPage::ObjectPage(vcl::Window *pParent, const OString &rName, BrowseMode nM ".ui") { get(m_pBasicBox, "library"); - Size aSize(m_pBasicBox->LogicToPixel(Size(130, 117), MapUnit::MapAppFont)); + Size aSize(m_pBasicBox->LogicToPixel(Size(130, 117), MapMode(MapUnit::MapAppFont))); m_pBasicBox->set_height_request(aSize.Height()); m_pBasicBox->set_width_request(aSize.Width()); get(m_pEditButton, "edit"); diff --git a/basctl/source/basicide/objdlg.cxx b/basctl/source/basicide/objdlg.cxx index a20f8e3a0a45..16389cadc51f 100644 --- a/basctl/source/basicide/objdlg.cxx +++ b/basctl/source/basicide/objdlg.cxx @@ -112,15 +112,15 @@ void ObjectCatalog::ArrangeWindows() aTitle->Hide(); else { - Size aTitleSize = LogicToPixel(Size(3, 10), MapUnit::MapAppFont); + Size aTitleSize = LogicToPixel(Size(3, 10), MapMode(MapUnit::MapAppFont)); aTitleSize.Width() = aSize.Width() - 2*aTitleSize.Width(); - aTitle->SetPosPixel(LogicToPixel(Point(3, 3), MapUnit::MapAppFont)); + aTitle->SetPosPixel(LogicToPixel(Point(3, 3), MapMode(MapUnit::MapAppFont))); aTitle->SetSizePixel(aTitleSize); aTitle->Show(); } // tree - Point const aTreePos = LogicToPixel(Point(3, bFloating ? 3 : 16), MapUnit::MapAppFont); + Point const aTreePos = LogicToPixel(Point(3, bFloating ? 3 : 16), MapMode(MapUnit::MapAppFont)); long const nMargin = aTreePos.X(); Size const aTreeSize( aSize.Width() - 2*nMargin, diff --git a/basctl/source/dlged/dlgedobj.cxx b/basctl/source/dlged/dlgedobj.cxx index 2590dc74362f..f61986d62592 100644 --- a/basctl/source/dlged/dlgedobj.cxx +++ b/basctl/source/dlged/dlgedobj.cxx @@ -158,8 +158,8 @@ bool DlgEdObj::TransformSdrToControlCoordinates( } // convert pixel to logic units - aPos = pDevice->PixelToLogic( aPos, MapUnit::MapAppFont ); - aSize = pDevice->PixelToLogic( aSize, MapUnit::MapAppFont ); + aPos = pDevice->PixelToLogic(aPos, MapMode(MapUnit::MapAppFont)); + aSize = pDevice->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont)); // set out parameters nXOut = aPos.Width(); @@ -205,8 +205,8 @@ bool DlgEdObj::TransformSdrToFormCoordinates( aSize.Height() -= aDeviceInfo.TopInset + aDeviceInfo.BottomInset; } // convert pixel to logic units - aPos = pDevice->PixelToLogic( aPos, MapUnit::MapAppFont ); - aSize = pDevice->PixelToLogic( aSize, MapUnit::MapAppFont ); + aPos = pDevice->PixelToLogic(aPos, MapMode(MapUnit::MapAppFont)); + aSize = pDevice->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont)); // set out parameters nXOut = aPos.Width(); @@ -246,9 +246,9 @@ bool DlgEdObj::TransformControlToSdrCoordinates( DBG_ASSERT( pDevice, "DlgEdObj::TransformControlToSdrCoordinates: missing default device!" ); if ( !pDevice ) return false; - aPos = pDevice->LogicToPixel( aPos, MapUnit::MapAppFont ); - aSize = pDevice->LogicToPixel( aSize, MapUnit::MapAppFont ); - aFormPos = pDevice->LogicToPixel( aFormPos, MapUnit::MapAppFont ); + aPos = pDevice->LogicToPixel(aPos, MapMode(MapUnit::MapAppFont)); + aSize = pDevice->LogicToPixel(aSize, MapMode(MapUnit::MapAppFont)); + aFormPos = pDevice->LogicToPixel(aFormPos, MapMode(MapUnit::MapAppFont)); // add form position aPos.Width() += aFormPos.Width(); @@ -296,8 +296,8 @@ bool DlgEdObj::TransformFormToSdrCoordinates( if ( !lcl_getDlgEdForm( this, pForm ) ) return false; - aPos = pDevice->LogicToPixel( aPos, MapUnit::MapAppFont ); - aSize = pDevice->LogicToPixel( aSize, MapUnit::MapAppFont ); + aPos = pDevice->LogicToPixel(aPos, MapMode(MapUnit::MapAppFont)); + aSize = pDevice->LogicToPixel(aSize, MapMode(MapUnit::MapAppFont)); // take window borders into account Reference< beans::XPropertySet > xPSetForm( pForm->GetUnoControlModel(), UNO_QUERY ); diff --git a/basic/source/runtime/inputbox.cxx b/basic/source/runtime/inputbox.cxx index 7f7730728649..1d0e4e335e3c 100644 --- a/basic/source/runtime/inputbox.cxx +++ b/basic/source/runtime/inputbox.cxx @@ -104,7 +104,7 @@ void SvRTLInputBox::PositionDialog(long nXTwips, long nYTwips, const Size& rDlgS if( nXTwips != -1 && nYTwips != -1 ) { Point aDlgPosApp( nXTwips, nYTwips ); - SetPosPixel( LogicToPixel( aDlgPosApp, MapUnit::MapTwip ) ); + SetPosPixel(LogicToPixel(aDlgPosApp, MapMode(MapUnit::MapTwip))); } } diff --git a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx index f5205d1691a6..5aa508d93ed0 100644 --- a/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx +++ b/chart2/source/controller/chartapiwrapper/WrappedSymbolProperties.cxx @@ -388,7 +388,7 @@ void lcl_correctSymbolSizeForBitmaps( chart2::Symbol& rSymbol ) if( xProp->getPropertyValue( "SizePixel" ) >>= aAWTPixelSize ) { Size aPixelSize(aAWTPixelSize.Width,aAWTPixelSize.Height); - Size aNewSize = ( OutputDevice::LogicToLogic( aPixelSize, MapUnit::MapPixel, MapUnit::Map100thMM )); + Size aNewSize = OutputDevice::LogicToLogic(aPixelSize, MapMode(MapUnit::MapPixel), MapMode(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 e1978f0e44e3..02b2856d1ae1 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, MapUnit::MapAppFont ); + aSize = m_pDevice->LogicToPixel(aSize, MapMode(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, MapUnit::MapAppFont ); + aSize = m_pDevice->LogicToPixel(aSize, MapMode(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, MapUnit::MapAppFont ); + aSize = m_pDevice->LogicToPixel(aSize, MapMode(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, MapUnit::MapAppFont ); + aSize = m_pDevice->LogicToPixel(aSize, MapMode(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, MapUnit::MapAppFont ); + aSize = m_pDevice->LogicToPixel(aSize, MapMode(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 ), MapUnit::MapAppFont ).getWidth()); + SetWidth( m_pDevice->PixelToLogic(Size(nWidth, 0), MapMode(MapUnit::MapAppFont)).getWidth()); } void SeriesHeader::SetChartType( @@ -578,7 +578,7 @@ void DataBrowser::RenewTable() OUString aDefaultSeriesName(SchResId(STR_COLUMN_LABEL)); replaceParamterInString( aDefaultSeriesName, "%COLUMNNUMBER", OUString::number( 24 ) ); sal_Int32 nColumnWidth = GetDataWindow().GetTextWidth( aDefaultSeriesName ) - + GetDataWindow().LogicToPixel( Point( 4 + impl::SeriesHeader::GetRelativeAppFontXPosForNameField(), 0 ), MapUnit::MapAppFont ).X(); + + GetDataWindow().LogicToPixel(Point(4 + impl::SeriesHeader::GetRelativeAppFontXPosForNameField(), 0), MapMode(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 4eeeb775da4e..83531433d1f7 100644 --- a/chart2/source/controller/dialogs/dlg_CreationWizard.cxx +++ b/chart2/source/controller/dialogs/dlg_CreationWizard.cxx @@ -72,8 +72,8 @@ CreationWizard::CreationWizard(vcl::Window* pParent, const uno::Reference<frame: SetRoadmapHelpId(HID_SCH_WIZARD_ROADMAP); SetRoadmapInteractive(true); - Size aAdditionalRoadmapSize(LogicToPixel(Size(85, 0), MapUnit::MapAppFont)); - Size aSize(LogicToPixel(Size(CHART_WIZARD_PAGEWIDTH, CHART_WIZARD_PAGEHEIGHT), MapUnit::MapAppFont)); + Size aAdditionalRoadmapSize(LogicToPixel(Size(85, 0), MapMode(MapUnit::MapAppFont))); + Size aSize(LogicToPixel(Size(CHART_WIZARD_PAGEWIDTH, CHART_WIZARD_PAGEHEIGHT), MapMode(MapUnit::MapAppFont))); aSize.Width() += aAdditionalRoadmapSize.Width(); SetSizePixel(aSize); diff --git a/chart2/source/controller/dialogs/dlg_DataEditor.cxx b/chart2/source/controller/dialogs/dlg_DataEditor.cxx index a7ac832c2e4e..9392444e8494 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), MapUnit::MapAppFont)); + Size aSize(m_xBrwData->LogicToPixel(Size(232, 121), MapMode(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 a393aaba1eb9..acaae5c1f7a4 100644 --- a/chart2/source/controller/dialogs/tp_ChartType.cxx +++ b/chart2/source/controller/dialogs/tp_ChartType.cxx @@ -679,7 +679,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), MapUnit::MapAppFont)); + Size aSize(m_pSubTypeList->LogicToPixel(Size(150, 50), MapMode(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 6d3f05666fce..f7e28f69a8b6 100644 --- a/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx +++ b/chart2/source/controller/drawinglayer/ViewElementListProvider.cxx @@ -177,7 +177,7 @@ Graphic ViewElementListProvider::GetSymbolGraphic( sal_Int32 nStandardSymbol, co Graphic aGraph(aMeta); Size aSize = pObj->GetSnapRect().GetSize(); aGraph.SetPrefSize(aSize); - aGraph.SetPrefMapMode(MapUnit::Map100thMM); + aGraph.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); pView->UnmarkAll(); pObj=pPage->RemoveObject(0); diff --git a/chart2/source/controller/main/ChartWindow.cxx b/chart2/source/controller/main/ChartWindow.cxx index 4dccd6ebaf29..8949e8dbc58a 100644 --- a/chart2/source/controller/main/ChartWindow.cxx +++ b/chart2/source/controller/main/ChartWindow.cxx @@ -332,7 +332,7 @@ void ChartWindow::LogicInvalidate(const tools::Rectangle* pRectangle) if (IsMapModeEnabled()) { if (GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); } else { diff --git a/chart2/source/controller/main/ElementSelector.cxx b/chart2/source/controller/main/ElementSelector.cxx index 4af2f3d54e2e..4f660cf8cb8b 100644 --- a/chart2/source/controller/main/ElementSelector.cxx +++ b/chart2/source/controller/main/ElementSelector.cxx @@ -301,7 +301,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, MapUnit::MapAppFont ); + ::Size aPixelSize = m_apSelectorListBox->LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont)); m_apSelectorListBox->SetSizePixel( aPixelSize ); m_apSelectorListBox->SetDropDownLineCount( 5 ); } diff --git a/chart2/source/view/main/ChartView.cxx b/chart2/source/view/main/ChartView.cxx index 35f4751f397c..e13d6b9cbc56 100644 --- a/chart2/source/view/main/ChartView.cxx +++ b/chart2/source/view/main/ChartView.cxx @@ -3388,7 +3388,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::Map100thMM ); + Size aSize = pWindow->LogicToPixel(Size(aPageSize.Width, aPageSize.Height), MapMode(MapUnit::Map100thMM)); pWindow->SetSizePixel(aSize); } pWindow->Show(); diff --git a/cppcanvas/source/mtfrenderer/implrenderer.cxx b/cppcanvas/source/mtfrenderer/implrenderer.cxx index d7a8850b2883..6804b121fd7f 100644 --- a/cppcanvas/source/mtfrenderer/implrenderer.cxx +++ b/cppcanvas/source/mtfrenderer/implrenderer.cxx @@ -805,7 +805,7 @@ namespace cppcanvas rFontSizeLog = ::Size(0, 16); // convert to target MapUnit if not pixels - rFontSizeLog = OutputDevice::LogicToLogic(rFontSizeLog, MapUnit::MapPixel, rParms.mrVDev.GetMapMode()); + rFontSizeLog = OutputDevice::LogicToLogic(rFontSizeLog, MapMode(MapUnit::MapPixel), rParms.mrVDev.GetMapMode()); } const sal_Int32 nFontWidthLog = rFontSizeLog.Width(); diff --git a/cui/source/customize/acccfg.cxx b/cui/source/customize/acccfg.cxx index b314af956459..bf1635051f98 100644 --- a/cui/source/customize/acccfg.cxx +++ b/cui/source/customize/acccfg.cxx @@ -742,20 +742,20 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const get(m_pSaveButton, "save"); get(m_pResetButton, "reset"); get(m_pEntriesBox, "shortcuts"); - Size aSize(LogicToPixel(Size(174, 100), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(174, 100), MapMode(MapUnit::MapAppFont))); m_pEntriesBox->set_width_request(aSize.Width()); m_pEntriesBox->set_height_request(aSize.Height()); m_pEntriesBox->SetAccelConfigPage(this); get(m_pGroupLBox, "category"); - aSize = LogicToPixel(Size(78 , 91), MapUnit::MapAppFont); + aSize = LogicToPixel(Size(78 , 91), MapMode(MapUnit::MapAppFont)); m_pGroupLBox->set_width_request(aSize.Width()); m_pGroupLBox->set_height_request(aSize.Height()); get(m_pFunctionBox, "function"); - aSize = LogicToPixel(Size(88, 91), MapUnit::MapAppFont); + aSize = LogicToPixel(Size(88, 91), MapMode(MapUnit::MapAppFont)); m_pFunctionBox->set_width_request(aSize.Width()); m_pFunctionBox->set_height_request(aSize.Height()); get(m_pKeyBox, "keys"); - aSize = LogicToPixel(Size(80, 91), MapUnit::MapAppFont); + aSize = LogicToPixel(Size(80, 91), MapMode(MapUnit::MapAppFont)); m_pKeyBox->set_width_request(aSize.Width()); m_pKeyBox->set_height_request(aSize.Height()); get(m_pSearchEdit, "searchEntry"); @@ -795,7 +795,7 @@ SfxAcceleratorConfigPage::SfxAcceleratorConfigPage( vcl::Window* pParent, const nMaxWidth = nTmp; } // recalc second tab - long nNewTab = PixelToLogic( Size( nMaxWidth, 0 ), MapUnit::MapAppFont ).Width(); + long nNewTab = PixelToLogic(Size(nMaxWidth, 0), MapMode(MapUnit::MapAppFont)).Width(); nNewTab = nNewTab + 5; // additional space m_pEntriesBox->SetTab( 1, nNewTab ); diff --git a/cui/source/customize/cfg.cxx b/cui/source/customize/cfg.cxx index d1ba1b61f5a5..d6aa0b1eabab 100644 --- a/cui/source/customize/cfg.cxx +++ b/cui/source/customize/cfg.cxx @@ -1168,7 +1168,7 @@ SvxConfigPage::SvxConfigPage(vcl::Window *pParent, const SfxItemSet& rSet) get(m_pDescriptionField, "desc"); m_pDescriptionField->set_height_request(m_pDescriptionField->GetTextHeight()*2.9); get(m_pEntries, "entries"); - Size aSize(LogicToPixel(Size(108, 115), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(108, 115), MapMode(MapUnit::MapAppFont))); m_pEntries->set_height_request(aSize.Height()); m_pEntries->set_width_request(aSize.Width()); m_pFunctions->set_height_request(aSize.Height()); diff --git a/cui/source/customize/eventdlg.cxx b/cui/source/customize/eventdlg.cxx index 02b8961e033d..d96325931e71 100644 --- a/cui/source/customize/eventdlg.cxx +++ b/cui/source/customize/eventdlg.cxx @@ -63,7 +63,7 @@ SvxEventConfigPage::SvxEventConfigPage(vcl::Window *pParent, const SfxItemSet& r mpImpl->sStrEvent = get<FixedText>("eventft")->GetText(); mpImpl->sAssignedMacro = get<FixedText>("actionft")->GetText(); get(mpImpl->pEventLB, "events"); - Size aSize(LogicToPixel(Size(205, 229), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(205, 229), MapMode(MapUnit::MapAppFont))); mpImpl->pEventLB->set_width_request(aSize.Width()); mpImpl->pEventLB->set_height_request(aSize.Height()); get(mpImpl->pAssignPB, "macro"); diff --git a/cui/source/dialogs/SpellDialog.cxx b/cui/source/dialogs/SpellDialog.cxx index a86acf2a5405..a81b3ede251a 100644 --- a/cui/source/dialogs/SpellDialog.cxx +++ b/cui/source/dialogs/SpellDialog.cxx @@ -183,7 +183,7 @@ SpellDialog::SpellDialog(SpellDialogChildWindow* pChildWindow, get(m_pExplainLink, "explainlink"); get(m_pNotInDictFT, "notindictft"); get(m_pSentenceED, "sentence"); - Size aEdSize(LogicToPixel(Size(197, 48), MapUnit::MapAppFont)); + Size aEdSize(LogicToPixel(Size(197, 48), MapMode(MapUnit::MapAppFont))); m_pSentenceED->set_width_request(aEdSize.Width()); m_pSentenceED->set_height_request(aEdSize.Height()); get(m_pSuggestionFT, "suggestionsft"); diff --git a/cui/source/dialogs/colorpicker.cxx b/cui/source/dialogs/colorpicker.cxx index 5546573e0645..2d9d0c4e53ed 100644 --- a/cui/source/dialogs/colorpicker.cxx +++ b/cui/source/dialogs/colorpicker.cxx @@ -259,7 +259,7 @@ VCL_BUILDER_FACTORY_CONSTRUCTOR(ColorFieldControl, 0) Size ColorFieldControl::GetOptimalSize() const { - return LogicToPixel(Size(158, 158), MapUnit::MapAppFont); + return LogicToPixel(Size(158, 158), MapMode(MapUnit::MapAppFont)); } void ColorFieldControl::UpdateBitmap() diff --git a/cui/source/dialogs/cuigaldlg.cxx b/cui/source/dialogs/cuigaldlg.cxx index 5685b48d333a..edd5e8ac8fe6 100644 --- a/cui/source/dialogs/cuigaldlg.cxx +++ b/cui/source/dialogs/cuigaldlg.cxx @@ -718,7 +718,7 @@ TPGalleryThemeProperties::TPGalleryThemeProperties( vcl::Window* pWindow, const { get(m_pCbbFileType, "filetype"); get(m_pLbxFound, "files"); - Size aSize(LogicToPixel(Size(172, 156), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(172, 156), MapMode(MapUnit::MapAppFont))); m_pLbxFound->set_width_request(aSize.Width()); m_pLbxFound->set_height_request(aSize.Height()); m_pLbxFound->EnableMultiSelection(true); diff --git a/cui/source/dialogs/cuigrfflt.cxx b/cui/source/dialogs/cuigrfflt.cxx index 5ad65ac327ba..4c1d3fcf6cc9 100644 --- a/cui/source/dialogs/cuigrfflt.cxx +++ b/cui/source/dialogs/cuigrfflt.cxx @@ -41,7 +41,7 @@ VCL_BUILDER_FACTORY_CONSTRUCTOR(GraphicPreviewWindow, WB_TABSTOP) Size GraphicPreviewWindow::GetOptimalSize() const { - return LogicToPixel(Size(81, 73), MapUnit::MapAppFont); + return LogicToPixel(Size(81, 73), MapMode(MapUnit::MapAppFont)); } @@ -525,7 +525,7 @@ void EmbossControl::MouseButtonDown( const MouseEvent& rEvt ) Size EmbossControl::GetOptimalSize() const { - return LogicToPixel(Size(77, 60), MapUnit::MapAppFont); + return LogicToPixel(Size(77, 60), MapMode(MapUnit::MapAppFont)); } diff --git a/cui/source/dialogs/hlmarkwn.cxx b/cui/source/dialogs/hlmarkwn.cxx index 579181dcea5f..0af200e7a955 100644 --- a/cui/source/dialogs/hlmarkwn.cxx +++ b/cui/source/dialogs/hlmarkwn.cxx @@ -89,7 +89,7 @@ VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxHlmarkTreeLBox, WB_TABSTOP) Size SvxHlmarkTreeLBox::GetOptimalSize() const { - return LogicToPixel(Size(103, 162), MapUnit::MapAppFont); + return LogicToPixel(Size(103, 162), MapMode(MapUnit::MapAppFont)); } void SvxHlmarkTreeLBox::Paint(vcl::RenderContext& rRenderContext, const ::tools::Rectangle& rRect) diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx index 4a5538922c95..86a2963014dd 100644 --- a/cui/source/dialogs/linkdlg.cxx +++ b/cui/source/dialogs/linkdlg.cxx @@ -99,7 +99,7 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b aUpdateIdle("cui SvBaseLinksDlg UpdateIdle") { get(m_pTbLinks, "TB_LINKS"); - Size aSize(LogicToPixel(Size(257, 87), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(257, 87), MapMode(MapUnit::MapAppFont))); m_pTbLinks->set_width_request(aSize.Width()); m_pTbLinks->set_height_request(aSize.Height()); get(m_pFtFullFileName, "FULL_FILE_NAME"); @@ -115,11 +115,11 @@ SvBaseLinksDlg::SvBaseLinksDlg( vcl::Window * pParent, LinkManager* pMgr, bool b m_pTbLinks->SetSelectionMode( SelectionMode::Multiple ); m_pTbLinks->SetTabs( &nTabs[0] ); FixedText *pFtFiles = get<FixedText>("FILES"); - pFtFiles->set_width_request(LogicToPixel(Size(nTabs[2] - nTabs[1] - 2, 0), MapUnit::MapAppFont).Width()); + pFtFiles->set_width_request(LogicToPixel(Size(nTabs[2] - nTabs[1] - 2, 0), MapMode(MapUnit::MapAppFont)).Width()); FixedText *pFtLinks = get<FixedText>("LINKS"); - pFtLinks->set_width_request(LogicToPixel(Size(nTabs[3] - nTabs[2] - 2, 0), MapUnit::MapAppFont).Width()); + pFtLinks->set_width_request(LogicToPixel(Size(nTabs[3] - nTabs[2] - 2, 0), MapMode(MapUnit::MapAppFont)).Width()); FixedText *pFtTypes = get<FixedText>("TYPE"); - pFtTypes->set_width_request(LogicToPixel(Size(nTabs[4] - nTabs[3] - 2, 0), MapUnit::MapAppFont).Width()); + pFtTypes->set_width_request(LogicToPixel(Size(nTabs[4] - nTabs[3] - 2, 0), MapMode(MapUnit::MapAppFont)).Width()); m_pTbLinks->Resize(); // OS: hack for correct selection // UpdateTimer for DDE-/Grf-links, which are waited for diff --git a/cui/source/dialogs/multipat.cxx b/cui/source/dialogs/multipat.cxx index 69ecf270d382..e52bdd06b11b 100644 --- a/cui/source/dialogs/multipat.cxx +++ b/cui/source/dialogs/multipat.cxx @@ -179,7 +179,7 @@ SvxMultiPathDialog::SvxMultiPathDialog(vcl::Window* pParent) get(m_pDelBtn, "delete"); SvSimpleTableContainer* pRadioLBContainer = get<SvSimpleTableContainer>("paths"); - Size aSize(LogicToPixel(Size(195, 77), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(195, 77), MapMode(MapUnit::MapAppFont))); pRadioLBContainer->set_width_request(aSize.Width()); pRadioLBContainer->set_height_request(aSize.Height()); m_pRadioLB = VclPtr<svx::SvxRadioButtonListBox>::Create(*pRadioLBContainer, 0); @@ -207,7 +207,7 @@ SvxPathSelectDialog::SvxPathSelectDialog(vcl::Window* pParent) get(m_pAddBtn, "add"); get(m_pDelBtn, "delete"); get(m_pPathLB, "paths"); - Size aSize(LogicToPixel(Size(189, 80), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(189, 80), MapMode(MapUnit::MapAppFont))); m_pPathLB->set_width_request(aSize.Width()); m_pPathLB->set_height_request(aSize.Height()); diff --git a/cui/source/dialogs/screenshotannotationdlg.cxx b/cui/source/dialogs/screenshotannotationdlg.cxx index e75957c1848b..49ffbc98e2ca 100644 --- a/cui/source/dialogs/screenshotannotationdlg.cxx +++ b/cui/source/dialogs/screenshotannotationdlg.cxx @@ -265,7 +265,7 @@ ScreenshotAnnotationDlg_Impl::ScreenshotAnnotationDlg_Impl( mpText->set_width_request(400); mpText->set_height_request( mpText->GetTextHeight() * 10 ); OUString aHelpId = OStringToOUString( mrParentDialog.GetHelpId(), RTL_TEXTENCODING_UTF8 ); - Size aSizeCm = mrParentDialog.PixelToLogic( maParentDialogSize, MapUnit::MapCM ); + Size aSizeCm = mrParentDialog.PixelToLogic(maParentDialogSize, MapMode(MapUnit::MapCM)); maMainMarkupText = lcl_ParagraphWithImage( aHelpId, aSizeCm ); mpText->SetText( maMainMarkupText ); mpText->SetReadOnly(); diff --git a/cui/source/options/certpath.cxx b/cui/source/options/certpath.cxx index 3cd712174f75..cc2e6b99dad6 100644 --- a/cui/source/options/certpath.cxx +++ b/cui/source/options/certpath.cxx @@ -29,7 +29,7 @@ CertPathDialog::CertPathDialog(vcl::Window* pParent) get(m_pOKBtn, "ok"); get(m_pAddBtn, "add"); get(m_pCertPathListContainer, "paths"); - Size aSize(LogicToPixel(Size(210, 60), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(210, 60), MapMode(MapUnit::MapAppFont))); m_pCertPathListContainer->set_width_request(aSize.Width()); m_pCertPathListContainer->set_height_request(aSize.Height()); m_pCertPathList = diff --git a/cui/source/options/connpooloptions.cxx b/cui/source/options/connpooloptions.cxx index 5e5da2593100..2b6767ff90c0 100644 --- a/cui/source/options/connpooloptions.cxx +++ b/cui/source/options/connpooloptions.cxx @@ -127,11 +127,11 @@ namespace offapp { EditBrowseBox::Init(); - Size aColWidth = LogicToPixel(Size(160, 0), MapUnit::MapAppFont); + Size aColWidth = LogicToPixel(Size(160, 0), MapMode(MapUnit::MapAppFont)); InsertDataColumn(1, CuiResId(RID_SVXSTR_DRIVER_NAME), aColWidth.Width()); - aColWidth = LogicToPixel(Size(30, 0), MapUnit::MapAppFont); + aColWidth = LogicToPixel(Size(30, 0), MapMode(MapUnit::MapAppFont)); InsertDataColumn(2, CuiResId(RID_SVXSTR_POOLED_FLAG), aColWidth.Width()); - aColWidth = LogicToPixel(Size(60, 0), MapUnit::MapAppFont); + aColWidth = LogicToPixel(Size(60, 0), MapMode(MapUnit::MapAppFont)); InsertDataColumn(3, CuiResId(RID_SVXSTR_POOL_TIMEOUT), aColWidth.Width()); // Attention: the resource of the string is local to the resource of the enclosing dialog! } @@ -303,7 +303,7 @@ namespace offapp get(m_pTimeout, "timeout"); Size aControlSize(248, 100); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); m_pDriverList->set_width_request(aControlSize.Width()); m_pDriverList->set_height_request(aControlSize.Height()); m_pDriverList->Init(); diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index fc02372cdd48..4c334d9bcbe2 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -111,7 +111,7 @@ DbRegistrationOptionsPage::DbRegistrationOptionsPage( vcl::Window* pParent, cons { get(m_pPathCtrl, "pathctrl"); Size aControlSize(248, 147); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); m_pPathCtrl->set_width_request(aControlSize.Width()); m_pPathCtrl->set_height_request(aControlSize.Height()); diff --git a/cui/source/options/fontsubs.cxx b/cui/source/options/fontsubs.cxx index eb67957b9588..b7ceda7a8576 100644 --- a/cui/source/options/fontsubs.cxx +++ b/cui/source/options/fontsubs.cxx @@ -57,7 +57,7 @@ SvxFontSubstTabPage::SvxFontSubstTabPage( vcl::Window* pParent, SvSimpleTableContainer *pCheckLBContainer = get<SvSimpleTableContainer>("checklb"); Size aControlSize(248, 75); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pCheckLBContainer->set_width_request(aControlSize.Width()); pCheckLBContainer->set_height_request(aControlSize.Height()); @@ -418,7 +418,7 @@ void SvxFontSubstCheckListBox::setColSizes() long nW1 = rBar.GetTextWidth(rBar.GetItemText(3)); long nW2 = rBar.GetTextWidth(rBar.GetItemText(4)); long nMax = std::max( nW1, nW2 ) + 6; // width of the longest header + a little offset - long nMin = rBar.LogicToPixel(Size(10, 0), MapUnit::MapAppFont).Width(); + long nMin = rBar.LogicToPixel(Size(10, 0), MapMode(MapUnit::MapAppFont)).Width(); nMax = std::max( nMax, nMin ); const long nDoubleMax = 2*nMax; const long nRest = GetSizePixel().Width() - nDoubleMax; diff --git a/cui/source/options/optaboutconfig.cxx b/cui/source/options/optaboutconfig.cxx index df500a2c28b8..ca6ca3673353 100644 --- a/cui/source/options/optaboutconfig.cxx +++ b/cui/source/options/optaboutconfig.cxx @@ -137,7 +137,7 @@ void CuiCustomMultilineEdit::KeyInput( const KeyEvent& rKeyEvent ) Size CuiCustomMultilineEdit::GetOptimalSize() const { - return LogicToPixel(Size(150, GetTextHeight()), MapUnit::MapAppFont); + return LogicToPixel(Size(150, GetTextHeight()), MapMode(MapUnit::MapAppFont)); } CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxItemSet& rItemSet*/ ) : @@ -150,7 +150,7 @@ CuiAboutConfigTabPage::CuiAboutConfigTabPage( vcl::Window* pParent/*, const SfxI m_vectorOfModified(), m_pPrefBox( VclPtr<SvSimpleTable>::Create(*m_pPrefCtrl, WB_SCROLL | WB_HSCROLL | WB_VSCROLL ) ) { - Size aControlSize(LogicToPixel(Size(385, 230), MapUnit::MapAppFont)); + Size aControlSize(LogicToPixel(Size(385, 230), MapMode(MapUnit::MapAppFont))); m_pPrefCtrl->set_width_request(aControlSize.Width()); m_pPrefCtrl->set_height_request(aControlSize.Height()); diff --git a/cui/source/options/optfltr.cxx b/cui/source/options/optfltr.cxx index 478aacb4bd89..d1fd93342264 100644 --- a/cui/source/options/optfltr.cxx +++ b/cui/source/options/optfltr.cxx @@ -157,7 +157,7 @@ OfaMSFilterTabPage2::OfaMSFilterTabPage2( vcl::Window* pParent, const SfxItemSet get( aShadingRB, "shading" ); Size aControlSize(248, 55); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); m_pCheckLBContainer->set_width_request(aControlSize.Width()); m_pCheckLBContainer->set_height_request(aControlSize.Height()); diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx index b226fc143739..b3443d7734c4 100644 --- a/cui/source/options/optjava.cxx +++ b/cui/source/options/optjava.cxx @@ -83,7 +83,7 @@ public: if (rBar.GetItemCount() < 4) return; long nCheckWidth = std::max(GetControlColumnWidth() + 12, - rBar.LogicToPixel(Size(15, 0), MapUnit::MapAppFont).Width()); + rBar.LogicToPixel(Size(15, 0), MapMode(MapUnit::MapAppFont)).Width()); long nVersionWidth = 12 + std::max(rBar.GetTextWidth(rBar.GetItemText(3)), GetTextWidth("0.0.0_00-icedtea")); @@ -131,7 +131,7 @@ SvxJavaOptionsPage::SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet& SvSimpleTableContainer *pJavaListContainer = get<SvSimpleTableContainer>("javas"); Size aControlSize(177, 60); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pJavaListContainer->set_width_request(aControlSize.Width()); pJavaListContainer->set_height_request(aControlSize.Height()); m_pJavaList = VclPtr<SvxJavaListBox>::Create(*pJavaListContainer, m_sAccessibilityText); diff --git a/cui/source/options/optlingu.cxx b/cui/source/options/optlingu.cxx index e02914813903..b8b80d3000ac 100644 --- a/cui/source/options/optlingu.cxx +++ b/cui/source/options/optlingu.cxx @@ -1758,7 +1758,7 @@ SvxEditModulesDlg::SvxEditModulesDlg(vcl::Window* pParent, SvxLinguData_Impl& rD get(m_pPrioDownPB, "down"); get(m_pPrioUpPB, "up"); get(m_pModulesCLB, "lingudicts"); - Size aListSize(m_pModulesCLB->LogicToPixel(Size(166, 120), MapUnit::MapAppFont)); + Size aListSize(m_pModulesCLB->LogicToPixel(Size(166, 120), MapMode(MapUnit::MapAppFont))); m_pModulesCLB->set_height_request(aListSize.Height()); m_pModulesCLB->set_width_request(aListSize.Width()); get(m_pLanguageLB, "language"); diff --git a/cui/source/options/optpath.cxx b/cui/source/options/optpath.cxx index ffe3d530f9c8..6651c2d22dff 100644 --- a/cui/source/options/optpath.cxx +++ b/cui/source/options/optpath.cxx @@ -204,7 +204,7 @@ SvxPathTabPage::SvxPathTabPage(vcl::Window* pParent, const SfxItemSet& rSet) m_pPathBtn->SetClickHdl( LINK( this, SvxPathTabPage, PathHdl_Impl ) ); Size aControlSize(236 , 147); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); m_pPathCtrl->set_width_request(aControlSize.Width()); m_pPathCtrl->set_height_request(aControlSize.Height()); WinBits nBits = WB_SORT | WB_HSCROLL | WB_CLIPCHILDREN | WB_TABSTOP; diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx index 07f469b2b307..898453f300bd 100644 --- a/cui/source/options/treeopt.cxx +++ b/cui/source/options/treeopt.cxx @@ -488,7 +488,7 @@ void OfaTreeOptionsDialog::InitWidgets() get(pBackPB, "revert"); get(pTreeLB, "pages"); get(pTabBox, "box"); - Size aSize(pTabBox->LogicToPixel(Size(278, 259), MapUnit::MapAppFont)); + Size aSize(pTabBox->LogicToPixel(Size(278, 259), MapMode(MapUnit::MapAppFont))); pTabBox->set_width_request(aSize.Width()); pTabBox->set_height_request(aSize.Height() - get_action_area()->get_preferred_size().Height()); pTreeLB->set_width_request(pTreeLB->approximate_char_width() * 25); diff --git a/cui/source/tabpages/autocdlg.cxx b/cui/source/tabpages/autocdlg.cxx index 9b356317e54a..8292c7c27120 100644 --- a/cui/source/tabpages/autocdlg.cxx +++ b/cui/source/tabpages/autocdlg.cxx @@ -437,7 +437,7 @@ OfaSwAutoFmtOptionsPage::OfaSwAutoFmtOptionsPage( vcl::Window* pParent, SvSimpleTableContainer* pCheckLBContainer(get<SvSimpleTableContainer>("list")); Size aControlSize(248 , 149); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pCheckLBContainer->set_width_request(aControlSize.Width()); pCheckLBContainer->set_height_request(aControlSize.Height()); m_pCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pCheckLBContainer); @@ -1819,7 +1819,7 @@ OfaQuoteTabPage::OfaQuoteTabPage(vcl::Window* pParent, const SfxItemSet& rSet) SvSimpleTableContainer *pListContainer = get<SvSimpleTableContainer>("list"); Size aControlSize(252 , 85); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pListContainer->set_width_request(aControlSize.Width()); pListContainer->set_height_request(aControlSize.Height()); m_pSwCheckLB = VclPtr<OfaACorrCheckListBox>::Create(*pListContainer); @@ -2186,7 +2186,7 @@ OfaAutoCompleteTabPage::OfaAutoCompleteTabPage(vcl::Window* pParent, get(m_pNFMaxEntries, "maxentries"); get(m_pLBEntries, "entries"); m_pLBEntries->SetPage(this); - aSize = LogicToPixel(Size(121, 158), MapUnit::MapAppFont); + aSize = LogicToPixel(Size(121, 158), MapMode(MapUnit::MapAppFont)); m_pLBEntries->set_width_request(aSize.Width()); m_pLBEntries->set_height_request(aSize.Height()); get(m_pPBEntries, "delete"); @@ -2464,7 +2464,7 @@ OfaSmartTagOptionsTabPage::OfaSmartTagOptionsTabPage( vcl::Window* pParent, // some options for the list box: m_pSmartTagTypesLB->SetStyle( m_pSmartTagTypesLB->GetStyle() | WB_HSCROLL | WB_HIDESELECTION ); m_pSmartTagTypesLB->SetHighlightRange(); - Size aControlSize(LogicToPixel(Size(172, 154), MapUnit::MapAppFont)); + Size aControlSize(LogicToPixel(Size(172, 154), MapMode(MapUnit::MapAppFont))); m_pSmartTagTypesLB->set_width_request(aControlSize.Width()); m_pSmartTagTypesLB->set_height_request(aControlSize.Height()); diff --git a/cui/source/tabpages/grfpage.cxx b/cui/source/tabpages/grfpage.cxx index 3661f5b74de4..6009f92f9749 100644 --- a/cui/source/tabpages/grfpage.cxx +++ b/cui/source/tabpages/grfpage.cxx @@ -771,7 +771,7 @@ SvxCropExample::SvxCropExample( vcl::Window* pPar, WinBits nStyle ) Size SvxCropExample::GetOptimalSize() const { - return LogicToPixel(Size(78, 78), MapUnit::MapAppFont); + return LogicToPixel(Size(78, 78), MapMode(MapUnit::MapAppFont)); } VCL_BUILDER_FACTORY_CONSTRUCTOR(SvxCropExample, 0) diff --git a/cui/source/tabpages/labdlg.cxx b/cui/source/tabpages/labdlg.cxx index dfc7e0f74342..f16c4c81b4e4 100644 --- a/cui/source/tabpages/labdlg.cxx +++ b/cui/source/tabpages/labdlg.cxx @@ -86,7 +86,7 @@ SvxCaptionTabPage::SvxCaptionTabPage(vcl::Window* pParent, const SfxItemSet& rIn { get(m_pCT_CAPTTYPE, "valueset"); - Size aSize(m_pCT_CAPTTYPE->LogicToPixel(Size(187, 38), MapUnit::MapAppFont)); + Size aSize(m_pCT_CAPTTYPE->LogicToPixel(Size(187, 38), MapMode(MapUnit::MapAppFont))); m_pCT_CAPTTYPE->set_width_request(aSize.Width()); m_pCT_CAPTTYPE->set_height_request(aSize.Height()); diff --git a/cui/source/tabpages/numpages.cxx b/cui/source/tabpages/numpages.cxx index ad8078fe6602..bfed9705b462 100644 --- a/cui/source/tabpages/numpages.cxx +++ b/cui/source/tabpages/numpages.cxx @@ -963,7 +963,7 @@ IMPL_LINK_NOARG(SvxBitmapPickTabPage, NumSelectHdl_Impl, ValueSet*, void) { Size aSize = SvxNumberFormat::GetGraphicSizeMM100(&aGraphic); sal_Int16 eOrient = text::VertOrientation::LINE_CENTER; - aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, eCoreUnit); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(eCoreUnit)); SvxBrushItem aBrush(aGraphic, GPOS_AREA, SID_ATTR_BRUSH ); aFmt.SetGraphicBrush( &aBrush, &aSize, &eOrient ); } @@ -1980,7 +1980,7 @@ IMPL_LINK( SvxNumOptionsTabPage, GraphicHdl_Impl, MenuButton *, pButton, void ) } if(bSucc) { - aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, eCoreUnit); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(eCoreUnit)); sal_uInt16 nMask = 1; for(sal_uInt16 i = 0; i < pActNum->GetLevelCount(); i++) diff --git a/cui/source/tabpages/page.cxx b/cui/source/tabpages/page.cxx index 90612b428267..4e895fa09ff7 100644 --- a/cui/source/tabpages/page.cxx +++ b/cui/source/tabpages/page.cxx @@ -264,7 +264,7 @@ SvxPageDescPage::SvxPageDescPage( vcl::Window* pParent, const SfxItemSet& rAttr } MapMode aOldMode = mpDefPrinter->GetMapMode(); - mpDefPrinter->SetMapMode( MapUnit::MapTwip ); + mpDefPrinter->SetMapMode(MapMode(MapUnit::MapTwip)); // set first- and last-values for the margins Size aPaperSize = mpDefPrinter->GetPaperSize(); @@ -509,7 +509,7 @@ void SvxPageDescPage::Reset( const SfxItemSet* rSet ) m_pBspWin->SetSize( Size( ConvertLong_Impl( aPaperSize.Width(), eUnit ), ConvertLong_Impl( aPaperSize.Height(), eUnit ) ) ); - aPaperSize = OutputDevice::LogicToLogic(aPaperSize, eUnit, MapUnit::Map100thMM); + aPaperSize = OutputDevice::LogicToLogic(aPaperSize, MapMode(eUnit), MapMode(MapUnit::Map100thMM)); if ( bLandscape ) Swap( aPaperSize ); @@ -1039,7 +1039,7 @@ void SvxPageDescPage::SwapFirstValues_Impl( bool bSet ) eOri = Orientation::Landscape; Orientation eOldOri = mpDefPrinter->GetOrientation(); mpDefPrinter->SetOrientation( eOri ); - mpDefPrinter->SetMapMode( MapUnit::MapTwip ); + mpDefPrinter->SetMapMode(MapMode(MapUnit::MapTwip)); // set first- and last-values for margins Size aPaperSize = mpDefPrinter->GetPaperSize(); diff --git a/cui/source/tabpages/tpcolor.cxx b/cui/source/tabpages/tpcolor.cxx index 1b4b88ea6da3..8b43dd6830bc 100644 --- a/cui/source/tabpages/tpcolor.cxx +++ b/cui/source/tabpages/tpcolor.cxx @@ -68,13 +68,13 @@ SvxColorTabPage::SvxColorTabPage(vcl::Window* pParent, const SfxItemSet& rInAttr { get(m_pSelectPalette, "paletteselector"); get(m_pValSetColorList, "colorset"); - Size aSize = LogicToPixel(Size(100 , 120), MapUnit::MapAppFont); + Size aSize = LogicToPixel(Size(100 , 120), MapMode(MapUnit::MapAppFont)); m_pValSetColorList->set_width_request(aSize.Width()); m_pValSetColorList->set_height_request(aSize.Height()); get(m_pValSetRecentList, "recentcolorset"); get(m_pCtlPreviewOld, "oldpreview"); get(m_pCtlPreviewNew, "newpreview"); - aSize = LogicToPixel(Size(34 , 25), MapUnit::MapAppFont); + aSize = LogicToPixel(Size(34 , 25), MapMode(MapUnit::MapAppFont)); m_pCtlPreviewOld->set_width_request(aSize.Width()); m_pCtlPreviewOld->set_height_request(aSize.Height()); m_pCtlPreviewNew->set_width_request(aSize.Width()); diff --git a/cui/source/tabpages/tpline.cxx b/cui/source/tabpages/tpline.cxx index cf23d73813dc..7c238dfeeba6 100644 --- a/cui/source/tabpages/tpline.cxx +++ b/cui/source/tabpages/tpline.cxx @@ -485,7 +485,7 @@ void SvxLineTabPage::SymbolSelected(MenuButton const * pButton) if(pGraphic) { Size aSize = SvxNumberFormat::GetGraphicSizeMM100(pGraphic); - aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, m_ePoolUnit); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(m_ePoolUnit)); m_aSymbolGraphic=*pGraphic; if( bResetSize ) { @@ -1158,7 +1158,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) m_aSymbolGraphic=Graphic(aMeta); m_aSymbolSize=pObj->GetSnapRect().GetSize(); m_aSymbolGraphic.SetPrefSize(pInvisibleSquare->GetSnapRect().GetSize()); - m_aSymbolGraphic.SetPrefMapMode(MapUnit::Map100thMM); + m_aSymbolGraphic.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); bPrevSym=true; bEnable=true; bIgnoreGraphic=true; @@ -1186,7 +1186,7 @@ void SvxLineTabPage::Reset( const SfxItemSet* rAttrs ) { m_aSymbolSize=OutputDevice::LogicToLogic( pGraphic->GetPrefSize(), pGraphic->GetPrefMapMode(), - MapUnit::Map100thMM ); + MapMode(MapUnit::Map100thMM)); } bPrevSym=true; } diff --git a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx index 6dcd3c1f75b4..7fffb394e49b 100644 --- a/dbaccess/source/ext/macromigration/macromigrationdialog.cxx +++ b/dbaccess/source/ext/macromigration/macromigrationdialog.cxx @@ -140,7 +140,7 @@ namespace dbmm declarePath( PATH_DEFAULT, {STATE_CLOSE_SUB_DOCS, STATE_BACKUP_DBDOC, STATE_MIGRATE, STATE_SUMMARY} ); - SetPageSizePixel( LogicToPixel( ::Size( TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT ), MapUnit::MapAppFont ) ); + SetPageSizePixel(LogicToPixel(::Size(TAB_PAGE_WIDTH, TAB_PAGE_HEIGHT), MapMode(MapUnit::MapAppFont))); SetRoadmapInteractive( true ); enableAutomaticNextButtonState(); defaultButton( WizardButtonFlags::NEXT ); diff --git a/dbaccess/source/ui/app/AppDetailPageHelper.cxx b/dbaccess/source/ui/app/AppDetailPageHelper.cxx index 0dc91616ec29..915321866cb8 100644 --- a/dbaccess/source/ui/app/AppDetailPageHelper.cxx +++ b/dbaccess/source/ui/app/AppDetailPageHelper.cxx @@ -926,7 +926,7 @@ void OAppDetailPageHelper::Resize() vcl::Window* pWindow = getCurrentView(); if ( pWindow ) { - Size aFLSize = LogicToPixel( Size( 2, 6 ), MapUnit::MapAppFont ); + Size aFLSize = LogicToPixel(Size(2, 6), MapMode(MapUnit::MapAppFont)); sal_Int32 n6PPT = aFLSize.Height(); long nHalfOutputWidth = static_cast<long>(nOutputWidth * 0.5); diff --git a/dbaccess/source/ui/app/AppDetailView.cxx b/dbaccess/source/ui/app/AppDetailView.cxx index c702d17cb6f3..294d631cc37d 100644 --- a/dbaccess/source/ui/app/AppDetailView.cxx +++ b/dbaccess/source/ui/app/AppDetailView.cxx @@ -442,7 +442,7 @@ void OTasksWindow::Resize() long nOutputWidth = aOutputSize.Width(); long nOutputHeight = aOutputSize.Height(); - Size aFLSize = LogicToPixel( Size( 2, 6 ), MapUnit::MapAppFont ); + Size aFLSize = LogicToPixel(Size(2, 6), MapMode(MapUnit::MapAppFont)); sal_Int32 n6PPT = aFLSize.Height(); long nHalfOutputWidth = static_cast<long>(nOutputWidth * 0.5); @@ -540,7 +540,7 @@ OApplicationDetailView::OApplicationDetailView(OAppBorderWindow& _rParent,Previe m_aContainer->Show(); - const long nFrameWidth = LogicToPixel( Size( 3, 0 ), MapUnit::MapAppFont ).Width(); + const long nFrameWidth = LogicToPixel(Size(3, 0), MapMode(MapUnit::MapAppFont)).Width(); m_aHorzSplitter->SetPosSizePixel( Point(0,50), Size(0,nFrameWidth) ); // now set the components at the base class set(m_aContainer.get(),m_aTasks.get()); diff --git a/dbaccess/source/ui/app/AppSwapWindow.cxx b/dbaccess/source/ui/app/AppSwapWindow.cxx index 81fc34116786..ae9391900db0 100644 --- a/dbaccess/source/ui/app/AppSwapWindow.cxx +++ b/dbaccess/source/ui/app/AppSwapWindow.cxx @@ -62,7 +62,7 @@ void OApplicationSwapWindow::dispose() void OApplicationSwapWindow::Resize() { - Size aFLSize = LogicToPixel( Size( 8, 0 ), MapUnit::MapAppFont ); + Size aFLSize = LogicToPixel(Size(8, 0), MapMode(MapUnit::MapAppFont)); long nX = 0; if ( m_aIconControl->GetEntryCount() != 0 ) nX = m_aIconControl->GetBoundingBox( m_aIconControl->GetEntry(0) ).GetWidth() + aFLSize.Width(); diff --git a/dbaccess/source/ui/app/AppTitleWindow.cxx b/dbaccess/source/ui/app/AppTitleWindow.cxx index 04755cc32d54..9f18829c2c67 100644 --- a/dbaccess/source/ui/app/AppTitleWindow.cxx +++ b/dbaccess/source/ui/app/AppTitleWindow.cxx @@ -81,7 +81,7 @@ void OTitleWindow::Resize() long nOutputWidth = aOutputSize.Width(); long nOutputHeight = aOutputSize.Height(); - Size aTextSize = LogicToPixel( Size( 6, 3 ), MapUnit::MapAppFont ); + Size aTextSize = LogicToPixel(Size(6, 3), MapMode(MapUnit::MapAppFont)); sal_Int32 nXOffset = aTextSize.Width(); sal_Int32 nYOffset = aTextSize.Height(); sal_Int32 nHeight = GetTextHeight() + 2*nYOffset; @@ -116,7 +116,7 @@ void OTitleWindow::GetFocus() long OTitleWindow::GetWidthPixel() const { - Size aTextSize = LogicToPixel( Size( 12, 0 ), MapUnit::MapAppFont ); + Size aTextSize = LogicToPixel(Size(12, 0), MapMode(MapUnit::MapAppFont)); sal_Int32 nWidth = GetTextWidth(m_aTitle->GetText()) + 2*aTextSize.Width(); return nWidth; diff --git a/dbaccess/source/ui/app/AppView.cxx b/dbaccess/source/ui/app/AppView.cxx index 18f765520d2c..30889fe85f83 100644 --- a/dbaccess/source/ui/app/AppView.cxx +++ b/dbaccess/source/ui/app/AppView.cxx @@ -112,7 +112,7 @@ void OAppBorderWindow::Resize() long nOutputHeight = aOutputSize.Height(); long nX = 0; - Size aFLSize = LogicToPixel( Size( 3, 8 ), MapUnit::MapAppFont ); + Size aFLSize = LogicToPixel(Size(3, 8), MapMode(MapUnit::MapAppFont)); if ( m_pPanel ) { OApplicationSwapWindow* pSwap = getPanel(); @@ -237,7 +237,7 @@ void OApplicationView::resizeDocumentView(tools::Rectangle& _rPlayground) { if ( m_pWin && !_rPlayground.IsEmpty() ) { - Size aFLSize = LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ); + Size aFLSize = LogicToPixel(Size(3, 3), MapMode(MapUnit::MapAppFont)); _rPlayground.Move( aFLSize.Width(),aFLSize.Height() ); Size aOldSize = _rPlayground.GetSize(); _rPlayground.SetSize( Size(aOldSize.Width() - 2*aFLSize.Width(), aOldSize.Height() - 2*aFLSize.Height()) ); diff --git a/dbaccess/source/ui/browser/brwview.cxx b/dbaccess/source/ui/browser/brwview.cxx index 8cdbf8e4d99e..4a98532f7c71 100644 --- a/dbaccess/source/ui/browser/brwview.cxx +++ b/dbaccess/source/ui/browser/brwview.cxx @@ -216,7 +216,7 @@ void UnoDataBrowserView::resizeDocumentView(tools::Rectangle& _rPlayground) if (m_pStatus && m_pStatus->IsVisible()) { Size aStatusSize(aPlaygroundPos.X(), GetTextHeight() + 2); - aStatusSize = LogicToPixel(aStatusSize, MapUnit::MapAppFont); + aStatusSize = LogicToPixel(aStatusSize, MapMode(MapUnit::MapAppFont)); aStatusSize.Width() = aTreeViewSize.Width() - 2 - 2; Point aStatusPos( aPlaygroundPos.X() + 2, aTreeViewPos.Y() + aTreeViewSize.Height() - aStatusSize.Height() ); diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx index 8013a7561d5e..60b233d851de 100644 --- a/dbaccess/source/ui/browser/unodatbr.cxx +++ b/dbaccess/source/ui/browser/unodatbr.cxx @@ -343,7 +343,7 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent) { // create controls and set sizes - const long nFrameWidth = getBrowserView()->LogicToPixel( ::Size( 3, 0 ), MapUnit::MapAppFont ).Width(); + const long nFrameWidth = getBrowserView()->LogicToPixel(::Size(3, 0), MapMode(MapUnit::MapAppFont)).Width(); m_pSplitter = VclPtr<Splitter>::Create(getBrowserView(),WB_HSCROLL); m_pSplitter->SetPosSizePixel( ::Point(0,0), ::Size(nFrameWidth,0) ); @@ -359,7 +359,7 @@ bool SbaTableQueryBrowser::Construct(vcl::Window* pParent) m_pTreeView->SetHelpId(HID_CTL_TREEVIEW); // a default pos for the splitter, so that the listbox is about 80 (logical) pixels wide - m_pSplitter->SetSplitPosPixel( getBrowserView()->LogicToPixel( ::Size( 80, 0 ), MapUnit::MapAppFont ).Width() ); + m_pSplitter->SetSplitPosPixel(getBrowserView()->LogicToPixel(::Size(80, 0), MapMode(MapUnit::MapAppFont)).Width()); getBrowserView()->setSplitter(m_pSplitter); getBrowserView()->setTreeView(m_pTreeView); diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx index 1a312ec1da34..15db79ca2fa2 100644 --- a/dbaccess/source/ui/control/FieldDescControl.cxx +++ b/dbaccess/source/ui/control/FieldDescControl.cxx @@ -290,7 +290,7 @@ void OFieldDescControl::CheckScrollBars() // Which one is the last one that fits? sal_uInt16 nLastVisible; const sal_Int32 nControlHeight = GetMaxControlHeight(); - const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MapUnit::MapAppFont).Height(); + const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y), MapMode(MapUnit::MapAppFont)).Height(); if (bNeedHScrollBar) nLastVisible = static_cast<sal_uInt16>((szOverallSize.Height() - nControl_Spacing_y - nHScrollHeight) / (nControl_Spacing_y + nControlHeight)); else @@ -369,7 +369,7 @@ void OFieldDescControl::ScrollAllAggregates() if (m_nOldVThumb != m_pVertScroll->GetThumbPos()) { const sal_Int32 nControlHeight = GetMaxControlHeight(); - const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MapUnit::MapAppFont).Height(); + const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y), MapMode(MapUnit::MapAppFont)).Height(); nDeltaY = (m_nOldVThumb - m_pVertScroll->GetThumbPos()) * (nControl_Spacing_y + nControlHeight); m_nOldVThumb = m_pVertScroll->GetThumbPos(); } @@ -996,7 +996,7 @@ void OFieldDescControl::SetPosSize( VclPtr<Control> const & rControl, long nRow, const sal_Int32 nControlHeight = GetMaxControlHeight(); Size aSize(0,nControlHeight); if ( isRightAligned() && nCol ) - aSize.Width() = LogicToPixel(Size(m_nWidth, 0),MapUnit::MapAppFont).Width(); + aSize.Width() = LogicToPixel(Size(m_nWidth, 0), MapMode(MapUnit::MapAppFont)).Width(); else { switch( nCol ) @@ -1043,7 +1043,7 @@ void OFieldDescControl::SetPosSize( VclPtr<Control> const & rControl, long nRow, rControl->SetSizePixel( aSize ); aSize = rControl->GetSizePixel( ); - const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y),MapUnit::MapAppFont).Height(); + const sal_Int32 nControl_Spacing_y = LogicToPixel(Size(0, CONTROL_SPACING_Y), MapMode(MapUnit::MapAppFont)).Height(); aPosition.Y() += ((nRow+1)*nControl_Spacing_y) + (nRow*nControlHeight); diff --git a/dbaccess/source/ui/control/RelationControl.cxx b/dbaccess/source/ui/control/RelationControl.cxx index 45e199234dc8..1129015ac905 100644 --- a/dbaccess/source/ui/control/RelationControl.cxx +++ b/dbaccess/source/ui/control/RelationControl.cxx @@ -434,7 +434,7 @@ namespace dbaui Size ORelationControl::GetOptimalSize() const { - return LogicToPixel(Size(140, 80), MapUnit::MapAppFont); + return LogicToPixel(Size(140, 80), MapMode(MapUnit::MapAppFont)); } // class OTableListBoxControl diff --git a/dbaccess/source/ui/control/VertSplitView.cxx b/dbaccess/source/ui/control/VertSplitView.cxx index 7938f1be137b..b12b1c9be94f 100644 --- a/dbaccess/source/ui/control/VertSplitView.cxx +++ b/dbaccess/source/ui/control/VertSplitView.cxx @@ -155,7 +155,7 @@ void OSplitterView::setSplitter(Splitter* _pSplitter) m_pSplitter = _pSplitter; if ( m_pSplitter ) { - m_pSplitter->SetSplitPosPixel( LogicToPixel( Size( SPLITTER_WIDTH, 0 ), MapUnit::MapAppFont ).Width() ); + m_pSplitter->SetSplitPosPixel(LogicToPixel(Size(SPLITTER_WIDTH, 0), MapMode(MapUnit::MapAppFont)).Width()); m_pSplitter->SetSplitHdl( LINK(this, OSplitterView, SplitHdl) ); m_pSplitter->Show(); LINK( this, OSplitterView, SplitHdl ).Call(m_pSplitter); diff --git a/dbaccess/source/ui/dlg/adminpages.cxx b/dbaccess/source/ui/dlg/adminpages.cxx index 944590902af1..92d62b0fcf1c 100644 --- a/dbaccess/source/ui/dlg/adminpages.cxx +++ b/dbaccess/source/ui/dlg/adminpages.cxx @@ -279,7 +279,7 @@ namespace dbaui aReference.Y() += _rReference.GetSizePixel().Height(); const vcl::Window* pConverter = _rControl.GetParent(); - Size aOffset = pConverter->LogicToPixel( Size( _nIndentAppFont, ( _eRelation == RelatedControls ? 3 : 6 ) ), MapUnit::MapAppFont ); + Size aOffset = pConverter->LogicToPixel(Size(_nIndentAppFont, (_eRelation == RelatedControls ? 3 : 6)), MapMode(MapUnit::MapAppFont)); Point aControlPos( aReference.X() + aOffset.Width(), aReference.Y() + aOffset.Height() ); _rControl.SetPosPixel( aControlPos ); diff --git a/dbaccess/source/ui/dlg/adtabdlg.cxx b/dbaccess/source/ui/dlg/adtabdlg.cxx index e7c0bde45c9e..b31304907f10 100644 --- a/dbaccess/source/ui/dlg/adtabdlg.cxx +++ b/dbaccess/source/ui/dlg/adtabdlg.cxx @@ -324,7 +324,7 @@ OAddTableDlg::OAddTableDlg( vcl::Window* pParent, IAddTableDialogContext& _rCont get(m_pTableList, "tablelist"); get(m_pQueryList, "querylist"); - Size aSize(LogicToPixel(Size(106 , 122), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(106 , 122), MapMode(MapUnit::MapAppFont))); m_pTableList->set_height_request(aSize.Height()); m_pTableList->set_width_request(aSize.Width()); get(m_pQueryList, "querylist"); diff --git a/dbaccess/source/ui/dlg/dbfindex.cxx b/dbaccess/source/ui/dlg/dbfindex.cxx index aeba83f7451a..91e80069e6d2 100644 --- a/dbaccess/source/ui/dlg/dbfindex.cxx +++ b/dbaccess/source/ui/dlg/dbfindex.cxx @@ -50,7 +50,7 @@ ODbaseIndexDialog::ODbaseIndexDialog(vcl::Window * pParent, const OUString& aDat get(m_pIndexes, "frame"); get(m_pLB_TableIndexes, "tableindex"); get(m_pLB_FreeIndexes, "freeindex"); - Size aSize(LogicToPixel(Size(76, 98), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(76, 98), MapMode(MapUnit::MapAppFont))); m_pLB_TableIndexes->set_height_request(aSize.Height()); m_pLB_TableIndexes->set_width_request(aSize.Width()); m_pLB_FreeIndexes->set_height_request(aSize.Height()); diff --git a/dbaccess/source/ui/dlg/dbwiz.cxx b/dbaccess/source/ui/dlg/dbwiz.cxx index 21c58e43b954..5f442463b0b2 100644 --- a/dbaccess/source/ui/dlg/dbwiz.cxx +++ b/dbaccess/source/ui/dlg/dbwiz.cxx @@ -80,7 +80,7 @@ ODbTypeWizDialog::ODbTypeWizDialog(vcl::Window* _pParent m_pImpl->translateProperties(xDatasource, *m_pOutSet); m_eType = dbaui::ODbDataSourceAdministrationHelper::getDatasourceType(*m_pOutSet); - SetPageSizePixel(LogicToPixel(::Size(PAGE_X, PAGE_Y), MapUnit::MapAppFont)); + SetPageSizePixel(LogicToPixel(::Size(PAGE_X, PAGE_Y), MapMode(MapUnit::MapAppFont))); defaultButton(WizardButtonFlags::NEXT); enableButtons(WizardButtonFlags::FINISH, false); enableAutomaticNextButtonState(); diff --git a/dbaccess/source/ui/dlg/dbwizsetup.cxx b/dbaccess/source/ui/dlg/dbwizsetup.cxx index e79fde0c1466..44fff07cca7f 100644 --- a/dbaccess/source/ui/dlg/dbwizsetup.cxx +++ b/dbaccess/source/ui/dlg/dbwizsetup.cxx @@ -147,7 +147,7 @@ ODbTypeWizDialogSetup::ODbTypeWizDialogSetup(vcl::Window* _pParent m_pImpl->translateProperties(xDatasource, *m_pOutSet); - SetPageSizePixel(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MapUnit::MapAppFont)); + SetPageSizePixel(LogicToPixel(::Size(WIZARD_PAGE_X, WIZARD_PAGE_Y), MapMode(MapUnit::MapAppFont))); defaultButton(WizardButtonFlags::NEXT); enableButtons(WizardButtonFlags::FINISH, true); enableAutomaticNextButtonState(); diff --git a/dbaccess/source/ui/dlg/indexdialog.cxx b/dbaccess/source/ui/dlg/indexdialog.cxx index b833d8b6ba32..571ea3f7ef54 100644 --- a/dbaccess/source/ui/dlg/indexdialog.cxx +++ b/dbaccess/source/ui/dlg/indexdialog.cxx @@ -190,7 +190,7 @@ namespace dbaui maLcResetCmdImg = get<FixedImage>("image5")->GetImage(); get(m_pIndexList, "INDEX_LIST"); - Size aSize(LogicToPixel(Size(70, 97), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(70, 97), MapMode(MapUnit::MapAppFont))); m_pIndexList->set_width_request(aSize.Width()); m_pIndexList->set_height_request(aSize.Height()); get(m_pIndexDetails, "INDEX_DETAILS"); @@ -199,7 +199,7 @@ namespace dbaui get(m_pUnique, "UNIQUE"); get(m_pFieldsLabel, "FIELDS_LABEL"); get(m_pFields, "FIELDS"); - aSize = LogicToPixel(Size(128, 61), MapUnit::MapAppFont); + aSize = LogicToPixel(Size(128, 61), MapMode(MapUnit::MapAppFont)); m_pFields->set_width_request(aSize.Width()); m_pFields->set_height_request(aSize.Height()); get(m_pClose, "close"); diff --git a/dbaccess/source/ui/dlg/sqlmessage.cxx b/dbaccess/source/ui/dlg/sqlmessage.cxx index 33adebe519d0..c33ae52b22d4 100644 --- a/dbaccess/source/ui/dlg/sqlmessage.cxx +++ b/dbaccess/source/ui/dlg/sqlmessage.cxx @@ -305,11 +305,11 @@ OExceptionChainDialog::OExceptionChainDialog(vcl::Window* pParent, const Excepti , m_aExceptions(_rExceptions) { get(m_pExceptionList, "list"); - Size aListSize(LogicToPixel(Size(85, 93), MapUnit::MapAppFont)); + Size aListSize(LogicToPixel(Size(85, 93), MapMode(MapUnit::MapAppFont))); m_pExceptionList->set_width_request(aListSize.Width()); m_pExceptionList->set_height_request(aListSize.Height()); get(m_pExceptionText, "description"); - Size aTextSize(LogicToPixel(Size(125 , 93), MapUnit::MapAppFont)); + Size aTextSize(LogicToPixel(Size(125, 93), MapMode(MapUnit::MapAppFont))); m_pExceptionText->set_width_request(aTextSize.Width()); m_pExceptionText->set_height_request(aTextSize.Height()); @@ -400,8 +400,8 @@ namespace { void lcl_positionInAppFont( const vcl::Window& _rParent, vcl::Window& _rChild, long _nX, long _nY, long Width, long Height ) { - Point aPos = _rParent.LogicToPixel( Point( _nX, _nY ), MapUnit::MapAppFont ); - Size aSize = _rParent.LogicToPixel( Size( Width, Height ), MapUnit::MapAppFont ); + Point aPos = _rParent.LogicToPixel(Point(_nX, _nY), MapMode(MapUnit::MapAppFont)); + Size aSize = _rParent.LogicToPixel(Size(Width, Height), MapMode(MapUnit::MapAppFont)); _rChild.SetPosSizePixel( aPos, aSize ); } @@ -514,8 +514,8 @@ void OSQLMessageBox::impl_positionControls() // adjust dialog size accordingly const tools::Rectangle& rBottomTextRect( bHaveSecondaryText ? aSecondaryRect : aPrimaryRect ); - Size aBorderSize = LogicToPixel( Size( OUTER_MARGIN, OUTER_MARGIN ), MapUnit::MapAppFont ); - Size aDialogSize( LogicToPixel( Size( DIALOG_WIDTH, 30 ), MapUnit::MapAppFont ) ); + Size aBorderSize = LogicToPixel(Size(OUTER_MARGIN, OUTER_MARGIN), MapMode(MapUnit::MapAppFont)); + Size aDialogSize( LogicToPixel(Size(DIALOG_WIDTH, 30), MapMode(MapUnit::MapAppFont))); aDialogSize.Height() = rBottomTextRect.Bottom() + aBorderSize.Height(); aDialogSize.Width() = aPrimaryRect.Right() + aBorderSize.Width(); diff --git a/dbaccess/source/ui/misc/WCopyTable.cxx b/dbaccess/source/ui/misc/WCopyTable.cxx index d02fe9a4db7a..355c19bbd40d 100644 --- a/dbaccess/source/ui/misc/WCopyTable.cxx +++ b/dbaccess/source/ui/misc/WCopyTable.cxx @@ -646,11 +646,11 @@ void OCopyTableWizard::construct() AddButton( m_pbNext = VclPtr<PushButton>::Create(this, WB_TABSTOP)); AddButton( m_pbFinish = VclPtr<PushButton>::Create(this, WB_TABSTOP)); - m_pbHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); - m_pbCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); - m_pbPrev->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); - m_pbNext->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); - m_pbFinish->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); + m_pbHelp->SetSizePixel( LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont)) ); + m_pbCancel->SetSizePixel( LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont)) ); + m_pbPrev->SetSizePixel( LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont)) ); + m_pbNext->SetSizePixel( LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont)) ); + m_pbFinish->SetSizePixel( LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont)) ); m_pbPrev->SetText(DBA_RES(STR_WIZ_PB_PREV)); m_pbNext->SetText(DBA_RES(STR_WIZ_PB_NEXT)); diff --git a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx index c558da3bd186..b22ceb332ad9 100644 --- a/dbaccess/source/ui/querydesign/querycontainerwindow.cxx +++ b/dbaccess/source/ui/querydesign/querycontainerwindow.cxx @@ -202,7 +202,7 @@ namespace dbaui Size aSize = GetOutputSizePixel(); Size aBeamer(aSize.Width(),sal_Int32(aSize.Height()*0.33)); - const long nFrameHeight = LogicToPixel( Size( 0, 3 ), MapUnit::MapAppFont ).Height(); + const long nFrameHeight = LogicToPixel(Size(0, 3), MapMode(MapUnit::MapAppFont)).Height(); Point aPos(0,aBeamer.Height()+nFrameHeight); m_pBeamer->SetPosSizePixel(Point(0,0),aBeamer); diff --git a/dbaccess/source/ui/querydesign/querydlg.cxx b/dbaccess/source/ui/querydesign/querydlg.cxx index 6a6ae3ead9b0..fc72b132033b 100644 --- a/dbaccess/source/ui/querydesign/querydlg.cxx +++ b/dbaccess/source/ui/querydesign/querydlg.cxx @@ -55,7 +55,7 @@ DlgQryJoin::DlgQryJoin( OQueryTableView * pParent, , m_xConnection(_xConnection) { get(m_pML_HelpText, "helptext"); - Size aSize(LogicToPixel(Size(179, 49), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(179, 49), MapMode(MapUnit::MapAppFont))); //alternatively loop through the STR_QUERY_* strings with their STR_JOIN_TYPE_HINT //suffix to find the longest entry at runtime m_pML_HelpText->set_height_request(aSize.Height()); diff --git a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx index 4cebe4d78a64..bcd2ff733812 100644 --- a/dbaccess/source/ui/tabledesign/TableDesignControl.cxx +++ b/dbaccess/source/ui/tabledesign/TableDesignControl.cxx @@ -45,7 +45,7 @@ OTableRowView::OTableRowView(vcl::Window* pParent) , m_nCurUndoActId(0) { SetHelpId(HID_TABDESIGN_BACKGROUND); - SetSizePixel(LogicToPixel(Size(40, 12), MapUnit::MapAppFont)); + SetSizePixel(LogicToPixel(Size(40, 12), MapMode(MapUnit::MapAppFont))); } void OTableRowView::Init() diff --git a/desktop/source/deployment/gui/dp_gui_dialog2.cxx b/desktop/source/deployment/gui/dp_gui_dialog2.cxx index 5cfe53b22b25..d4dbb3623480 100644 --- a/desktop/source/deployment/gui/dp_gui_dialog2.cxx +++ b/desktop/source/deployment/gui/dp_gui_dialog2.cxx @@ -1446,7 +1446,7 @@ ShowLicenseDialog::ShowLicenseDialog( vcl::Window * pParent, : ModalDialog(pParent, "ShowLicenseDialog", "desktop/ui/showlicensedialog.ui") { get(m_pLicenseText, "textview"); - Size aSize(m_pLicenseText->LogicToPixel(Size(290, 170), MapUnit::MapAppFont)); + Size aSize(m_pLicenseText->LogicToPixel(Size(290, 170), MapMode(MapUnit::MapAppFont))); m_pLicenseText->set_width_request(aSize.Width()); m_pLicenseText->set_height_request(aSize.Height()); m_pLicenseText->SetText(xPackage->getLicenseText()); diff --git a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx index 1a1a32a6bfcc..a5407c954ef3 100644 --- a/desktop/source/deployment/gui/dp_gui_extlistbox.cxx +++ b/desktop/source/deployment/gui/dp_gui_extlistbox.cxx @@ -752,7 +752,7 @@ void ExtensionBox_Impl::Resize() Size ExtensionBox_Impl::GetOptimalSize() const { - return LogicToPixel(Size(250, 150), MapUnit::MapAppFont); + return LogicToPixel(Size(250, 150), MapMode(MapUnit::MapAppFont)); } extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL makeExtensionBox(VclPtr<vcl::Window> & rRet, VclPtr<vcl::Window> & pParent, VclBuilder::stringmap &) diff --git a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx index 8fa20b8cd48e..229b8a262bae 100644 --- a/desktop/source/deployment/gui/dp_gui_updatedialog.cxx +++ b/desktop/source/deployment/gui/dp_gui_updatedialog.cxx @@ -497,7 +497,7 @@ UpdateDialog::UpdateDialog( get(m_pUpdate, "UPDATE_LABEL"); get(m_pContainer, "UPDATES_CONTAINER"); m_pUpdates = VclPtr<UpdateDialog::CheckListBox>::Create(m_pContainer, *this); - Size aSize(LogicToPixel(Size(240, 51), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(240, 51), MapMode(MapUnit::MapAppFont))); m_pUpdates->set_width_request(aSize.Width()); m_pUpdates->set_height_request(aSize.Height()); m_pUpdates->Show(); @@ -508,7 +508,7 @@ UpdateDialog::UpdateDialog( get(m_pReleaseNotesLabel, "RELEASE_NOTES_LABEL"); get(m_pReleaseNotesLink, "RELEASE_NOTES_LINK"); get(m_pDescriptions, "DESCRIPTIONS"); - aSize = LogicToPixel(Size(240, 59), MapUnit::MapAppFont); + aSize = LogicToPixel(Size(240, 59), MapMode(MapUnit::MapAppFont)); m_pDescriptions->set_width_request(aSize.Width()); m_pDescriptions->set_height_request(aSize.Height()); get(m_pOk, "INSTALL"); diff --git a/desktop/source/deployment/gui/license_dialog.cxx b/desktop/source/deployment/gui/license_dialog.cxx index 6219d3ede3b2..39c5d61d427e 100644 --- a/desktop/source/deployment/gui/license_dialog.cxx +++ b/desktop/source/deployment/gui/license_dialog.cxx @@ -202,7 +202,7 @@ LicenseDialogImpl::LicenseDialogImpl( m_pArrow2->Show(false); get(m_pLicense, "textview"); - Size aSize(m_pLicense->LogicToPixel(Size(290, 170), MapUnit::MapAppFont)); + Size aSize(m_pLicense->LogicToPixel(Size(290, 170), MapMode(MapUnit::MapAppFont))); m_pLicense->set_width_request(aSize.Width()); m_pLicense->set_height_request(aSize.Height()); diff --git a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx index 6dce6773202b..d4fd9c0c5e94 100644 --- a/drawinglayer/source/primitive2d/sceneprimitive2d.cxx +++ b/drawinglayer/source/primitive2d/sceneprimitive2d.cxx @@ -124,7 +124,7 @@ namespace aRetval = BitmapEx(aContent, aAlpha); // #i101811# set PrefMapMode and PrefSize at newly created Bitmap - aRetval.SetPrefMapMode(MapUnit::MapPixel); + aRetval.SetPrefMapMode(MapMode(MapUnit::MapPixel)); aRetval.SetPrefSize(Size(nWidth, nHeight)); } diff --git a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx index 6f6deef4bfb5..e9473c3e4d23 100644 --- a/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx +++ b/drawinglayer/source/processor2d/vclmetafileprocessor2d.cxx @@ -2014,8 +2014,8 @@ namespace drawinglayer // between Printer and VDev (mpOutputDevice and aBufferDevice here). // To get the DPI, LogicToPixel from (1,1) from MapUnit::MapInch needs to be used. basegfx::B2DHomMatrix aViewTransform(aBufferDevice->GetViewTransformation()); - const Size aDPIOld(mpOutputDevice->LogicToPixel(Size(1, 1), MapUnit::MapInch)); - const Size aDPINew(aBufferDevice->LogicToPixel(Size(1, 1), MapUnit::MapInch)); + const Size aDPIOld(mpOutputDevice->LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch))); + const Size aDPINew(aBufferDevice->LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch))); const double fDPIXChange((double)aDPIOld.getWidth() / (double)aDPINew.getWidth()); const double fDPIYChange((double)aDPIOld.getHeight() / (double)aDPINew.getHeight()); diff --git a/drawinglayer/source/tools/wmfemfhelper.cxx b/drawinglayer/source/tools/wmfemfhelper.cxx index ce9aab77b495..2b338eab94b3 100644 --- a/drawinglayer/source/tools/wmfemfhelper.cxx +++ b/drawinglayer/source/tools/wmfemfhelper.cxx @@ -2584,7 +2584,7 @@ namespace wmfemfhelper // convert to target MapUnit if not pixels aFontSize = OutputDevice::LogicToLogic( - aFontSize, MapUnit::MapPixel, rPropertyHolders.Current().getMapUnit()); + aFontSize, MapMode(MapUnit::MapPixel), MapMode(rPropertyHolders.Current().getMapUnit())); aCorrectedFont.SetFontSize(aFontSize); rPropertyHolders.Current().setFont(aCorrectedFont); diff --git a/editeng/source/editeng/eerdll.cxx b/editeng/source/editeng/eerdll.cxx index 005a0e4a218d..a7f74bf2701f 100644 --- a/editeng/source/editeng/eerdll.cxx +++ b/editeng/source/editeng/eerdll.cxx @@ -216,7 +216,7 @@ std::locale& EditDLL::GetResLocale() editeng::SharedVclResources::SharedVclResources() : m_pVirDev(VclPtr<VirtualDevice>::Create()) { - m_pVirDev->SetMapMode(MapUnit::MapTwip); + m_pVirDev->SetMapMode(MapMode(MapUnit::MapTwip)); } editeng::SharedVclResources::~SharedVclResources() diff --git a/editeng/source/editeng/impedit.cxx b/editeng/source/editeng/impedit.cxx index 8622bc4a7133..f613f419b74b 100644 --- a/editeng/source/editeng/impedit.cxx +++ b/editeng/source/editeng/impedit.cxx @@ -431,7 +431,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, tools::Rectangle& rStart = aRectangles.front(); tools::Rectangle aStart = tools::Rectangle(rStart.Left(), rStart.Top(), rStart.Left() + 1, rStart.Bottom()); if (bMm100ToTwip) - aStart = OutputDevice::LogicToLogic(aStart, MapUnit::Map100thMM, MapUnit::MapTwip); + aStart = OutputDevice::LogicToLogic(aStart, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); aStart.Move(aOrigin.getX(), aOrigin.getY()); mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_START, aStart.toString().getStr()); @@ -439,7 +439,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, tools::Rectangle& rEnd = aRectangles.back(); tools::Rectangle aEnd = tools::Rectangle(rEnd.Right() - 1, rEnd.Top(), rEnd.Right(), rEnd.Bottom()); if (bMm100ToTwip) - aEnd = OutputDevice::LogicToLogic(aEnd, MapUnit::Map100thMM, MapUnit::MapTwip); + aEnd = OutputDevice::LogicToLogic(aEnd, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); aEnd.Move(aOrigin.getX(), aOrigin.getY()); mpViewShell->libreOfficeKitViewCallback(LOK_CALLBACK_TEXT_SELECTION_END, aEnd.toString().getStr()); @@ -449,7 +449,7 @@ void ImpEditView::DrawSelectionXOR( EditSelection aTmpSel, vcl::Region* pRegion, for (tools::Rectangle & rRectangle : aRectangles) { if (bMm100ToTwip) - rRectangle = OutputDevice::LogicToLogic(rRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); + rRectangle = OutputDevice::LogicToLogic(rRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); rRectangle.Move(aOrigin.getX(), aOrigin.getY()); v.emplace_back(rRectangle.toString().getStr()); } @@ -496,7 +496,7 @@ void ImpEditView::ImplDrawHighlightRect( OutputDevice* _pTarget, const Point& rD { if ( rDocPosTopLeft.X() != rDocPosBottomRight.X() ) { - bool bPixelMode = _pTarget->GetMapMode() == MapUnit::MapPixel; + bool bPixelMode = _pTarget->GetMapMode().GetMapUnit() == MapUnit::MapPixel; Point aPnt1( GetWindowPos( rDocPosTopLeft ) ); Point aPnt2( GetWindowPos( rDocPosBottomRight ) ); @@ -1100,7 +1100,7 @@ void ImpEditView::ShowCursor( bool bGotoCursor, bool bForceVisCursor ) // LOK output is always in twips, convert from mm100 if necessary. if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aRect = OutputDevice::LogicToLogic(aRect, MapUnit::Map100thMM, MapUnit::MapTwip); + aRect = OutputDevice::LogicToLogic(aRect, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); else if (pOutWin->GetMapMode().GetMapUnit() == MapUnit::MapTwip) { // Writer comments: they use editeng, but are separate widgets. diff --git a/editeng/source/editeng/impedit2.cxx b/editeng/source/editeng/impedit2.cxx index 8ea502e278ac..2ba8c6cde892 100644 --- a/editeng/source/editeng/impedit2.cxx +++ b/editeng/source/editeng/impedit2.cxx @@ -228,7 +228,7 @@ void ImpEditEngine::SetRefMapMode( const MapMode& rMapMode ) mpOwnDev.disposeAndClear(); mpOwnDev = VclPtr<VirtualDevice>::Create(); pRefDev = mpOwnDev; - pRefDev->SetMapMode( MapUnit::MapTwip ); + pRefDev->SetMapMode(MapMode(MapUnit::MapTwip)); SetRefDevice( pRefDev ); pRefDev->SetMapMode( rMapMode ); diff --git a/editeng/source/items/paperinf.cxx b/editeng/source/items/paperinf.cxx index bde8319d93e7..9f2da29c14eb 100644 --- a/editeng/source/items/paperinf.cxx +++ b/editeng/source/items/paperinf.cxx @@ -37,7 +37,9 @@ Size SvxPaperInfo::GetPaperSize( Paper ePaper, MapUnit eUnit ) { PaperInfo aInfo(ePaper); Size aRet(aInfo.getWidth(), aInfo.getHeight()); // in 100thMM - return eUnit == MapUnit::Map100thMM ? aRet : OutputDevice::LogicToLogic(aRet, MapUnit::Map100thMM, eUnit); + return eUnit == MapUnit::Map100thMM + ? aRet + : OutputDevice::LogicToLogic(aRet, MapMode(MapUnit::Map100thMM), MapMode(eUnit)); } /*------------------------------------------------------------------------ @@ -85,7 +87,7 @@ Size SvxPaperInfo::GetPaperSize( const Printer* pPrinter ) Paper SvxPaperInfo::GetSvxPaper( const Size &rSize, MapUnit eUnit, bool bSloppy ) { - Size aSize(eUnit == MapUnit::Map100thMM ? rSize : OutputDevice::LogicToLogic(rSize, eUnit, MapUnit::Map100thMM)); + Size aSize(eUnit == MapUnit::Map100thMM ? rSize : OutputDevice::LogicToLogic(rSize, MapMode(eUnit), MapMode(MapUnit::Map100thMM))); PaperInfo aInfo(aSize.Width(), aSize.Height()); if (bSloppy) aInfo.doSloppyFit(); @@ -105,7 +107,9 @@ Size SvxPaperInfo::GetDefaultPaperSize( MapUnit eUnit ) { PaperInfo aInfo(PaperInfo::getSystemDefaultPaper()); Size aRet(aInfo.getWidth(), aInfo.getHeight()); - return eUnit == MapUnit::Map100thMM ? aRet : OutputDevice::LogicToLogic(aRet, MapUnit::Map100thMM, eUnit); + return eUnit == MapUnit::Map100thMM + ? aRet + : OutputDevice::LogicToLogic(aRet, MapMode(MapUnit::Map100thMM), MapMode(eUnit)); } /*------------------------------------------------------------------------ diff --git a/editeng/source/outliner/outliner.cxx b/editeng/source/outliner/outliner.cxx index ef9852b83102..e4455865396d 100644 --- a/editeng/source/outliner/outliner.cxx +++ b/editeng/source/outliner/outliner.cxx @@ -1438,7 +1438,9 @@ Size Outliner::ImplGetBulletSize( sal_Int32 nPara ) } else { - pPara->aBulSize = OutputDevice::LogicToLogic( pFmt->GetGraphicSize(), MapUnit::Map100thMM, pEditEngine->GetRefDevice()->GetMapMode() ); + pPara->aBulSize = OutputDevice::LogicToLogic(pFmt->GetGraphicSize(), + MapMode(MapUnit::Map100thMM), + pEditEngine->GetRefDevice()->GetMapMode()); } } diff --git a/editeng/source/uno/unoviwou.cxx b/editeng/source/uno/unoviwou.cxx index 96f445e7cb02..6cb02472b3c3 100644 --- a/editeng/source/uno/unoviwou.cxx +++ b/editeng/source/uno/unoviwou.cxx @@ -70,7 +70,7 @@ tools::Rectangle SvxDrawOutlinerViewForwarder::GetVisArea() const MapMode aMapMode(pOutDev->GetMapMode()); aVisArea = OutputDevice::LogicToLogic( aVisArea, pOutliner->GetRefMapMode(), - aMapMode.GetMapUnit() ); + MapMode(aMapMode.GetMapUnit())); aMapMode.SetOrigin(Point()); return pOutDev->LogicToPixel( aVisArea, aMapMode ); } @@ -93,7 +93,7 @@ Point SvxDrawOutlinerViewForwarder::LogicToPixel( const Point& rPoint, const Map MapMode aMapMode(pOutDev->GetMapMode()); Point aPoint2( OutputDevice::LogicToLogic( aPoint1, rMapMode, - aMapMode.GetMapUnit() ) ); + MapMode(aMapMode.GetMapUnit()))); aMapMode.SetOrigin(Point()); return pOutDev->LogicToPixel( aPoint2, aMapMode ); } @@ -111,7 +111,7 @@ Point SvxDrawOutlinerViewForwarder::PixelToLogic( const Point& rPoint, const Map aMapMode.SetOrigin(Point()); Point aPoint1( pOutDev->PixelToLogic( rPoint, aMapMode ) ); Point aPoint2( OutputDevice::LogicToLogic( aPoint1, - aMapMode.GetMapUnit(), + MapMode(aMapMode.GetMapUnit()), rMapMode ) ); Point aTextOffset( GetTextOffset() ); diff --git a/emfio/source/emfuno/xemfparser.cxx b/emfio/source/emfuno/xemfparser.cxx index 2f1db153b422..f2415bbf5a54 100644 --- a/emfio/source/emfuno/xemfparser.cxx +++ b/emfio/source/emfuno/xemfparser.cxx @@ -163,7 +163,7 @@ namespace emfio if (aMtf.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel) { - aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, MapUnit::Map100thMM); + aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, MapMode(MapUnit::Map100thMM)); } else { diff --git a/emfio/source/reader/mtftools.cxx b/emfio/source/reader/mtftools.cxx index d6df538dc27c..349f686f4ea9 100644 --- a/emfio/source/reader/mtftools.cxx +++ b/emfio/source/reader/mtftools.cxx @@ -919,7 +919,7 @@ namespace emfio MtfTools::~MtfTools() { mpGDIMetaFile->AddAction( new MetaPopAction() ); - mpGDIMetaFile->SetPrefMapMode( MapUnit::Map100thMM ); + mpGDIMetaFile->SetPrefMapMode(MapMode(MapUnit::Map100thMM)); if ( mrclFrame.IsEmpty() ) mpGDIMetaFile->SetPrefSize( Size( mnDevWidth, mnDevHeight ) ); else @@ -1607,7 +1607,7 @@ namespace emfio SolarMutexGuard aGuard; ScopedVclPtrInstance< VirtualDevice > pVDev; pDX = new long[ rText.getLength() ]; - pVDev->SetMapMode( MapUnit::Map100thMM ); + pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVDev->SetFont( maLatestFont ); pVDev->GetTextArray( rText, pDX, 0, rText.getLength()); } diff --git a/emfio/source/reader/wmfreader.cxx b/emfio/source/reader/wmfreader.cxx index 83e2fb3ad19c..cecd93a82ac0 100644 --- a/emfio/source/reader/wmfreader.cxx +++ b/emfio/source/reader/wmfreader.cxx @@ -1297,7 +1297,7 @@ namespace emfio { const Fraction aFrac( 1, mnUnitsPerInch); MapMode aWMFMap( MapUnit::MapInch, Point(), aFrac, aFrac ); - Size aSize100( OutputDevice::LogicToLogic( aWMFSize, aWMFMap, MapUnit::Map100thMM ) ); + Size aSize100(OutputDevice::LogicToLogic(aWMFSize, aWMFMap, MapMode(MapUnit::Map100thMM))); aDevExt = Size( labs( aSize100.Width() ), labs( aSize100.Height() ) ); } SetDevExt( aDevExt ); diff --git a/extensions/source/abpilot/abspilot.cxx b/extensions/source/abpilot/abspilot.cxx index ff41cbd1698a..270025e986c1 100644 --- a/extensions/source/abpilot/abspilot.cxx +++ b/extensions/source/abpilot/abspilot.cxx @@ -62,7 +62,7 @@ namespace abp ,m_aNewDataSource(_rxORB) ,m_eNewDataSourceType( AST_INVALID ) { - SetPageSizePixel(LogicToPixel(Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapUnit::MapAppFont)); + SetPageSizePixel(LogicToPixel(Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapMode(MapUnit::MapAppFont))); declarePath( PATH_COMPLETE, {STATE_SELECT_ABTYPE, diff --git a/extensions/source/dbpilots/controlwizard.cxx b/extensions/source/dbpilots/controlwizard.cxx index af24701eac77..5f14c6760b39 100644 --- a/extensions/source/dbpilots/controlwizard.cxx +++ b/extensions/source/dbpilots/controlwizard.cxx @@ -247,7 +247,7 @@ namespace dbp m_aContext.xObjectModel = _rxObjectModel; initContext(); - SetPageSizePixel(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapUnit::MapAppFont)); + SetPageSizePixel(LogicToPixel(::Size(WINDOW_SIZE_X, WINDOW_SIZE_Y), MapMode(MapUnit::MapAppFont))); defaultButton(WizardButtonFlags::NEXT); enableButtons(WizardButtonFlags::FINISH, false); } diff --git a/extensions/source/propctrlr/browserline.cxx b/extensions/source/propctrlr/browserline.cxx index e345381733e9..67b9d6801dda 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 ), MapUnit::MapAppFont ) ); + Size aIndent( m_pTheParent->LogicToPixel(Size(8, 0), MapMode(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 2d53642bf580..38f5a92c6be8 100644 --- a/extensions/source/propctrlr/browserlistbox.cxx +++ b/extensions/source/propctrlr/browserlistbox.cxx @@ -418,7 +418,7 @@ namespace pcr void OBrowserListBox::Resize() { tools::Rectangle aPlayground( Point( 0, 0 ), GetOutputSizePixel() ); - Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MapUnit::MapAppFont ) ); + Size aHelpWindowDistance( LogicToPixel(Size(0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT), MapMode(MapUnit::MapAppFont)) ); long nHelpWindowHeight = m_nCurrentPreferredHelpHeight = impl_getPrefererredHelpHeight(); bool bPositionHelpWindow = ( nHelpWindowHeight != 0 ); @@ -746,7 +746,7 @@ namespace pcr if ( HasHelpSection() ) { - Size aHelpWindowDistance( LogicToPixel( Size( 0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT ), MapUnit::MapAppFont ) ); + Size aHelpWindowDistance( LogicToPixel(Size(0, LAYOUT_HELP_WINDOW_DISTANCE_APPFONT), MapMode(MapUnit::MapAppFont)) ); nMinHeight += aHelpWindowDistance.Height(); nMinHeight += m_pHelpWindow->GetMinimalHeightPixel(); diff --git a/extensions/source/propctrlr/fontdialog.cxx b/extensions/source/propctrlr/fontdialog.cxx index 447583056343..c9b0f0137cb7 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), MapUnit::MapPoint, MapUnit::MapTwip).Height(); + nFontHeight = (float)OutputDevice::LogicToLogic(Size(0, (sal_Int32)nFontHeight), MapMode(MapUnit::MapPoint), MapMode(MapUnit::MapTwip)).Height(); SvxFontHeightItem aSvxFontHeightItem((sal_uInt32)nFontHeight,100,CFID_HEIGHT); FontWeight eWeight=vcl::unohelper::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()), MapUnit::MapTwip, MapUnit::MapPoint).Height(); + float nHeight = (float)OutputDevice::LogicToLogic(Size(0, rSvxFontHeightItem.GetHeight()), MapMode(MapUnit::MapTwip), MapMode(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 05accc9b1365..91ee10a9d886 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 ), MapUnit::MapAppFont ) ); - Size a3AppFontSize( LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ) ); + Size aSeparatorSize(LogicToPixel(Size(0, 8), MapMode(MapUnit::MapAppFont))); + Size a3AppFontSize(LogicToPixel(Size(3, 3), MapMode(MapUnit::MapAppFont))); return aSeparatorSize.Height() + a3AppFontSize.Height(); } @@ -125,12 +125,12 @@ namespace pcr void InspectorHelpWindow::Resize() { - Size a3AppFont( LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ) ); + Size a3AppFont(LogicToPixel(Size(3, 3), MapMode(MapUnit::MapAppFont))); tools::Rectangle aPlayground( Point( 0, 0 ), GetOutputSizePixel() ); tools::Rectangle aSeparatorArea( aPlayground ); - aSeparatorArea.Bottom() = aSeparatorArea.Top() + LogicToPixel( Size( 0, 8 ), MapUnit::MapAppFont ).Height(); + aSeparatorArea.Bottom() = aSeparatorArea.Top() + LogicToPixel(Size(0, 8), MapMode(MapUnit::MapAppFont)).Height(); m_aSeparator->SetPosSizePixel( aSeparatorArea.TopLeft(), aSeparatorArea.GetSize() ); tools::Rectangle aTextArea( aPlayground ); diff --git a/extensions/source/propctrlr/listselectiondlg.cxx b/extensions/source/propctrlr/listselectiondlg.cxx index d1ce396bac15..2bc3d154c9c9 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), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(85, 97), MapMode(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 47f90a77061e..b0cc583aca43 100644 --- a/extensions/source/scanner/grid.cxx +++ b/extensions/source/scanner/grid.cxx @@ -200,7 +200,7 @@ void GridWindow::onResize() Size GridWindow::GetOptimalSize() const { - return LogicToPixel(Size(240, 200), MapUnit::MapAppFont); + return LogicToPixel(Size(240, 200), MapMode(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 1d5baeda124f..e515a763af39 100644 --- a/extensions/source/scanner/sanedlg.cxx +++ b/extensions/source/scanner/sanedlg.cxx @@ -195,7 +195,7 @@ public: } virtual Size GetOptimalSize() const override { - Size aSize(LogicToPixel(Size(PREVIEW_WIDTH, PREVIEW_HEIGHT), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(PREVIEW_WIDTH, PREVIEW_HEIGHT), MapMode(MapUnit::MapAppFont))); aSize.setWidth(aSize.getWidth()+1); aSize.setHeight(aSize.getHeight()+1); return aSize; @@ -222,7 +222,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), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(130, 102), MapMode(MapUnit::MapAppFont))); mpOptionTitle->set_width_request(aSize.Width()); mpOptionTitle->set_height_request(aSize.Height() / 2); get(mpOptionDescTxt, "optionsDescLabel"); @@ -944,7 +944,7 @@ void ScanPreview::UpdatePreviewBounds() void ScanPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect) { Window::Paint(rRenderContext, rRect); - rRenderContext.SetMapMode(MapUnit::MapAppFont); + rRenderContext.SetMapMode(MapMode(MapUnit::MapAppFont)); rRenderContext.SetFillColor(Color(COL_WHITE)); rRenderContext.SetLineColor(Color(COL_WHITE)); rRenderContext.DrawRect(tools::Rectangle(Point(0, 0), @@ -1247,7 +1247,7 @@ void ScanPreview::DrawDrag(vcl::RenderContext& rRenderContext) mbDragDrawn = true; rRenderContext.SetRasterOp(eROP); - rRenderContext.SetMapMode(MapUnit::MapAppFont); + rRenderContext.SetMapMode(MapMode(MapUnit::MapAppFont)); } Point ScanPreview::GetPixelPos( const Point& rIn) const @@ -1260,12 +1260,12 @@ Point ScanPreview::GetPixelPos( const Point& rIn) const / ( maMaxBottomRight.Y() - maMinTopLeft.Y() ) ) ); - return LogicToPixel(aConvert, MapUnit::MapAppFont); + return LogicToPixel(aConvert, MapMode(MapUnit::MapAppFont)); } Point ScanPreview::GetLogicPos(const Point& rIn) const { - Point aConvert = PixelToLogic(rIn, MapUnit::MapAppFont); + Point aConvert = PixelToLogic(rIn, MapMode(MapUnit::MapAppFont)); if( aConvert.X() < 0 ) aConvert.X() = 0; if( aConvert.X() >= PREVIEW_WIDTH ) diff --git a/filter/source/graphicfilter/egif/egif.cxx b/filter/source/graphicfilter/egif/egif.cxx index 66778e06369d..d8e7eb3f4591 100644 --- a/filter/source/graphicfilter/egif/egif.cxx +++ b/filter/source/graphicfilter/egif/egif.cxx @@ -102,7 +102,7 @@ bool GIFWriter::WriteGIF(const Graphic& rGraphic, FilterConfigItem* pFilterConfi bool bLogSize = ( aMap.GetMapUnit() != MapUnit::MapPixel ); if( bLogSize ) - aSize100 = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), aMap, MapUnit::Map100thMM ); + aSize100 = OutputDevice::LogicToLogic(rGraphic.GetPrefSize(), aMap, MapMode(MapUnit::Map100thMM)); bStatus = true; nLastPercent = 0; diff --git a/filter/source/graphicfilter/eps/eps.cxx b/filter/source/graphicfilter/eps/eps.cxx index c407c9fcbde1..a155d8d5dd65 100644 --- a/filter/source/graphicfilter/eps/eps.cxx +++ b/filter/source/graphicfilter/eps/eps.cxx @@ -456,7 +456,7 @@ void PSWriter::ImplWriteProlog( const Graphic* pPreview ) ImplWriteLong( 0 ); ImplWriteLong( 0 ); Size aSizePoint = OutputDevice::LogicToLogic( pMTF->GetPrefSize(), - pMTF->GetPrefMapMode(), MapUnit::MapPoint ); + pMTF->GetPrefMapMode(), MapMode(MapUnit::MapPoint)); ImplWriteLong( aSizePoint.Width() ); ImplWriteLong( aSizePoint.Height() ,PS_RET ); ImplWriteLine( "%%Pages: 0" ); diff --git a/filter/source/graphicfilter/etiff/etiff.cxx b/filter/source/graphicfilter/etiff/etiff.cxx index 5a77fad0fc23..f02985fc1658 100644 --- a/filter/source/graphicfilter/etiff/etiff.cxx +++ b/filter/source/graphicfilter/etiff/etiff.cxx @@ -195,7 +195,7 @@ bool TIFFWriter::WriteTIFF( const Graphic& rGraphic, FilterConfigItem const * pF if ( aMapMode.GetMapUnit() != MapUnit::MapPixel ) { const Size aPrefSize( rGraphic.GetPrefSize() ); - aDestMapSize = OutputDevice::LogicToLogic( aPrefSize, aMapMode, MapUnit::MapInch ); + aDestMapSize = OutputDevice::LogicToLogic(aPrefSize, aMapMode, MapMode(MapUnit::MapInch)); } ImplWriteResolution( mnXResPos, aDestMapSize.Width() ); ImplWriteResolution( mnYResPos, aDestMapSize.Height() ); diff --git a/filter/source/graphicfilter/ieps/ieps.cxx b/filter/source/graphicfilter/ieps/ieps.cxx index 65414afe6a82..4d6001cd9538 100644 --- a/filter/source/graphicfilter/ieps/ieps.cxx +++ b/filter/source/graphicfilter/ieps/ieps.cxx @@ -135,17 +135,17 @@ static void MakeAsMeta(Graphic &rGraphic) if( !aSize.Width() || !aSize.Height() ) aSize = Application::GetDefaultDevice()->PixelToLogic( - aBmp.GetSizePixel(), MapUnit::Map100thMM ); + aBmp.GetSizePixel(), MapMode(MapUnit::Map100thMM)); else aSize = OutputDevice::LogicToLogic( aSize, - aBmp.GetPrefMapMode(), MapUnit::Map100thMM ); + aBmp.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)); pVDev->EnableOutput( false ); aMtf.Record( pVDev ); pVDev->DrawBitmap( Point(), aSize, rGraphic.GetBitmap() ); aMtf.Stop(); aMtf.WindStart(); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); aMtf.SetPrefSize( aSize ); rGraphic = aMtf; } @@ -554,7 +554,7 @@ void MakePreview(sal_uInt8* pBuf, sal_uInt32 nBytesRead, pVDev->Pop(); aMtf.Stop(); aMtf.WindStart(); - aMtf.SetPrefMapMode( MapUnit::MapPoint ); + aMtf.SetPrefMapMode(MapMode(MapUnit::MapPoint)); aMtf.SetPrefSize( Size( nWidth, nHeight ) ); rGraphic = aMtf; } @@ -731,13 +731,13 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) aMtf.Record( pVDev ); aSize = aBitmap.GetPrefSize(); if( !aSize.Width() || !aSize.Height() ) - aSize = Application::GetDefaultDevice()->PixelToLogic( aBitmap.GetSizePixel(), MapUnit::Map100thMM ); + aSize = Application::GetDefaultDevice()->PixelToLogic(aBitmap.GetSizePixel(), MapMode(MapUnit::Map100thMM)); else - aSize = OutputDevice::LogicToLogic( aSize, aBitmap.GetPrefMapMode(), MapUnit::Map100thMM ); + aSize = OutputDevice::LogicToLogic(aSize, aBitmap.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)); pVDev->DrawBitmap( Point(), aSize, aBitmap ); aMtf.Stop(); aMtf.WindStart(); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); aMtf.SetPrefSize( aSize ); aGraphic = aMtf; bHasPreview = bRetValue = true; @@ -790,7 +790,7 @@ ipsGraphicImport( SvStream & rStream, Graphic & rGraphic, FilterConfigItem* ) aGfxLink, aGraphic.GetGDIMetaFile() ) ) ); CreateMtfReplacementAction( aMtf, rStream, nOrigPos, nPSSize, nPosWMF, nSizeWMF, nPosTIFF, nSizeTIFF ); aMtf.WindStart(); - aMtf.SetPrefMapMode( MapUnit::MapPoint ); + aMtf.SetPrefMapMode(MapMode(MapUnit::MapPoint)); aMtf.SetPrefSize( Size( nWidth, nHeight ) ); rGraphic = aMtf; bRetValue = true; diff --git a/filter/source/graphicfilter/ipsd/ipsd.cxx b/filter/source/graphicfilter/ipsd/ipsd.cxx index 41eac7db2a37..21214a799657 100644 --- a/filter/source/graphicfilter/ipsd/ipsd.cxx +++ b/filter/source/graphicfilter/ipsd/ipsd.cxx @@ -147,7 +147,7 @@ bool PSDReader::ReadPSD(Graphic & rGraphic ) Fraction aFractX( 1, mnXResFixed >> 16 ); Fraction aFractY( 1, mnYResFixed >> 16 ); MapMode aMapMode( MapUnit::MapInch, aEmptyPoint, aFractX, aFractY ); - Size aPrefSize = OutputDevice::LogicToLogic( aBitmapSize, aMapMode, MapUnit::Map100thMM ); + Size aPrefSize = OutputDevice::LogicToLogic(aBitmapSize, aMapMode, MapMode(MapUnit::Map100thMM)); rGraphic.SetPrefSize( aPrefSize ); rGraphic.SetPrefMapMode( MapMode( MapUnit::Map100thMM ) ); } diff --git a/filter/source/msfilter/escherex.cxx b/filter/source/msfilter/escherex.cxx index e0feee627745..5075c342bbd5 100644 --- a/filter/source/msfilter/escherex.cxx +++ b/filter/source/msfilter/escherex.cxx @@ -1113,10 +1113,10 @@ void EscherPropertyContainer::CreateLineProperties( static Size lcl_SizeToEmu(Size aPrefSize, const MapMode& aPrefMapMode) { Size aRetSize; - if (aPrefMapMode == MapUnit::MapPixel) - aRetSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); + if (aPrefMapMode.GetMapUnit() == MapUnit::MapPixel) + aRetSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM)); else - aRetSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MapUnit::Map100thMM ); + aRetSize = OutputDevice::LogicToLogic(aPrefSize, aPrefMapMode, MapMode(MapUnit::Map100thMM)); return aRetSize; } diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx index e8d4657a8456..bd5e717ef2e3 100644 --- a/filter/source/msfilter/msdffimp.cxx +++ b/filter/source/msfilter/msdffimp.cxx @@ -192,11 +192,11 @@ void Impl_OlePres::Write( SvStream & rStm ) { Size aPrefS( pMtf->GetPrefSize() ); Size aS( aPrefS ); - aS = OutputDevice::LogicToLogic( aS, nMU, MapUnit::Map100thMM ); + aS = OutputDevice::LogicToLogic(aS, MapMode(nMU), MapMode(MapUnit::Map100thMM)); pMtf->Scale( Fraction( aS.Width(), aPrefS.Width() ), Fraction( aS.Height(), aPrefS.Height() ) ); - pMtf->SetPrefMapMode( MapUnit::Map100thMM ); + pMtf->SetPrefMapMode(MapMode(MapUnit::Map100thMM)); pMtf->SetPrefSize( aS ); } WriteWindowMetafileBits( rStm, *pMtf ); @@ -3695,7 +3695,7 @@ static Size lcl_GetPrefSize(const Graphic& rGraf, const MapMode& aWanted) if (aPrefMapMode == aWanted) return rGraf.GetPrefSize(); Size aRetSize; - if (aPrefMapMode == MapUnit::MapPixel) + if (aPrefMapMode.GetMapUnit() == MapUnit::MapPixel) { aRetSize = Application::GetDefaultDevice()->PixelToLogic( rGraf.GetPrefSize(), aWanted); @@ -3725,7 +3725,7 @@ static void lcl_ApplyCropping( const DffPropSet& rPropSet, SfxItemSet* pSet, Gra sal_uInt32 nTop( 0 ), nBottom( 0 ), nLeft( 0 ), nRight( 0 ); if ( pSet ) // use crop attributes ? - aCropSize = lcl_GetPrefSize( rGraf, MapUnit::Map100thMM ); + aCropSize = lcl_GetPrefSize(rGraf, MapMode(MapUnit::Map100thMM)); else { aCropBitmap = rGraf.GetBitmapEx(); @@ -4455,7 +4455,7 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r rOutliner.SetUpdateMode( false ); rOutliner.SetText( *pParaObj ); ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK); - pVirDev->SetMapMode( MapUnit::Map100thMM ); + pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); sal_Int32 i, nParagraphs = rOutliner.GetParagraphCount(); if ( nParagraphs ) { @@ -6507,7 +6507,7 @@ bool SvxMSDffManager::GetBLIPDirect( SvStream& rBLIPStream, Graphic& rData, tool aMtf.Scale( (double) aMtfSize100.Width() / aOldSize.Width(), (double) aMtfSize100.Height() / aOldSize.Height() ); aMtf.SetPrefSize( aMtfSize100 ); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); rData = aMtf; } } diff --git a/filter/source/pdf/pdfexport.cxx b/filter/source/pdf/pdfexport.cxx index ffa952ada11f..ca454bbd65f7 100644 --- a/filter/source/pdf/pdfexport.cxx +++ b/filter/source/pdf/pdfexport.cxx @@ -242,7 +242,7 @@ bool PDFExport::ExportSelection( vcl::PDFWriter& rPDFWriter, { bRet = true; // #i18334# nPageCount == 0, rPDFWriter.NewPage( 10000, 10000 ); // creating dummy page - rPDFWriter.SetMapMode( MapUnit::Map100thMM ); + rPDFWriter.SetMapMode(MapMode(MapUnit::Map100thMM)); } } } @@ -1005,7 +1005,7 @@ void PDFExport::showErrors( const std::set< vcl::PDFWriter::ErrorCode >& rErrors bool PDFExport::ImplExportPage( vcl::PDFWriter& rWriter, vcl::PDFExtOutDevData& rPDFExtOutDevData, const GDIMetaFile& rMtf ) { basegfx::B2DPolygon aSize(tools::Polygon(tools::Rectangle(Point(0, 0), rMtf.GetPrefSize())).getB2DPolygon()); - basegfx::B2DPolygon aSizePDF(OutputDevice::LogicToLogic(aSize, rMtf.GetPrefMapMode(), MapUnit::MapPoint)); + basegfx::B2DPolygon aSizePDF(OutputDevice::LogicToLogic(aSize, rMtf.GetPrefMapMode(), MapMode(MapUnit::MapPoint))); basegfx::B2DRange aRangePDF(aSizePDF.getB2DRange()); Point aOrigin; tools::Rectangle aPageRect( aOrigin, rMtf.GetPrefSize() ); diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx index a7409f4cfeef..a01a959bd43e 100644 --- a/filter/source/svg/svgexport.cxx +++ b/filter/source/svg/svgexport.cxx @@ -1946,7 +1946,7 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag aMtf.AddAction( new MetaBmpExScaleAction( aNullPt, aSize, aGraphic.GetBitmapEx() ) ); aMtf.SetPrefSize( aSize ); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); (*mpObjects)[ rxShape ] = ObjectRepresentation( rxShape, aMtf ); } @@ -2011,14 +2011,14 @@ bool SVGFilter::implCreateObjectsFromShape( const Reference< XDrawPage > & rxPag pAction->Duplicate(); aEmbeddedBitmapMtf.AddAction( pAction ); aEmbeddedBitmapMtf.SetPrefSize( aSize ); - aEmbeddedBitmapMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aEmbeddedBitmapMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); mEmbeddedBitmapActionSet.insert( ObjectRepresentation( rxShape, aEmbeddedBitmapMtf ) ); pAction->Duplicate(); aMtf.AddAction( pAction ); } } aMtf.SetPrefSize( aSize ); - aMtf.SetPrefMapMode( MapUnit::Map100thMM ); + aMtf.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); mEmbeddedBitmapActionMap[ rxShape ] = ObjectRepresentation( rxShape, aMtf ); } } @@ -2303,7 +2303,7 @@ IMPL_LINK( SVGFilter, CalcFieldHdl, EditFieldInfo*, pInfo, void ) void SVGExport::writeMtf( const GDIMetaFile& rMtf ) { - const Size aSize( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::MapMM ) ); + const Size aSize( OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MapUnit::MapMM)) ); rtl::OUString aAttr; Reference< XExtendedDocumentHandler> xExtDocHandler( GetDocHandler(), UNO_QUERY ); @@ -2342,8 +2342,8 @@ void SVGExport::writeMtf( const GDIMetaFile& rMtf ) aObjects.emplace_back( Reference< XInterface >(), rMtf ); SVGFontExport aSVGFontExport( *this, aObjects ); - Point aPoint100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefMapMode().GetOrigin(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) ); - Size aSize100thmm( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) ); + Point aPoint100thmm( OutputDevice::LogicToLogic(rMtf.GetPrefMapMode().GetOrigin(), rMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) ); + Size aSize100thmm( OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) ); SVGActionWriter aWriter( *this, aSVGFontExport ); aWriter.WriteMetaFile( aPoint100thmm, aSize100thmm, rMtf, diff --git a/filter/source/svg/svgfontexport.cxx b/filter/source/svg/svgfontexport.cxx index 27e092974a44..1f31e42e1c3c 100644 --- a/filter/source/svg/svgfontexport.cxx +++ b/filter/source/svg/svgfontexport.cxx @@ -190,7 +190,7 @@ void SVGFontExport::implEmbedFont( const vcl::Font& rFont ) aFont.SetFontSize( Size( 0, nFontEM ) ); aFont.SetAlignment( ALIGN_BASELINE ); - pVDev->SetMapMode( MapUnit::Map100thMM ); + pVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVDev->SetFont( aFont ); mrExport.AddAttribute( XML_NAMESPACE_NONE, "id", aCurIdStr += OUString::number( ++mnCurFontId ) ); diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx index 7d06983c4dbc..95b229723474 100644 --- a/filter/source/svg/svgwriter.cxx +++ b/filter/source/svg/svgwriter.cxx @@ -1731,7 +1731,7 @@ SVGActionWriter::SVGActionWriter( SVGExport& rExport, SVGFontExport& rFontExport { mpVDev = VclPtr<VirtualDevice>::Create(); mpVDev->EnableOutput( false ); - maTargetMapMode = MapUnit::Map100thMM; + maTargetMapMode = MapMode(MapUnit::Map100thMM); maTextWriter.setVirtualDevice( mpVDev, maTargetMapMode ); } @@ -3741,11 +3741,11 @@ void SVGActionWriter::WriteMetaFile( const Point& rPos100thmm, mpVDev->Push(); - Size aSize( OutputDevice::LogicToLogic( rSize100thmm, MapUnit::Map100thMM, aMapMode ) ); + Size aSize( OutputDevice::LogicToLogic(rSize100thmm, MapMode(MapUnit::Map100thMM), aMapMode) ); aMapMode.SetScaleX( aFractionX *= Fraction( aSize.Width(), aPrefSize.Width() ) ); aMapMode.SetScaleY( aFractionY *= Fraction( aSize.Height(), aPrefSize.Height() ) ); - Point aOffset( OutputDevice::LogicToLogic( rPos100thmm, MapUnit::Map100thMM, aMapMode ) ); + Point aOffset( OutputDevice::LogicToLogic(rPos100thmm, MapMode(MapUnit::Map100thMM), aMapMode ) ); aMapMode.SetOrigin( aOffset += aMapMode.GetOrigin() ); mpVDev->SetMapMode( aMapMode ); diff --git a/formula/source/ui/dlg/formula.cxx b/formula/source/ui/dlg/formula.cxx index 8aa87ebb516b..1a7505ac06f8 100644 --- a/formula/source/ui/dlg/formula.cxx +++ b/formula/source/ui/dlg/formula.cxx @@ -268,7 +268,7 @@ FormulaDlg_Impl::FormulaDlg_Impl(Dialog* pParent m_pFtFuncName->SetText(""); pParent->get(m_pMEFormula, "ed_formula"); - Size aSize(pParent->LogicToPixel(Size(203, 43), MapUnit::MapAppFont)); + Size aSize(pParent->LogicToPixel(Size(203, 43), MapMode(MapUnit::MapAppFont))); m_pMEFormula->set_height_request(aSize.Height()); m_pMEFormula->set_width_request(aSize.Width()); pParent->get(m_pBtnMatrix, "array"); diff --git a/formula/source/ui/dlg/funcpage.cxx b/formula/source/ui/dlg/funcpage.cxx index 94e9bcd6cb58..5cbcdf608b6a 100644 --- a/formula/source/ui/dlg/funcpage.cxx +++ b/formula/source/ui/dlg/funcpage.cxx @@ -65,7 +65,7 @@ FuncPage::FuncPage(vcl::Window* pParent,const IFunctionManager* _pFunctionManage get(m_pLbFunction, "function"); get(m_plbFunctionSearchString, "search"); m_pLbFunction->SetStyle(m_pLbFunction->GetStyle() | WB_SORT); - Size aSize(LogicToPixel(Size(86 , 162), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(86 , 162), MapMode(MapUnit::MapAppFont))); m_pLbFunction->set_height_request(aSize.Height()); m_pLbFunction->set_width_request(aSize.Width()); m_aHelpId = m_pLbFunction->GetHelpId(); diff --git a/formula/source/ui/dlg/structpg.cxx b/formula/source/ui/dlg/structpg.cxx index f340666a5c59..8f42601f5c53 100644 --- a/formula/source/ui/dlg/structpg.cxx +++ b/formula/source/ui/dlg/structpg.cxx @@ -85,7 +85,7 @@ StructPage::StructPage(vcl::Window* pParent): pSelectedToken ( nullptr ) { get(m_pTlbStruct, "struct"); - Size aSize(LogicToPixel(Size(86, 162), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(86, 162), MapMode(MapUnit::MapAppFont))); m_pTlbStruct->set_height_request(aSize.Height()); m_pTlbStruct->set_width_request(aSize.Width()); m_pTlbStruct->SetStyle(m_pTlbStruct->GetStyle()|WB_HASLINES|WB_CLIPCHILDREN| diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx index a56aebf3874f..72f4e494cb36 100644 --- a/fpicker/source/office/iodlg.cxx +++ b/fpicker/source/office/iodlg.cxx @@ -603,7 +603,7 @@ void SvtFileDialog::Init_Impl pImpl->_bMultiSelection = true; _pContainer.reset(VclPtr<CustomContainer>::Create(get<vcl::Window>("container"))); - Size aSize(LogicToPixel(Size(270, 85), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(270, 85), MapMode(MapUnit::MapAppFont))); _pContainer->set_height_request(aSize.Height()); _pContainer->set_width_request(aSize.Width()); _pContainer->set_hexpand(true); @@ -2534,7 +2534,7 @@ void SvtFileDialog::AddControls_Impl( ) pImpl->_pPlaces = VclPtr<PlacesListBox>::Create(_pContainer, this, FpsResId(STR_PLACES_TITLE), WB_BORDER); pImpl->_pPlaces->SetHelpId("SVT_HID_FILESAVE_PLACES_LISTBOX"); - Size aSize(LogicToPixel(Size(50, 85), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(50, 85), MapMode(MapUnit::MapAppFont))); pImpl->_pPlaces->set_height_request(aSize.Height()); pImpl->_pPlaces->set_width_request(aSize.Width()); pImpl->_pPlaces->SetSizePixel(aSize); diff --git a/fpicker/source/office/iodlgimp.cxx b/fpicker/source/office/iodlgimp.cxx index 0249ff50c537..b9699cc24bb0 100644 --- a/fpicker/source/office/iodlgimp.cxx +++ b/fpicker/source/office/iodlgimp.cxx @@ -170,7 +170,7 @@ void SvtUpButton_Impl::Click() Size SvtUpButton_Impl::GetOptimalSize() const { - return LogicToPixel(Size(12, 12), MapUnit::MapAppFont); + return LogicToPixel(Size(12, 12), MapMode(MapUnit::MapAppFont)); } // SvtExpFileDlg_Impl diff --git a/framework/source/uielement/comboboxtoolbarcontroller.cxx b/framework/source/uielement/comboboxtoolbarcontroller.cxx index 3222512cf262..be323fb2965e 100644 --- a/framework/source/uielement/comboboxtoolbarcontroller.cxx +++ b/framework/source/uielement/comboboxtoolbarcontroller.cxx @@ -132,7 +132,7 @@ ComboboxToolbarController::ComboboxToolbarController( // default dropdown size ::Size aLogicalSize( 8, 160 ); - ::Size aPixelSize = m_pComboBox->LogicToPixel( aLogicalSize, MapUnit::MapAppFont ); + ::Size aPixelSize = m_pComboBox->LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont)); m_pComboBox->SetSizePixel( ::Size( nWidth, aPixelSize.Height() )); m_pToolbar->SetItemWindow( m_nID, m_pComboBox ); diff --git a/framework/source/uielement/complextoolbarcontroller.cxx b/framework/source/uielement/complextoolbarcontroller.cxx index b90eda04a9a0..d14308ab0a07 100644 --- a/framework/source/uielement/complextoolbarcontroller.cxx +++ b/framework/source/uielement/complextoolbarcontroller.cxx @@ -265,7 +265,7 @@ sal_Int32 ComplexToolbarController::getFontSizePixel( const vcl::Window* pWindow // Calculate height of the application font used by window sal_Int32 nHeight = sal_Int32( rFont.GetFontHeight() ); - ::Size aPixelSize = pWindow->LogicToPixel( ::Size( 0, nHeight ), MapUnit::MapAppFont ); + ::Size aPixelSize = pWindow->LogicToPixel(::Size(0, nHeight), MapMode(MapUnit::MapAppFont)); return aPixelSize.Height(); } diff --git a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx index c6d1d16cc6dc..0b2f951bdf33 100644 --- a/framework/source/uielement/dropdownboxtoolbarcontroller.cxx +++ b/framework/source/uielement/dropdownboxtoolbarcontroller.cxx @@ -123,7 +123,7 @@ DropdownToolbarController::DropdownToolbarController( // default dropdown size ::Size aLogicalSize( 0, 160 ); - ::Size aPixelSize = m_pListBoxControl->LogicToPixel( aLogicalSize, MapUnit::MapAppFont ); + ::Size aPixelSize = m_pListBoxControl->LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont)); m_pListBoxControl->SetSizePixel( ::Size( nWidth, aPixelSize.Height() )); m_pToolbar->SetItemWindow( m_nID, m_pListBoxControl ); diff --git a/include/vcl/mapmod.hxx b/include/vcl/mapmod.hxx index 1b1b6c7167b2..a41dfbca5773 100644 --- a/include/vcl/mapmod.hxx +++ b/include/vcl/mapmod.hxx @@ -41,7 +41,7 @@ public: MapMode(); MapMode( const MapMode& rMapMode ); - MapMode( MapUnit eUnit ); + explicit MapMode( MapUnit eUnit ); MapMode( MapUnit eUnit, const Point& rLogicOrg, const Fraction& rScaleX, const Fraction& rScaleY ); ~MapMode(); diff --git a/oox/source/drawingml/shape.cxx b/oox/source/drawingml/shape.cxx index e575c94e1fc8..82498730ccde 100644 --- a/oox/source/drawingml/shape.cxx +++ b/oox/source/drawingml/shape.cxx @@ -1247,7 +1247,7 @@ Reference < XShape > Shape::renderDiagramToGraphic( XmlFilterBase const & rFilte // Size of the rendering awt::Size aActualSize = mxShape->getSize(); - Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MapUnit::MapCM ) ); + Size aResolution(Application::GetDefaultDevice()->LogicToPixel(Size(100, 100), MapMode(MapUnit::MapCM))); double fPixelsPer100thmm = static_cast < double > ( aResolution.Width() ) / 100000.0; awt::Size aSize = awt::Size( static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Width ) + 0.5 ), static_cast < sal_Int32 > ( ( fPixelsPer100thmm * aActualSize.Height ) + 0.5 ) ); diff --git a/reportdesign/source/ui/dlg/Condition.cxx b/reportdesign/source/ui/dlg/Condition.cxx index f941e92792ab..9545b26cbb16 100644 --- a/reportdesign/source/ui/dlg/Condition.cxx +++ b/reportdesign/source/ui/dlg/Condition.cxx @@ -405,7 +405,7 @@ void Condition::updateToolbar(const uno::Reference< report::XReportControlFormat { vcl::Font aBaseFont( Application::GetDefaultDevice()->GetSettings().GetStyleSettings().GetAppFont() ); SvxFont aFont( VCLUnoHelper::CreateFont( _xReportControlFormat->getFontDescriptor(), aBaseFont ) ); - aFont.SetFontHeight( OutputDevice::LogicToLogic( Size( 0, (sal_Int32)aFont.GetFontHeight() ), MapUnit::MapPoint, MapUnit::MapTwip ).Height()); + aFont.SetFontHeight(OutputDevice::LogicToLogic(Size(0, aFont.GetFontHeight()), MapMode(MapUnit::MapPoint), MapMode(MapUnit::MapTwip)).Height()); aFont.SetEmphasisMark( static_cast< FontEmphasisMark >( _xReportControlFormat->getControlTextEmphasis() ) ); aFont.SetRelief( static_cast< FontRelief >( _xReportControlFormat->getCharRelief() ) ); aFont.SetColor( _xReportControlFormat->getCharColor() ); diff --git a/reportdesign/source/ui/dlg/GroupsSorting.cxx b/reportdesign/source/ui/dlg/GroupsSorting.cxx index cc0639049611..624496ff6698 100644 --- a/reportdesign/source/ui/dlg/GroupsSorting.cxx +++ b/reportdesign/source/ui/dlg/GroupsSorting.cxx @@ -795,7 +795,7 @@ IMPL_LINK_NOARG( OFieldExpressionControl, DelayedDelete, void*, void ) Size OFieldExpressionControl::GetOptimalSize() const { - return LogicToPixel(Size(106, 75), MapUnit::MapAppFont); + return LogicToPixel(Size(106, 75), MapMode(MapUnit::MapAppFont)); } // class OGroupsSortingDialog diff --git a/reportdesign/source/ui/dlg/Navigator.cxx b/reportdesign/source/ui/dlg/Navigator.cxx index 4b52e80c4d31..4afc637bb944 100644 --- a/reportdesign/source/ui/dlg/Navigator.cxx +++ b/reportdesign/source/ui/dlg/Navigator.cxx @@ -878,7 +878,7 @@ void NavigatorTree::UserData::_disposing(const lang::EventObject& _rSource) Size NavigatorTree::GetOptimalSize() const { - return LogicToPixel(Size(100, 70), MapUnit::MapAppFont); + return LogicToPixel(Size(100, 70), MapMode(MapUnit::MapAppFont)); } // class ONavigatorImpl diff --git a/reportdesign/source/ui/misc/UITools.cxx b/reportdesign/source/ui/misc/UITools.cxx index 21f1f80a0188..03e51a265d38 100644 --- a/reportdesign/source/ui/misc/UITools.cxx +++ b/reportdesign/source/ui/misc/UITools.cxx @@ -239,7 +239,7 @@ namespace aFontItem.PutValue( uno::makeAny( aControlFont ), 0 ); _rItemSet.Put(aFontItem); - _rItemSet.Put(SvxFontHeightItem(OutputDevice::LogicToLogic(Size(0, (sal_Int32)aFont.GetFontHeight()), MapUnit::MapPoint, MapUnit::MapTwip).Height(),100,_nFontHeight)); + _rItemSet.Put(SvxFontHeightItem(OutputDevice::LogicToLogic(Size(0, aFont.GetFontHeight()), MapMode(MapUnit::MapPoint), MapMode(MapUnit::MapTwip)).Height(), 100, _nFontHeight)); lang::Locale aLocale; switch(_nWhich) { @@ -390,7 +390,7 @@ namespace if ( SfxItemState::SET == _rItemSet.GetItemState( _nFontHeight,true,&pItem) && dynamic_cast< const SvxFontHeightItem *>( pItem ) != nullptr) { const SvxFontHeightItem* pFontItem = static_cast<const SvxFontHeightItem*>(pItem); - aNewFont.SetFontHeight(OutputDevice::LogicToLogic(Size(0, pFontItem->GetHeight()), MapUnit::MapTwip, MapUnit::MapPoint).Height()); + aNewFont.SetFontHeight(OutputDevice::LogicToLogic(Size(0, pFontItem->GetHeight()), MapMode(MapUnit::MapTwip), MapMode(MapUnit::MapPoint)).Height()); } if ( SfxItemState::SET == _rItemSet.GetItemState( _nPosture,true,&pItem) && dynamic_cast< const SvxPostureItem *>( pItem ) != nullptr) { diff --git a/reportdesign/source/ui/report/ReportWindow.cxx b/reportdesign/source/ui/report/ReportWindow.cxx index 636a6fa6637a..97f88c0189d2 100644 --- a/reportdesign/source/ui/report/ReportWindow.cxx +++ b/reportdesign/source/ui/report/ReportWindow.cxx @@ -172,7 +172,7 @@ void OReportWindow::Resize() const Size aTotalOutputSize = GetOutputSizePixel(); Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH)*m_pView->getController().getZoomValue(),100); - const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, 0 ), MapUnit::MapAppFont ); + const Point aOffset = LogicToPixel(Point(SECTION_OFFSET, 0), MapMode(MapUnit::MapAppFont)); Point aStartPoint((long)aStartWidth + aOffset.X(),0); uno::Reference<report::XReportDefinition> xReportDefinition = getReportView()->getController().getReportDefinition(); const sal_Int32 nPaperWidth = getStyleProperty<awt::Size>(xReportDefinition,PROPERTY_PAPERSIZE).Width; diff --git a/reportdesign/source/ui/report/ScrollHelper.cxx b/reportdesign/source/ui/report/ScrollHelper.cxx index 238fe3be8b83..9d054ea15467 100644 --- a/reportdesign/source/ui/report/ScrollHelper.cxx +++ b/reportdesign/source/ui/report/ScrollHelper.cxx @@ -169,7 +169,7 @@ Size OScrollWindowHelper::ResizeScrollBars() else m_aCornerWin->Hide(); - const Point aOffset = LogicToPixel( Point( SECTION_OFFSET, SECTION_OFFSET ), MapUnit::MapAppFont ); + const Point aOffset = LogicToPixel(Point(SECTION_OFFSET, SECTION_OFFSET), MapMode(MapUnit::MapAppFont)); // resize scrollbars and set their ranges { Fraction aStartWidth(long(REPORT_STARTMARKER_WIDTH*m_pParent->getController().getZoomValue()),100); diff --git a/sc/source/core/data/documen2.cxx b/sc/source/core/data/documen2.cxx index 01d79d09dbef..fb8e2557586f 100644 --- a/sc/source/core/data/documen2.cxx +++ b/sc/source/core/data/documen2.cxx @@ -518,7 +518,7 @@ ScFieldEditEngine& ScDocument::GetEditEngine() mpEditEngine = new ScFieldEditEngine(this, GetEnginePool(), GetEditPool()); mpEditEngine->SetUpdateMode( false ); mpEditEngine->EnableUndo( false ); - mpEditEngine->SetRefMapMode( MapUnit::Map100thMM ); + mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); ApplyAsianEditSettings( *mpEditEngine ); } return *mpEditEngine; @@ -531,7 +531,7 @@ ScNoteEditEngine& ScDocument::GetNoteEngine() mpNoteEngine = new ScNoteEditEngine( GetEnginePool(), GetEditPool() ); mpNoteEngine->SetUpdateMode( false ); mpNoteEngine->EnableUndo( false ); - mpNoteEngine->SetRefMapMode( MapUnit::Map100thMM ); + mpNoteEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); ApplyAsianEditSettings( *mpNoteEngine ); const SfxItemSet& rItemSet = GetDefPattern()->GetItemSet(); SfxItemSet* pEEItemSet = new SfxItemSet( mpNoteEngine->GetEmptyItemSet() ); diff --git a/sc/source/core/data/documen8.cxx b/sc/source/core/data/documen8.cxx index c81cb3865c0b..c0ee2e8f1b1b 100644 --- a/sc/source/core/data/documen8.cxx +++ b/sc/source/core/data/documen8.cxx @@ -136,7 +136,7 @@ SfxPrinter* ScDocument::GetPrinter(bool bCreateIfNotExist) pSet->Put( SfxBoolItem( SID_PRINTER_NOTFOUND_WARN, aMisc.IsNotFoundWarning() ) ); mpPrinter = VclPtr<SfxPrinter>::Create( std::move(pSet) ); - mpPrinter->SetMapMode( MapUnit::Map100thMM ); + mpPrinter->SetMapMode(MapMode(MapUnit::Map100thMM)); UpdateDrawPrinter(); mpPrinter->SetDigitLanguage( SC_MOD()->GetOptDigitLanguage() ); } @@ -590,9 +590,9 @@ bool ScDocument::IdleCalcTextWidth() // true = try next again { pDev = GetPrinter(); aScope.setOldMapMode(pDev->GetMapMode()); - pDev->SetMapMode( MapUnit::MapPixel ); // Important for GetNeededSize + pDev->SetMapMode(MapMode(MapUnit::MapPixel)); // Important for GetNeededSize - Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); + Point aPix1000 = pDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); nPPTX = aPix1000.X() / 1000.0; nPPTY = aPix1000.Y() / 1000.0; } diff --git a/sc/source/core/data/documen9.cxx b/sc/source/core/data/documen9.cxx index b38bbd1aa26b..0393c01f0cd2 100644 --- a/sc/source/core/data/documen9.cxx +++ b/sc/source/core/data/documen9.cxx @@ -491,7 +491,7 @@ bool ScDocument::IsPrintEmpty( SCTAB nTab, SCCOL nStartCol, SCROW nStartRow, pThis->ExtendMerge( 0,nStartRow, nExtendCol,nTmpRow, nTab ); // no Refresh, incl. Attrs OutputDevice* pDev = pThis->GetPrinter(); - pDev->SetMapMode( MapUnit::MapPixel ); // Important for GetNeededSize + pDev->SetMapMode(MapMode(MapUnit::MapPixel)); // Important for GetNeededSize ExtendPrintArea( pDev, nTab, 0, nStartRow, nExtendCol, nEndRow ); if ( nExtendCol >= nStartCol ) return false; diff --git a/sc/source/core/data/global.cxx b/sc/source/core/data/global.cxx index c3629c9c7ef4..181eb2537e94 100644 --- a/sc/source/core/data/global.cxx +++ b/sc/source/core/data/global.cxx @@ -519,12 +519,12 @@ void ScGlobal::InitTextHeight(const SfxItemPool* pPool) OutputDevice* pDefaultDev = Application::GetDefaultDevice(); ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *pDefaultDev ); - pVirtWindow->SetMapMode(MapUnit::MapPixel); + pVirtWindow->SetMapMode(MapMode(MapUnit::MapPixel)); vcl::Font aDefFont; pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // Font color doesn't matter here pVirtWindow->SetFont(aDefFont); sal_uInt16 nTest = static_cast<sal_uInt16>( - pVirtWindow->PixelToLogic(Size(0, pVirtWindow->GetTextHeight()), MapUnit::MapTwip).Height()); + pVirtWindow->PixelToLogic(Size(0, pVirtWindow->GetTextHeight()), MapMode(MapUnit::MapTwip)).Height()); if (nTest > nDefFontHeight) nDefFontHeight = nTest; diff --git a/sc/source/core/data/table1.cxx b/sc/source/core/data/table1.cxx index 18cfc7986307..8c9f30729de0 100644 --- a/sc/source/core/data/table1.cxx +++ b/sc/source/core/data/table1.cxx @@ -1800,7 +1800,7 @@ void ScTable::ExtendPrintArea( OutputDevice* pDev, return; } - Point aPix1000 = pDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); + Point aPix1000 = pDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); double nPPTX = aPix1000.X() / 1000.0; double nPPTY = aPix1000.Y() / 1000.0; diff --git a/sc/source/core/tool/editutil.cxx b/sc/source/core/tool/editutil.cxx index 642532bedd85..14e906eae5a9 100644 --- a/sc/source/core/tool/editutil.cxx +++ b/sc/source/core/tool/editutil.cxx @@ -330,7 +330,7 @@ tools::Rectangle ScEditUtil::GetEditArea( const ScPatternAttr* pPattern, bool bF else { MapMode aMode = pDev->GetMapMode(); - pDev->SetMapMode( MapUnit::MapPixel ); + pDev->SetMapMode(MapMode(MapUnit::MapPixel)); long nTextHeight = pDoc->GetNeededSize( nCol, nRow, nTab, pDev, nPPTX, nPPTY, aZoomX, aZoomY, false ); @@ -709,7 +709,7 @@ ScTabEditEngine::ScTabEditEngine( const ScPatternAttr& rPattern, void ScTabEditEngine::Init( const ScPatternAttr& rPattern ) { - SetRefMapMode(MapUnit::Map100thMM); + SetRefMapMode(MapMode(MapUnit::Map100thMM)); SfxItemSet* pEditDefaults = new SfxItemSet( GetEmptyItemSet() ); rPattern.FillEditItemSet( pEditDefaults ); SetDefaults( pEditDefaults ); diff --git a/sc/source/core/tool/interpr1.cxx b/sc/source/core/tool/interpr1.cxx index d1a42227c632..81fa5634b8c1 100644 --- a/sc/source/core/tool/interpr1.cxx +++ b/sc/source/core/tool/interpr1.cxx @@ -2281,7 +2281,7 @@ void ScInterpreter::ScCell() vcl::Font aOldFont( pPrinter->GetFont() ); vcl::Font aDefFont; - pPrinter->SetMapMode( MapUnit::MapTwip ); + pPrinter->SetMapMode(MapMode(MapUnit::MapTwip)); // font color doesn't matter here pDok->GetDefPattern()->GetFont( aDefFont, SC_AUTOCOL_BLACK, pPrinter ); pPrinter->SetFont( aDefFont ); diff --git a/sc/source/filter/excel/xlroot.cxx b/sc/source/filter/excel/xlroot.cxx index c37a77c19ac1..0d5b504dad2b 100644 --- a/sc/source/filter/excel/xlroot.cxx +++ b/sc/source/filter/excel/xlroot.cxx @@ -358,7 +358,7 @@ ScEditEngineDefaulter& XclRoot::GetEditEngine() const { mrData.mxEditEngine.reset( new ScEditEngineDefaulter( GetDoc().GetEnginePool() ) ); ScEditEngineDefaulter& rEE = *mrData.mxEditEngine; - rEE.SetRefMapMode( MapUnit::Map100thMM ); + rEE.SetRefMapMode(MapMode(MapUnit::Map100thMM)); rEE.SetEditTextObjectPool( GetDoc().GetEditPool() ); rEE.SetUpdateMode( false ); rEE.EnableUndo( false ); @@ -373,7 +373,7 @@ ScHeaderEditEngine& XclRoot::GetHFEditEngine() const { mrData.mxHFEditEngine.reset( new ScHeaderEditEngine( EditEngine::CreatePool() ) ); ScHeaderEditEngine& rEE = *mrData.mxHFEditEngine; - rEE.SetRefMapMode( MapUnit::MapTwip ); // headers/footers use twips as default metric + rEE.SetRefMapMode(MapMode(MapUnit::MapTwip)); // headers/footers use twips as default metric rEE.SetUpdateMode( false ); rEE.EnableUndo( false ); rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); @@ -400,7 +400,7 @@ EditEngine& XclRoot::GetDrawEditEngine() const { mrData.mxDrawEditEng.reset( new EditEngine( &GetDoc().GetDrawLayer()->GetItemPool() ) ); EditEngine& rEE = *mrData.mxDrawEditEng; - rEE.SetRefMapMode( MapUnit::Map100thMM ); + rEE.SetRefMapMode(MapMode(MapUnit::Map100thMM)); rEE.SetUpdateMode( false ); rEE.EnableUndo( false ); rEE.SetControlWord( rEE.GetControlWord() & ~EEControlBits::ALLOWBIGOBJS ); diff --git a/sc/source/filter/oox/workbookhelper.cxx b/sc/source/filter/oox/workbookhelper.cxx index f9e8a65b33df..b3480d51f6bf 100644 --- a/sc/source/filter/oox/workbookhelper.cxx +++ b/sc/source/filter/oox/workbookhelper.cxx @@ -572,7 +572,7 @@ void WorkbookGlobals::initialize() // initialise edit engine ScDocument& rDoc = getScDocument(); mxEditEngine.reset( new ScEditEngineDefaulter( rDoc.GetEnginePool() ) ); - mxEditEngine->SetRefMapMode( MapUnit::Map100thMM ); + mxEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); mxEditEngine->SetEditTextObjectPool( rDoc.GetEditPool() ); mxEditEngine->SetUpdateMode( false ); mxEditEngine->EnableUndo( false ); diff --git a/sc/source/filter/xml/xmlimprt.cxx b/sc/source/filter/xml/xmlimprt.cxx index e6db5b6f6deb..1bf8d576fe38 100644 --- a/sc/source/filter/xml/xmlimprt.cxx +++ b/sc/source/filter/xml/xmlimprt.cxx @@ -2024,7 +2024,7 @@ ScEditEngineDefaulter* ScXMLImport::GetEditEngine() if (!mpEditEngine) { mpEditEngine.reset(new ScEditEngineDefaulter(pDoc->GetEnginePool())); - mpEditEngine->SetRefMapMode(MapUnit::Map100thMM); + mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); mpEditEngine->SetEditTextObjectPool(pDoc->GetEditPool()); mpEditEngine->SetUpdateMode(false); mpEditEngine->EnableUndo(false); diff --git a/sc/source/ui/Accessibility/AccessibleText.cxx b/sc/source/ui/Accessibility/AccessibleText.cxx index 8583b3a258f2..630202c89724 100644 --- a/sc/source/ui/Accessibility/AccessibleText.cxx +++ b/sc/source/ui/Accessibility/AccessibleText.cxx @@ -299,7 +299,7 @@ Point ScPreviewViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& aMapMode.SetOrigin(Point()); Point aPoint1( pWindow->PixelToLogic( rPoint ) ); Point aPoint2( OutputDevice::LogicToLogic( aPoint1, - aMapMode.GetMapUnit(), + MapMode(aMapMode.GetMapUnit()), rMapMode ) ); return aPoint2; } @@ -1054,7 +1054,7 @@ SvxTextForwarder* ScAccessibleEditLineTextData::GetTextForwarder() mpEditEngine = new ScFieldEditEngine(nullptr, pEnginePool, nullptr, true); mbEditEngineCreated = true; mpEditEngine->EnableUndo( false ); - mpEditEngine->SetRefMapMode( MapUnit::Map100thMM ); + mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); mpForwarder = new SvxEditEngineForwarder(*mpEditEngine); mpEditEngine->SetText(pTxtWnd->GetTextString()); @@ -1264,7 +1264,7 @@ SvxTextForwarder* ScAccessiblePreviewHeaderCellTextData::GetTextForwarder() if (pDocShell) pEditEngine->SetRefDevice(pDocShell->GetRefDevice()); else - pEditEngine->SetRefMapMode( MapUnit::Map100thMM ); + pEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); pForwarder = new SvxEditEngineForwarder(*pEditEngine); } @@ -1367,7 +1367,7 @@ SvxTextForwarder* ScAccessibleHeaderTextData::GetTextForwarder() ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool ); pHdrEngine->EnableUndo( false ); - pHdrEngine->SetRefMapMode( MapUnit::MapTwip ); + pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip)); // default font must be set, independently of document // -> use global pool from module @@ -1490,7 +1490,7 @@ SvxTextForwarder* ScAccessibleNoteTextData::GetTextForwarder() if (mpDocSh) mpEditEngine->SetRefDevice(mpDocSh->GetRefDevice()); else - mpEditEngine->SetRefMapMode( MapUnit::Map100thMM ); + mpEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); mpForwarder = new SvxEditEngineForwarder(*mpEditEngine); } diff --git a/sc/source/ui/app/client.cxx b/sc/source/ui/app/client.cxx index 8c93bfbd4ce3..a3a8e12f874b 100644 --- a/sc/source/ui/app/client.cxx +++ b/sc/source/ui/app/client.cxx @@ -205,7 +205,7 @@ void ScClient::ViewChanged() } MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( GetAspect() ) ); - Size aVisSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aMapUnit, MapUnit::Map100thMM ); + Size aVisSize = OutputDevice::LogicToLogic(Size(aSz.Width, aSz.Height), MapMode(aMapUnit), MapMode(MapUnit::Map100thMM)); // Take over position and size into document SdrOle2Obj* pDrawObj = GetDrawObj(); diff --git a/sc/source/ui/app/inputwin.cxx b/sc/source/ui/app/inputwin.cxx index ddec7b9da9ce..bd5293e9b1c3 100644 --- a/sc/source/ui/app/inputwin.cxx +++ b/sc/source/ui/app/inputwin.cxx @@ -1276,7 +1276,7 @@ ScTextWnd::ScTextWnd(ScInputBarGroup* pParent, ScTabViewShell* pViewSh) // always use application font, so a font with cjk chars can be installed vcl::Font aAppFont = GetFont(); aTextFont = aAppFont; - aTextFont.SetFontSize(PixelToLogic(aAppFont.GetFontSize(), MapUnit::MapTwip)); // AppFont is in pixels + aTextFont.SetFontSize(PixelToLogic(aAppFont.GetFontSize(), MapMode(MapUnit::MapTwip))); // AppFont is in pixels const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); @@ -1296,7 +1296,7 @@ ScTextWnd::ScTextWnd(ScInputBarGroup* pParent, ScTabViewShell* pViewSh) SetSizePixel(aSize); SetBackground(aBgColor); SetLineColor(COL_BLACK); - SetMapMode(MapUnit::MapTwip); + SetMapMode(MapMode(MapUnit::MapTwip)); SetPointer(PointerStyle::Text); SetFont(aTextFont); diff --git a/sc/source/ui/app/transobj.cxx b/sc/source/ui/app/transobj.cxx index 23a5348720f6..7ca53f64280f 100644 --- a/sc/source/ui/app/transobj.cxx +++ b/sc/source/ui/app/transobj.cxx @@ -355,7 +355,7 @@ bool ScTransferObj::GetData( const datatransfer::DataFlavor& rFlavor, const OUSt aBlock.aEnd.Col(), aBlock.aEnd.Row(), aBlock.aStart.Tab() ); ScopedVclPtrInstance< VirtualDevice > pVirtDev; - pVirtDev->SetOutputSizePixel( pVirtDev->LogicToPixel( aMMRect.GetSize(), MapUnit::Map100thMM ) ); + pVirtDev->SetOutputSizePixel(pVirtDev->LogicToPixel(aMMRect.GetSize(), MapMode(MapUnit::Map100thMM))); PaintToDev( pVirtDev, pDoc, 1.0, aBlock ); diff --git a/sc/source/ui/cctrl/cbuttonw.cxx b/sc/source/ui/cctrl/cbuttonw.cxx index 3838af1c46cc..d354b933d9bc 100644 --- a/sc/source/ui/cctrl/cbuttonw.cxx +++ b/sc/source/ui/cctrl/cbuttonw.cxx @@ -43,7 +43,7 @@ void ScDDComboBoxButton::SetOutputDevice( OutputDevice* pOutputDevice ) void ScDDComboBoxButton::SetOptSizePixel() { - aBtnSize = pOut->LogicToPixel(Size(8, 11), MapUnit::MapAppFont); + aBtnSize = pOut->LogicToPixel(Size(8, 11), MapMode(MapUnit::MapAppFont)); aBtnSize.Width() = std::max(aBtnSize.Width(), pOut->GetSettings().GetStyleSettings().GetScrollBarSize()); } diff --git a/sc/source/ui/condformat/condformatdlg.cxx b/sc/source/ui/condformat/condformatdlg.cxx index 07e3c4d16857..a052c30687f9 100644 --- a/sc/source/ui/condformat/condformatdlg.cxx +++ b/sc/source/ui/condformat/condformatdlg.cxx @@ -156,7 +156,7 @@ VCL_BUILDER_FACTORY_CONSTRUCTOR(ScCondFormatList, 0) Size ScCondFormatList::GetOptimalSize() const { - return LogicToPixel(Size(300, 185), MapUnit::MapAppFont); + return LogicToPixel(Size(300, 185), MapMode(MapUnit::MapAppFont)); } void ScCondFormatList::Resize() diff --git a/sc/source/ui/condformat/condformatmgr.cxx b/sc/source/ui/condformat/condformatmgr.cxx index 0ad57c761838..76236fede3ac 100644 --- a/sc/source/ui/condformat/condformatmgr.cxx +++ b/sc/source/ui/condformat/condformatmgr.cxx @@ -109,7 +109,7 @@ ScCondFormatManagerDlg::ScCondFormatManagerDlg(vcl::Window* pParent, ScDocument* mbModified(false) { SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("CONTAINER"); - Size aSize(LogicToPixel(Size(290, 220), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(290, 220), MapMode(MapUnit::MapAppFont))); pContainer->set_width_request(aSize.Width()); pContainer->set_height_request(aSize.Height()); m_pCtrlManager = VclPtr<ScCondFormatManagerWindow>::Create(*pContainer, mpDoc, mpFormatList); diff --git a/sc/source/ui/dbgui/scendlg.cxx b/sc/source/ui/dbgui/scendlg.cxx index c0600fc8c26b..b914ed2609a7 100644 --- a/sc/source/ui/dbgui/scendlg.cxx +++ b/sc/source/ui/dbgui/scendlg.cxx @@ -46,7 +46,7 @@ ScNewScenarioDlg::ScNewScenarioDlg( vcl::Window* pParent, const OUString& rName, { get(m_pEdName, "name"); get(m_pEdComment, "comment"); - Size aSize(m_pEdComment->LogicToPixel(Size(183, 46), MapUnit::MapAppFont)); + Size aSize(m_pEdComment->LogicToPixel(Size(183, 46), MapMode(MapUnit::MapAppFont))); m_pEdComment->set_width_request(aSize.Width()); m_pEdComment->set_height_request(aSize.Height()); get(m_pCbShowFrame, "showframe"); diff --git a/sc/source/ui/dbgui/validate.cxx b/sc/source/ui/dbgui/validate.cxx index d4998e32492b..6f4c08ebcaa5 100644 --- a/sc/source/ui/dbgui/validate.cxx +++ b/sc/source/ui/dbgui/validate.cxx @@ -338,7 +338,7 @@ ScTPValidationValue::ScTPValidationValue( vcl::Window* pParent, const SfxItemSet get(m_pEdMin, "min"); m_pEdMin->SetReferences(nullptr, m_pFtMin); get(m_pEdList, "minlist"); - Size aSize(LogicToPixel(Size(174, 105), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(174, 105), MapMode(MapUnit::MapAppFont))); m_pEdList->set_width_request(aSize.Width()); m_pEdList->set_height_request(aSize.Height()); get(m_pFtMax, "maxft"); diff --git a/sc/source/ui/dialogs/searchresults.cxx b/sc/source/ui/dialogs/searchresults.cxx index 32b9f6e0ff85..d9cf33f1a4be 100644 --- a/sc/source/ui/dialogs/searchresults.cxx +++ b/sc/source/ui/dialogs/searchresults.cxx @@ -31,7 +31,7 @@ SearchResultsDlg::SearchResultsDlg( SfxBindings* _pBindings, vcl::Window* pParen SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("results"); Size aControlSize(150, 120); - aControlSize = pContainer->LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = pContainer->LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pContainer->set_width_request(aControlSize.Width()); pContainer->set_height_request(aControlSize.Height()); diff --git a/sc/source/ui/docshell/docsh3.cxx b/sc/source/ui/docshell/docsh3.cxx index a0b4bf3858e5..b2cdf855982c 100644 --- a/sc/source/ui/docshell/docsh3.cxx +++ b/sc/source/ui/docshell/docsh3.cxx @@ -377,15 +377,15 @@ void ScDocShell::CalcOutputFactor() MapMode aOldMode = pRefDev->GetMapMode(); vcl::Font aOldFont = pRefDev->GetFont(); - pRefDev->SetMapMode(MapUnit::MapPixel); + pRefDev->SetMapMode(MapMode(MapUnit::MapPixel)); pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pRefDev); // font color doesn't matter here pRefDev->SetFont(aDefFont); - nPrinterWidth = pRefDev->PixelToLogic( Size( pRefDev->GetTextWidth(aTestString), 0 ), MapUnit::Map100thMM ).Width(); + nPrinterWidth = pRefDev->PixelToLogic(Size(pRefDev->GetTextWidth(aTestString), 0), MapMode(MapUnit::Map100thMM)).Width(); pRefDev->SetFont(aOldFont); pRefDev->SetMapMode(aOldMode); ScopedVclPtrInstance< VirtualDevice > pVirtWindow( *Application::GetDefaultDevice() ); - pVirtWindow->SetMapMode(MapUnit::MapPixel); + pVirtWindow->SetMapMode(MapMode(MapUnit::MapPixel)); pPattern->GetFont(aDefFont, SC_AUTOCOL_BLACK, pVirtWindow); // font color doesn't matter here pVirtWindow->SetFont(aDefFont); nWindowWidth = pVirtWindow->GetTextWidth(aTestString); diff --git a/sc/source/ui/docshell/sizedev.cxx b/sc/source/ui/docshell/sizedev.cxx index 4cf8e4e0000f..c5b7e416c83c 100644 --- a/sc/source/ui/docshell/sizedev.cxx +++ b/sc/source/ui/docshell/sizedev.cxx @@ -34,7 +34,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh ) bOwner = false; aOldMapMode = pDevice->GetMapMode(); - pDevice->SetMapMode( MapUnit::MapPixel ); // GetNeededSize needs pixel MapMode + pDevice->SetMapMode(MapMode(MapUnit::MapPixel)); // GetNeededSize needs pixel MapMode // printer has right DigitLanguage already } else @@ -44,7 +44,7 @@ ScSizeDeviceProvider::ScSizeDeviceProvider( ScDocShell* pDocSh ) bOwner = true; } - Point aLogic = pDevice->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); + Point aLogic = pDevice->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); nPPTX = aLogic.X() / 1000.0; nPPTY = aLogic.Y() / 1000.0; diff --git a/sc/source/ui/drawfunc/fuins1.cxx b/sc/source/ui/drawfunc/fuins1.cxx index 11f21c0d509f..310da9e53afe 100644 --- a/sc/source/ui/drawfunc/fuins1.cxx +++ b/sc/source/ui/drawfunc/fuins1.cxx @@ -188,9 +188,9 @@ static void lcl_InsertMedia( const OUString& rMediaURL, bool bApi, if( rPrefSize.Width() && rPrefSize.Height() ) { if( pWindow ) - aSize = pWindow->PixelToLogic( rPrefSize, MapUnit::Map100thMM ); + aSize = pWindow->PixelToLogic(rPrefSize, MapMode(MapUnit::Map100thMM)); else - aSize = Application::GetDefaultDevice()->PixelToLogic( rPrefSize, MapUnit::Map100thMM ); + aSize = Application::GetDefaultDevice()->PixelToLogic(rPrefSize, MapMode(MapUnit::Map100thMM)); } else aSize = Size( 5000, 5000 ); diff --git a/sc/source/ui/drawfunc/fuins2.cxx b/sc/source/ui/drawfunc/fuins2.cxx index a5efb6b2c3ca..15904ee521e6 100644 --- a/sc/source/ui/drawfunc/fuins2.cxx +++ b/sc/source/ui/drawfunc/fuins2.cxx @@ -327,7 +327,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* // rectangle with balanced edge ratio aSize.Width() = 5000; aSize.Height() = 5000; - Size aTmp = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aMapUnit ); + Size aTmp = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(aMapUnit)); aSz.Width = aTmp.Width(); aSz.Height = aTmp.Height(); xObj->setVisualAreaSize( nAspect, aSz ); @@ -366,7 +366,7 @@ FuInsertOLE::FuInsertOLE(ScTabViewShell* pViewSh, vcl::Window* pWin, ScDrawView* awt::Size aSz = xObj->getVisualAreaSize( nAspect ); Size aNewSize( aSz.Width, aSz.Height ); - aNewSize = OutputDevice::LogicToLogic( aNewSize, aMapUnit, MapUnit::Map100thMM ); + aNewSize = OutputDevice::LogicToLogic(aNewSize, MapMode(aMapUnit), MapMode(MapUnit::Map100thMM)); if ( aNewSize != aSize ) { diff --git a/sc/source/ui/miscdlgs/retypepassdlg.cxx b/sc/source/ui/miscdlgs/retypepassdlg.cxx index cc4ed0b727cb..dc3e0dc7091f 100644 --- a/sc/source/ui/miscdlgs/retypepassdlg.cxx +++ b/sc/source/ui/miscdlgs/retypepassdlg.cxx @@ -40,7 +40,7 @@ ScRetypePassDlg::ScRetypePassDlg(vcl::Window* pParent) : get(mpTextDocStatus, "docStatusLabel"); get(mpBtnRetypeDoc, "retypeDocButton"); vcl::Window *pScrolledWindow = get<vcl::Window>("scrolledwindow"); - Size aSize(LogicToPixel(Size(190, 90), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(190, 90), MapMode(MapUnit::MapAppFont))); pScrolledWindow->set_width_request(aSize.Width()); pScrolledWindow->set_height_request(aSize.Height()); get(mpSheetsBox, "sheetsBox"); diff --git a/sc/source/ui/namedlg/namepast.cxx b/sc/source/ui/namedlg/namepast.cxx index 720d581d7ce4..bba2218c67a8 100644 --- a/sc/source/ui/namedlg/namepast.cxx +++ b/sc/source/ui/namedlg/namepast.cxx @@ -49,7 +49,7 @@ ScNamePasteDlg::ScNamePasteDlg( vcl::Window * pParent, ScDocShell* pShell ) ScAddress aPos(pViewData->GetCurX(), pViewData->GetCurY(), pViewData->GetTabNo()); SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("ctrl"); Size aControlSize(210, 0); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pContainer->set_width_request(aControlSize.Width()); pContainer->set_height_request(10 * GetTextHeight()); mpTable = VclPtr<ScRangeManagerTable>::Create(*pContainer, m_RangeMap, aPos); diff --git a/sc/source/ui/navipi/content.cxx b/sc/source/ui/navipi/content.cxx index ddeba41626da..7549bb6a51e4 100644 --- a/sc/source/ui/navipi/content.cxx +++ b/sc/source/ui/navipi/content.cxx @@ -146,7 +146,7 @@ ScContentTree::ScContentTree(vcl::Window* pParent, ScNavigatorDlg* pNavigatorDlg Size ScContentTree::GetOptimalSize() const { - return LogicToPixel(Size(110, 100), MapUnit::MapAppFont); + return LogicToPixel(Size(110, 100), MapMode(MapUnit::MapAppFont)); } ScContentTree::~ScContentTree() diff --git a/sc/source/ui/pagedlg/scuitphfedit.cxx b/sc/source/ui/pagedlg/scuitphfedit.cxx index 527c3f31ffb3..5ac92feac1db 100644 --- a/sc/source/ui/pagedlg/scuitphfedit.cxx +++ b/sc/source/ui/pagedlg/scuitphfedit.cxx @@ -130,7 +130,7 @@ ScHFEditPage::ScHFEditPage( vcl::Window* pParent, m_pWndRight->SetFont( aPatAttr ); // Set size request for all 3 widgets - Size aSize = LogicToPixel(Size(80, 120), MapUnit::MapAppFont); + Size aSize = LogicToPixel(Size(80, 120), MapMode(MapUnit::MapAppFont)); VclPtr<ScEditWindow> aEditWindows[] = {m_pWndLeft, m_pWndCenter, m_pWndRight}; for (auto &pEditWindow : aEditWindows) diff --git a/sc/source/ui/pagedlg/tphfedit.cxx b/sc/source/ui/pagedlg/tphfedit.cxx index 7fe3affa9506..8ddc1da38dd7 100644 --- a/sc/source/ui/pagedlg/tphfedit.cxx +++ b/sc/source/ui/pagedlg/tphfedit.cxx @@ -73,7 +73,7 @@ ScEditWindow::ScEditWindow( vcl::Window* pParent, WinBits nBits, ScEditWindowLoc const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); Color aBgColor = rStyleSettings.GetWindowColor(); - SetMapMode( MapUnit::MapTwip ); + SetMapMode(MapMode(MapUnit::MapTwip)); SetPointer( PointerStyle::Text ); SetBackground( aBgColor ); diff --git a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx index 74628c74b007..d6a0f765cb89 100644 --- a/sc/source/ui/sidebar/CellLineStyleValueSet.cxx +++ b/sc/source/ui/sidebar/CellLineStyleValueSet.cxx @@ -45,7 +45,7 @@ void CellLineStyleValueSet::dispose() Size CellLineStyleValueSet::GetOptimalSize() const { - return LogicToPixel(Size(80, 12 * 9), MapUnit::MapAppFont); + return LogicToPixel(Size(80, 12 * 9), MapMode(MapUnit::MapAppFont)); } void CellLineStyleValueSet::SetUnit(const OUString* str) diff --git a/sc/source/ui/undo/undostyl.cxx b/sc/source/ui/undo/undostyl.cxx index b2d7ccde8875..5a0e602dbca5 100644 --- a/sc/source/ui/undo/undostyl.cxx +++ b/sc/source/ui/undo/undostyl.cxx @@ -91,7 +91,7 @@ static void lcl_DocStyleChanged( ScDocument* pDoc, const SfxStyleSheetBase* pSty //! move to document or docshell ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); + Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); diff --git a/sc/source/ui/unoobj/styleuno.cxx b/sc/source/ui/unoobj/styleuno.cxx index 2f33af031ef5..3f52656351cc 100644 --- a/sc/source/ui/unoobj/styleuno.cxx +++ b/sc/source/ui/unoobj/styleuno.cxx @@ -716,7 +716,7 @@ void SAL_CALL ScStyleFamilyObj::removeByName( const OUString& aName ) { // like ScViewFunc::RemoveStyleSheetInUse ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); + Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); @@ -1048,7 +1048,7 @@ void SAL_CALL ScStyleObj::setParentStyle( const OUString& rParentStyle ) // update line height ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); + Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapMode(MapUnit::MapTwip)); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); @@ -1411,7 +1411,7 @@ void SAL_CALL ScStyleObj::setAllPropertiesToDefault() // row heights ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); + Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); @@ -1758,7 +1758,7 @@ void ScStyleObj::setPropertyValue_Impl( const OUString& rPropertyName, const Sfx { // update line height ScopedVclPtrInstance< VirtualDevice > pVDev; - Point aLogic = pVDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); + Point aLogic = pVDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); double nPPTX = aLogic.X() / 1000.0; double nPPTY = aLogic.Y() / 1000.0; Fraction aZoom(1,1); diff --git a/sc/source/ui/unoobj/textuno.cxx b/sc/source/ui/unoobj/textuno.cxx index 1ec4af602ce1..5794ce65a39b 100644 --- a/sc/source/ui/unoobj/textuno.cxx +++ b/sc/source/ui/unoobj/textuno.cxx @@ -212,7 +212,7 @@ SvxTextForwarder* ScHeaderFooterTextData::GetTextForwarder() ScHeaderEditEngine* pHdrEngine = new ScHeaderEditEngine( pEnginePool ); pHdrEngine->EnableUndo( false ); - pHdrEngine->SetRefMapMode( MapUnit::MapTwip ); + pHdrEngine->SetRefMapMode(MapMode(MapUnit::MapTwip)); // default font must be set, independently of document // -> use global pool from module @@ -936,7 +936,7 @@ SvxTextForwarder* ScCellTextData::GetTextForwarder() if (pDocShell) pEditEngine->SetRefDevice(pDocShell->GetRefDevice()); else - pEditEngine->SetRefMapMode( MapUnit::Map100thMM ); + pEditEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); pForwarder = new SvxEditEngineForwarder(*pEditEngine); } diff --git a/sc/source/ui/view/drawvie4.cxx b/sc/source/ui/view/drawvie4.cxx index 1314246cbd6c..23a9957ccef4 100644 --- a/sc/source/ui/view/drawvie4.cxx +++ b/sc/source/ui/view/drawvie4.cxx @@ -473,7 +473,8 @@ void ScDrawView::SetMarkedOriginalSize() aSz = xObj->getVisualAreaSize( static_cast<SdrOle2Obj*>(pObj)->GetAspect() ); aOriginalSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), - aUnit, MapUnit::Map100thMM ); + MapMode(aUnit), + MapMode(MapUnit::Map100thMM)); bDo = true; } catch( embed::NoVisualAreaSizeException& ) { diff --git a/sc/source/ui/view/drawview.cxx b/sc/source/ui/view/drawview.cxx index 7004ea618877..8c34b9dd3128 100644 --- a/sc/source/ui/view/drawview.cxx +++ b/sc/source/ui/view/drawview.cxx @@ -312,7 +312,7 @@ void ScDrawView::RecalcScale() } else { - Point aLogic = pDev->LogicToPixel( Point(1000,1000), MapUnit::MapTwip ); + Point aLogic = pDev->LogicToPixel(Point(1000,1000), MapMode(MapUnit::MapTwip)); nPPTX = aLogic.X() / 1000.0; nPPTY = aLogic.Y() / 1000.0; //! Zoom, handed over ??? @@ -559,7 +559,7 @@ bool ScDrawView::SdrBeginTextEdit( { tools::Rectangle aRectangle = pView->GetOutputArea(); if (pWinL && pWinL->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); OString sRectangle = aRectangle.toString(); SfxLokHelper::notifyOtherViews(pViewSh, LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle); } diff --git a/sc/source/ui/view/gridwin.cxx b/sc/source/ui/view/gridwin.cxx index ee82b35dbbcd..6741839dd5ea 100644 --- a/sc/source/ui/view/gridwin.cxx +++ b/sc/source/ui/view/gridwin.cxx @@ -919,7 +919,7 @@ void ScGridWindow::DoScenarioMenu( const ScRange& rScenRange ) vcl::Font aOldFont = GetFont(); SetFont(mpFilterBox->GetFont()); MapMode aOldMode = GetMapMode(); - SetMapMode( MapUnit::MapPixel ); + SetMapMode(MapMode(MapUnit::MapPixel)); nHeight = GetTextHeight(); nHeight *= SC_FILTERLISTBOX_LINES; @@ -1044,7 +1044,7 @@ void ScGridWindow::LaunchDataSelectMenu( SCCOL nCol, SCROW nRow ) vcl::Font aOldFont = GetFont(); SetFont(mpFilterBox->GetFont()); MapMode aOldMode = GetMapMode(); - SetMapMode(MapUnit::MapPixel); + SetMapMode(MapMode(MapUnit::MapPixel)); nHeight = GetTextHeight(); nHeight *= SC_FILTERLISTBOX_LINES; @@ -1384,7 +1384,7 @@ bool ScGridWindow::IsCellCoveredByText(SCCOL nPosX, SCROW nPosY, SCTAB nTab, SCC &aZoomX, &aZoomY); MapMode aCurrentMapMode(GetMapMode()); - SetMapMode(MapUnit::MapPixel); + SetMapMode(MapMode(MapUnit::MapPixel)); // obtain the bounding box of the text in first non-empty cell // to the left @@ -4433,7 +4433,7 @@ void ScGridWindow::ScrollPixel( long nDifX, long nDifY ) ClickExtern(); HideNoteMarker(); - SetMapMode(MapUnit::MapPixel); + SetMapMode(MapMode(MapUnit::MapPixel)); Scroll( nDifX, nDifY, ScrollFlags::Children ); SetMapMode( GetDrawMapMode() ); // generated shifted MapMode @@ -5010,7 +5010,7 @@ std::shared_ptr<ScFieldEditEngine> createEditEngine( ScDocShell* pDocSh, const S std::shared_ptr<ScFieldEditEngine> pEngine(new ScFieldEditEngine(&rDoc, rDoc.GetEditPool())); ScSizeDeviceProvider aProv(pDocSh); pEngine->SetRefDevice(aProv.GetDevice()); - pEngine->SetRefMapMode(MapUnit::Map100thMM); + pEngine->SetRefMapMode(MapMode(MapUnit::Map100thMM)); SfxItemSet aDefault = pEngine->GetEmptyItemSet(); rPat.FillEditItemSet(&aDefault); aDefault.Put( SvxAdjustItem(toSvxAdjust(rPat), EE_PARA_JUST) ); diff --git a/sc/source/ui/view/gridwin4.cxx b/sc/source/ui/view/gridwin4.cxx index 19e398a58367..e4a15be8e717 100644 --- a/sc/source/ui/view/gridwin4.cxx +++ b/sc/source/ui/view/gridwin4.cxx @@ -497,7 +497,7 @@ void ScGridWindow::Draw( SCCOL nX1, SCROW nY1, SCCOL nX2, SCROW nY2, ScUpdateMod // use a virtual device with 1/100th mm as text formatting reference xFmtVirtDev.disposeAndReset( VclPtr<VirtualDevice>::Create() ); - xFmtVirtDev->SetMapMode( MapUnit::Map100thMM ); + xFmtVirtDev->SetMapMode(MapMode(MapUnit::Map100thMM)); aOutputData.SetFmtDevice( xFmtVirtDev.get() ); bLogicText = true; // use logic MapMode @@ -661,7 +661,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI { // save MapMode and set to pixel MapMode aCurrentMapMode(pContentDev->GetMapMode()); - pContentDev->SetMapMode(MapUnit::MapPixel); + pContentDev->SetMapMode(MapMode(MapUnit::MapPixel)); tools::Rectangle aPixRect = tools::Rectangle( Point(), GetOutputSizePixel() ); pContentDev->SetFillColor( rColorCfg.GetColorValue(svtools::APPBACKGROUND).nColor ); @@ -702,7 +702,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI if ( rDoc.HasBackgroundDraw( nTab, aDrawingRectLogic ) ) { - pContentDev->SetMapMode(MapUnit::MapPixel); + pContentDev->SetMapMode(MapMode(MapUnit::MapPixel)); aOutputData.DrawClear(); // drawing background @@ -723,7 +723,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI if ( !bGridFirst && ( bGrid || bPage ) ) aOutputData.DrawGrid(*pContentDev, bGrid, bPage); - pContentDev->SetMapMode(MapUnit::MapPixel); + pContentDev->SetMapMode(MapMode(MapUnit::MapPixel)); if ( bPageMode ) { @@ -765,13 +765,13 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI pContentDev->SetMapMode(aMap); } else - pContentDev->SetMapMode(MapUnit::MapPixel); + pContentDev->SetMapMode(MapMode(MapUnit::MapPixel)); // Autofilter- and Pivot-Buttons DrawButtons(nX1, nX2, rTableInfo, pContentDev); // Pixel - pContentDev->SetMapMode(MapUnit::MapPixel); + pContentDev->SetMapMode(MapMode(MapUnit::MapPixel)); aOutputData.DrawClipMarks(); @@ -822,7 +822,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI pContentDev->SetMapMode(aOrig); } - pContentDev->SetMapMode(MapUnit::MapPixel); + pContentDev->SetMapMode(MapMode(MapUnit::MapPixel)); if ( pViewData->IsRefMode() && nTab >= pViewData->GetRefStartZ() && nTab <= pViewData->GetRefEndZ() ) { @@ -956,7 +956,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI tools::Rectangle aEditRect(Point(nScreenX, nScreenY), Size(nScreenW, nScreenH)); pOtherEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice); - rDevice.SetMapMode(MapUnit::MapPixel); + rDevice.SetMapMode(MapMode(MapUnit::MapPixel)); } } } @@ -1030,7 +1030,7 @@ void ScGridWindow::DrawContent(OutputDevice &rDevice, const ScTableInfo& rTableI // paint the editeng text tools::Rectangle aEditRect(Point(nScrX, nScrY), Size(aOutputData.GetScrW(), aOutputData.GetScrH())); pEditView->Paint(rDevice.PixelToLogic(aEditRect), &rDevice); - rDevice.SetMapMode(MapUnit::MapPixel); + rDevice.SetMapMode(MapMode(MapUnit::MapPixel)); // restore the cursor it was originally visible if (bVisCursor) @@ -1218,7 +1218,7 @@ void ScGridWindow::LogicInvalidate(const tools::Rectangle* pRectangle) if (IsMapModeEnabled()) { if (GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); } else aRectangle = PixelToLogic(aRectangle, MapMode(MapUnit::MapTwip)); diff --git a/sc/source/ui/view/gridwin_dbgutil.cxx b/sc/source/ui/view/gridwin_dbgutil.cxx index 6dc9bd1ebafc..c8285ae40a17 100644 --- a/sc/source/ui/view/gridwin_dbgutil.cxx +++ b/sc/source/ui/view/gridwin_dbgutil.cxx @@ -59,7 +59,7 @@ void ScGridWindow::dumpColumnInformationHmm() for (SCCOL nCol = 0; nCol <= 20; ++nCol) { sal_uInt16 nWidth = pDoc->GetColWidth(nCol, nTab); - long nPixel = LogicToLogic(Point(nWidth, 0), MapUnit::MapTwip, MapUnit::Map100thMM).getX(); + long nPixel = LogicToLogic(Point(nWidth, 0), MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM)).getX(); std::cout << "Column: " << nCol << ", Width: " << nPixel << "hmm" << std::endl; } } diff --git a/sc/source/ui/view/hintwin.cxx b/sc/source/ui/view/hintwin.cxx index 80d7fff29fcb..4013a0cd3697 100644 --- a/sc/source/ui/view/hintwin.cxx +++ b/sc/source/ui/view/hintwin.cxx @@ -159,7 +159,7 @@ drawinglayer::primitive2d::Primitive2DContainer ScOverlayHint::createOverlayObje Size ScOverlayHint::GetSizePixel() const { basegfx::B2DRange aRange; - createOverlaySequence(0, 0, MapUnit::MapPixel, aRange); + createOverlaySequence(0, 0, MapMode(MapUnit::MapPixel), aRange); return Size(aRange.getWidth(), aRange.getHeight()); } diff --git a/sc/source/ui/view/preview.cxx b/sc/source/ui/view/preview.cxx index ab30e5fcdaf2..1ebead6706b7 100644 --- a/sc/source/ui/view/preview.cxx +++ b/sc/source/ui/view/preview.cxx @@ -815,7 +815,7 @@ sal_uInt16 ScPreview::GetOptimalZoom(bool bWidthOnly) // desired margin is 0.25cm in default MapMode (like Writer), // but some additional margin is introduced by integer scale values // -> add only 0.10cm, so there is some margin in all cases. - Size aMarginSize( LogicToPixel( Size( 100, 100 ), MapUnit::Map100thMM ) ); + Size aMarginSize( LogicToPixel(Size(100, 100), MapMode(MapUnit::Map100thMM)) ); aWinSize.Width() -= 2 * aMarginSize.Width(); aWinSize.Height() -= 2 * aMarginSize.Height(); @@ -851,7 +851,8 @@ void ScPreview::SetXOffset( long nX ) aOffset.X() = nX; if (nDif && !bInSetZoom) { - MapMode aOldMode = GetMapMode(); SetMapMode(MapUnit::MapPixel); + MapMode aOldMode = GetMapMode(); + SetMapMode(MapMode(MapUnit::MapPixel)); Scroll( nDif, 0 ); SetMapMode(aOldMode); } @@ -877,7 +878,8 @@ void ScPreview::SetYOffset( long nY ) aOffset.Y() = nY; if (nDif && !bInSetZoom) { - MapMode aOldMode = GetMapMode(); SetMapMode(MapUnit::MapPixel); + MapMode aOldMode = GetMapMode(); + SetMapMode(MapMode(MapUnit::MapPixel)); Scroll( 0, nDif ); SetMapMode(aOldMode); } diff --git a/sc/source/ui/view/printfun.cxx b/sc/source/ui/view/printfun.cxx index 7b46e66adf95..7ee63fe3c1d5 100644 --- a/sc/source/ui/view/printfun.cxx +++ b/sc/source/ui/view/printfun.cxx @@ -186,7 +186,7 @@ void ScPrintFunc::Construct( const ScPrintOptions* pOptions ) // unified MapMode for all calls (e.g. Repaint!!!) // else, EditEngine outputs different text heights - pDev->SetMapMode(MapUnit::MapPixel); + pDev->SetMapMode(MapMode(MapUnit::MapPixel)); pBorderItem = nullptr; pBackgroundItem = nullptr; @@ -243,7 +243,7 @@ ScPrintFunc::ScPrintFunc( ScDocShell* pShell, SfxPrinter* pNewPrinter, SCTAB nTa pPageData ( pData ) { pDev = pPrinter.get(); - aSrcOffset = pPrinter->PixelToLogic( pPrinter->GetPageOffsetPixel(), MapUnit::Map100thMM ); + aSrcOffset = pPrinter->PixelToLogic(pPrinter->GetPageOffsetPixel(), MapMode(MapUnit::Map100thMM)); Construct( pOptions ); } @@ -541,7 +541,7 @@ void ScPrintFunc::DrawToDev( ScDocument* pDoc, OutputDevice* pDev, double /* nPr if ( bMetaFile && pDev->GetOutDevType() == OUTDEV_VIRDEV ) aOutputData.SetSnapPixel(); - Point aLogStart = pDev->PixelToLogic( Point(nScrX,nScrY), MapUnit::Map100thMM ); + Point aLogStart = pDev->PixelToLogic(Point(nScrX, nScrY), MapMode(MapUnit::Map100thMM)); long nLogStX = aLogStart.X(); long nLogStY = aLogStart.Y(); @@ -707,7 +707,7 @@ bool ScPrintFunc::AdjustPrintArea( bool bNew ) if ( bChangeCol ) { OutputDevice* pRefDev = pDoc->GetPrinter(); // use the printer also for Preview - pRefDev->SetMapMode( MapUnit::MapPixel ); // important for GetNeededSize + pRefDev->SetMapMode(MapMode(MapUnit::MapPixel)); // important for GetNeededSize pDoc->ExtendPrintArea( pRefDev, nPrintTab, nStartCol, nStartRow, nEndCol, nEndRow ); diff --git a/sc/source/ui/view/tabview.cxx b/sc/source/ui/view/tabview.cxx index 5325828c81d9..adc713bfbbd0 100644 --- a/sc/source/ui/view/tabview.cxx +++ b/sc/source/ui/view/tabview.cxx @@ -1848,7 +1848,7 @@ Point ScTabView::GetChartDialogPos( const Size& rDialogSize, const tools::Rectan pWin->OutputToAbsoluteScreenPixel( aObjPixel.BottomRight() ) ); tools::Rectangle aDesktop = pWin->GetDesktopRectPixel(); - Size aSpace = pWin->LogicToPixel( Size( 8, 12 ), MapUnit::MapAppFont ); + Size aSpace = pWin->LogicToPixel( Size(8, 12), MapMode(MapUnit::MapAppFont)); ScDocument* pDoc = aViewData.GetDocument(); SCTAB nTab = aViewData.GetTabNo(); diff --git a/sc/source/ui/view/tabvwsh4.cxx b/sc/source/ui/view/tabvwsh4.cxx index 1b67ca293cba..f222d8a51019 100644 --- a/sc/source/ui/view/tabvwsh4.cxx +++ b/sc/source/ui/view/tabvwsh4.cxx @@ -324,7 +324,7 @@ void ScTabViewShell::UpdateOleZoom() if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 ) { vcl::Window* pWin = GetActiveWin(); - Size aWinHMM = pWin->PixelToLogic( pWin->GetOutputSizePixel(), MapUnit::Map100thMM ); + Size aWinHMM = pWin->PixelToLogic(pWin->GetOutputSizePixel(), MapMode(MapUnit::Map100thMM)); SetZoomFactor( Fraction( aWinHMM.Width(),aObjSize.Width() ), Fraction( aWinHMM.Height(),aObjSize.Height() ) ); } @@ -353,7 +353,7 @@ void ScTabViewShell::InnerResizePixel( const Point &rOfs, const Size &rSize, boo if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 ) { - Size aLogicSize = GetWindow()->PixelToLogic( aSize, MapUnit::Map100thMM ); + Size aLogicSize = GetWindow()->PixelToLogic(aSize, MapMode(MapUnit::Map100thMM)); SfxViewShell::SetZoomFactor( Fraction( aLogicSize.Width(),aObjSize.Width() ), Fraction( aLogicSize.Height(),aObjSize.Height() ) ); } diff --git a/sc/source/ui/view/tabvwshb.cxx b/sc/source/ui/view/tabvwshb.cxx index 44d505ccdd2e..8d644bb0eeec 100644 --- a/sc/source/ui/view/tabvwshb.cxx +++ b/sc/source/ui/view/tabvwshb.cxx @@ -182,7 +182,7 @@ void ScTabViewShell::ActivateObject( SdrOle2Obj* pObj, long nVerb ) { MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( pClient->GetAspect() ) ); aOleSize = OutputDevice::LogicToLogic( aDrawSize, - MapUnit::Map100thMM, aUnit ); + MapMode(MapUnit::Map100thMM), MapMode(aUnit)); awt::Size aSz( aOleSize.Width(), aOleSize.Height() ); xObj->setVisualAreaSize( pClient->GetAspect(), aSz ); } diff --git a/sc/source/ui/view/viewfun7.cxx b/sc/source/ui/view/viewfun7.cxx index f08b7688432d..c72cfc2702bd 100644 --- a/sc/source/ui/view/viewfun7.cxx +++ b/sc/source/ui/view/viewfun7.cxx @@ -311,7 +311,7 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X if ( pDescSize && pDescSize->Width() && pDescSize->Height() ) { // use size from object descriptor if given - aSize = OutputDevice::LogicToLogic( *pDescSize, aMap100, aMapObj ); + aSize = OutputDevice::LogicToLogic(*pDescSize, MapMode(aMap100), MapMode(aMapObj)); awt::Size aSz; aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); @@ -329,14 +329,14 @@ bool ScViewFunc::PasteObject( const Point& rPos, const uno::Reference < embed::X } aSize = Size( aSz.Width, aSz.Height ); - aSize = OutputDevice::LogicToLogic( aSize, aMapObj, aMap100 ); // for SdrOle2Obj + aSize = OutputDevice::LogicToLogic(aSize, MapMode(aMapObj), MapMode(aMap100)); // for SdrOle2Obj if( aSize.Height() == 0 || aSize.Width() == 0 ) { OSL_FAIL("SvObjectDescriptor::GetSize == 0"); aSize.Width() = 5000; aSize.Height() = 5000; - aSize = OutputDevice::LogicToLogic( aSize, aMap100, aMapObj ); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(aMap100), MapMode(aMapObj)); aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); xObj->setVisualAreaSize( nAspect, aSz ); diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx index 836d368fa731..b09c15316d17 100644 --- a/sc/source/ui/view/viewfunc.cxx +++ b/sc/source/ui/view/viewfunc.cxx @@ -1425,7 +1425,7 @@ void ScViewFunc::RemoveStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) ScDocShellModificator aModificator( *pDocSh ); ScopedVclPtrInstance< VirtualDevice > pVirtDev; - pVirtDev->SetMapMode(MapUnit::MapPixel); + pVirtDev->SetMapMode(MapMode(MapUnit::MapPixel)); pDoc->StyleSheetChanged( pStyleSheet, true, pVirtDev, rViewData.GetPPTX(), rViewData.GetPPTY(), @@ -1451,7 +1451,7 @@ void ScViewFunc::UpdateStyleSheetInUse( const SfxStyleSheetBase* pStyleSheet ) ScDocShellModificator aModificator( *pDocSh ); ScopedVclPtrInstance< VirtualDevice > pVirtDev; - pVirtDev->SetMapMode(MapUnit::MapPixel); + pVirtDev->SetMapMode(MapMode(MapUnit::MapPixel)); pDoc->StyleSheetChanged( pStyleSheet, false, pVirtDev, rViewData.GetPPTX(), rViewData.GetPPTY(), diff --git a/sc/source/ui/xmlsource/xmlsourcedlg.cxx b/sc/source/ui/xmlsource/xmlsourcedlg.cxx index c48fb8387104..ab128360889e 100644 --- a/sc/source/ui/xmlsource/xmlsourcedlg.cxx +++ b/sc/source/ui/xmlsource/xmlsourcedlg.cxx @@ -79,7 +79,7 @@ ScXMLSourceDlg::ScXMLSourceDlg( get(mpFtSourceFile, "sourcefile"); get(mpMapGrid, "mapgrid"); get(mpLbTree, "tree"); - Size aTreeSize(mpLbTree->LogicToPixel(Size(130, 120), MapUnit::MapAppFont)); + Size aTreeSize(mpLbTree->LogicToPixel(Size(130, 120), MapMode(MapUnit::MapAppFont))); mpLbTree->set_width_request(aTreeSize.Width()); mpLbTree->set_height_request(aTreeSize.Height()); get(mpRefEdit, "edit"); diff --git a/sd/source/core/sdpage.cxx b/sd/source/core/sdpage.cxx index db9a24edb5b9..6d7358947ca6 100644 --- a/sd/source/core/sdpage.cxx +++ b/sd/source/core/sdpage.cxx @@ -335,7 +335,7 @@ SdrObject* SdPage::CreatePresObj(PresObjKind eObjKind, bool bVertical, const ::t aOutDev.SetMapMode( aGraphic.GetPrefMapMode() ); Size aSizePix = aOutDev.LogicToPixel( aGraphic.GetPrefSize() ); - aOutDev.SetMapMode(MapUnit::Map100thMM); + aOutDev.SetMapMode(MapMode(MapUnit::Map100thMM)); Size aSize = aOutDev.PixelToLogic(aSizePix); Point aPnt (0, 0); diff --git a/sd/source/filter/eppt/eppt.cxx b/sd/source/filter/eppt/eppt.cxx index 21aef0eee81e..cbedbab9a340 100644 --- a/sd/source/filter/eppt/eppt.cxx +++ b/sd/source/filter/eppt/eppt.cxx @@ -1078,7 +1078,7 @@ void ImplExportComments( const uno::Reference< drawing::XDrawPage >& xPage, SvMe geometry::RealPoint2D aRealPoint2D( xAnnotation->getPosition() ); MapMode aMapDest( MapUnit::MapInch, Point(), Fraction( 1, 576 ), Fraction( 1, 576 ) ); Point aPoint( OutputDevice::LogicToLogic( Point( static_cast< sal_Int32 >( aRealPoint2D.X * 100.0 ), - static_cast< sal_Int32 >( aRealPoint2D.Y * 100.0 ) ), MapUnit::Map100thMM, aMapDest ) ); + static_cast<sal_Int32>(aRealPoint2D.Y * 100.0)), MapMode(MapUnit::Map100thMM), aMapDest)); OUString sAuthor( xAnnotation->getAuthor() ); uno::Reference< text::XText > xText( xAnnotation->getTextRange() ); diff --git a/sd/source/filter/grf/sdgrffilter.cxx b/sd/source/filter/grf/sdgrffilter.cxx index 0fb0bea255d7..d34ca8d27471 100644 --- a/sd/source/filter/grf/sdgrffilter.cxx +++ b/sd/source/filter/grf/sdgrffilter.cxx @@ -179,7 +179,7 @@ bool SdGRFFilter::Import() Point aPos; Size aPagSize( pPage->GetSize() ); Size aGrfSize( OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), - aGraphic.GetPrefMapMode(), MapUnit::Map100thMM ) ); + aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM))); aPagSize.Width() -= pPage->GetLeftBorder() + pPage->GetRightBorder(); aPagSize.Height() -= pPage->GetUpperBorder() + pPage->GetLowerBorder(); diff --git a/sd/source/filter/html/pubdlg.cxx b/sd/source/filter/html/pubdlg.cxx index 50c56e07855d..84189022e204 100644 --- a/sd/source/filter/html/pubdlg.cxx +++ b/sd/source/filter/html/pubdlg.cxx @@ -367,7 +367,7 @@ SdPublishingDlg::SdPublishingDlg(vcl::Window* pWindow, DocumentType eDocType) m_bImpress = eDocType == DocumentType::Impress; - Size aSize(LogicToPixel(Size(60, 50), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(60, 50), MapMode(MapUnit::MapAppFont))); get(pPage2_Standard_FB, "standardFBImage"); pPage2_Standard_FB->set_width_request(aSize.Width()); pPage2_Standard_FB->set_height_request(aSize.Height()); diff --git a/sd/source/ui/animations/CustomAnimationList.cxx b/sd/source/ui/animations/CustomAnimationList.cxx index 851cbf7bec11..981b61e36470 100644 --- a/sd/source/ui/animations/CustomAnimationList.cxx +++ b/sd/source/ui/animations/CustomAnimationList.cxx @@ -417,7 +417,7 @@ void CustomAnimationTriggerEntryItem::Paint(const Point& rPos, SvTreeListBox& rD // draw the category title int nVertBorder = ((aSize.Height() - rDev.GetTextHeight()) >> 1); - int nHorzBorder = rRenderContext.LogicToPixel(Size(3, 3), MapUnit::MapAppFont).Width(); + int nHorzBorder = rRenderContext.LogicToPixel(Size(3, 3), MapMode(MapUnit::MapAppFont)).Width(); aOutRect.Left() += nHorzBorder; aOutRect.Right() -= nHorzBorder; @@ -948,7 +948,7 @@ void CustomAnimationList::Paint(vcl::RenderContext& rRenderContext, const ::tool { Color aOldColor(rRenderContext.GetTextColor()); rRenderContext.SetTextColor(rRenderContext.GetSettings().GetStyleSettings().GetDisableColor()); - ::Point aOffset(rRenderContext.LogicToPixel(Point(6, 6), MapUnit::MapAppFont)); + ::Point aOffset(rRenderContext.LogicToPixel(Point(6, 6), MapMode(MapUnit::MapAppFont))); ::tools::Rectangle aRect(Point(0,0), GetOutputSizePixel()); diff --git a/sd/source/ui/animations/SlideTransitionPane.cxx b/sd/source/ui/animations/SlideTransitionPane.cxx index 900ab2bff71d..fc01f7b7547e 100644 --- a/sd/source/ui/animations/SlideTransitionPane.cxx +++ b/sd/source/ui/animations/SlideTransitionPane.cxx @@ -386,7 +386,7 @@ public: virtual Size GetOptimalSize() const override { - return LogicToPixel(Size(70, 88), MapUnit::MapAppFont); + return LogicToPixel(Size(70, 88), MapMode(MapUnit::MapAppFont)); } }; diff --git a/sd/source/ui/app/sdmod.cxx b/sd/source/ui/app/sdmod.cxx index 17452c66a10d..61dd5e6b10a4 100644 --- a/sd/source/ui/app/sdmod.cxx +++ b/sd/source/ui/app/sdmod.cxx @@ -88,7 +88,7 @@ SdModule::SdModule(SfxObjectFactory* pFact1, SfxObjectFactory* pFact2 ) // set its resolution to 600 DPI. This leads to a visually better // formatting of text in small sizes (6 point and below.) mpVirtualRefDevice.reset(VclPtr<VirtualDevice>::Create()); - mpVirtualRefDevice->SetMapMode( MapUnit::Map100thMM ); + mpVirtualRefDevice->SetMapMode(MapMode(MapUnit::Map100thMM)); mpVirtualRefDevice->SetReferenceDevice ( VirtualDevice::RefDevMode::Dpi600 ); } diff --git a/sd/source/ui/dlg/PaneDockingWindow.cxx b/sd/source/ui/dlg/PaneDockingWindow.cxx index b68665a0a24d..95bbb7228f75 100644 --- a/sd/source/ui/dlg/PaneDockingWindow.cxx +++ b/sd/source/ui/dlg/PaneDockingWindow.cxx @@ -43,7 +43,7 @@ PaneDockingWindow::PaneDockingWindow( : TitledDockingWindow(_pBindings, pChildWindow, pParent) { SetTitle(rsTitle); - SetSizePixel(LogicToPixel(Size(80,200), MapUnit::MapAppFont)); + SetSizePixel(LogicToPixel(Size(80,200), MapMode(MapUnit::MapAppFont))); } PaneDockingWindow::~PaneDockingWindow() diff --git a/sd/source/ui/dlg/RemoteDialogClientBox.cxx b/sd/source/ui/dlg/RemoteDialogClientBox.cxx index 999d02e36b9c..ca9554ff509b 100644 --- a/sd/source/ui/dlg/RemoteDialogClientBox.cxx +++ b/sd/source/ui/dlg/RemoteDialogClientBox.cxx @@ -108,7 +108,7 @@ VCL_BUILDER_FACTORY_CONSTRUCTOR(ClientBox, WB_TABSTOP) Size ClientBox::GetOptimalSize() const { - return LogicToPixel(Size(200, 140), MapUnit::MapAppFont); + return LogicToPixel(Size(200, 140), MapMode(MapUnit::MapAppFont)); } ClientBox::~ClientBox() diff --git a/sd/source/ui/dlg/animobjs.cxx b/sd/source/ui/dlg/animobjs.cxx index d413eb95884d..8d1eda9a2e56 100644 --- a/sd/source/ui/dlg/animobjs.cxx +++ b/sd/source/ui/dlg/animobjs.cxx @@ -57,7 +57,7 @@ SdDisplay::SdDisplay(vcl::Window* pWin) : Control(pWin, 0) , aScale(1, 1) { - SetMapMode( MapUnit::MapPixel ); + SetMapMode(MapMode(MapUnit::MapPixel)); const StyleSettings& rStyles = Application::GetSettings().GetStyleSettings(); SetBackground( Wallpaper( Color( rStyles.GetFieldColor() ) ) ); } @@ -103,7 +103,7 @@ void SdDisplay::SetScale( const Fraction& rFrac ) Size SdDisplay::GetOptimalSize() const { - return LogicToPixel(Size(147, 87), MapUnit::MapAppFont); + return LogicToPixel(Size(147, 87), MapMode(MapUnit::MapAppFont)); } void SdDisplay::DataChanged( const DataChangedEvent& rDCEvt ) diff --git a/sd/source/ui/dlg/docprev.cxx b/sd/source/ui/dlg/docprev.cxx index 852f8a46f9d5..846b4f46207a 100644 --- a/sd/source/ui/dlg/docprev.cxx +++ b/sd/source/ui/dlg/docprev.cxx @@ -77,7 +77,7 @@ void SdDocPreviewWin::dispose() Size SdDocPreviewWin::GetOptimalSize() const { - return LogicToPixel(Size(122, 96), MapUnit::MapAppFont); + return LogicToPixel(Size(122, 96), MapMode(MapUnit::MapAppFont)); } void SdDocPreviewWin::Resize() diff --git a/sd/source/ui/dlg/headerfooterdlg.cxx b/sd/source/ui/dlg/headerfooterdlg.cxx index 04bf5617c443..ced53b446926 100644 --- a/sd/source/ui/dlg/headerfooterdlg.cxx +++ b/sd/source/ui/dlg/headerfooterdlg.cxx @@ -703,7 +703,7 @@ VCL_BUILDER_FACTORY(PresLayoutPreview) Size PresLayoutPreview::GetOptimalSize() const { - return LogicToPixel(Size(80, 80), MapUnit::MapAppFont); + return LogicToPixel(Size(80, 80), MapMode(MapUnit::MapAppFont)); } void PresLayoutPreview::init( SdPage *pMaster ) diff --git a/sd/source/ui/dlg/navigatr.cxx b/sd/source/ui/dlg/navigatr.cxx index c7c39e89f5fe..4552f262c7a1 100644 --- a/sd/source/ui/dlg/navigatr.cxx +++ b/sd/source/ui/dlg/navigatr.cxx @@ -74,7 +74,7 @@ SdNavigatorWin::SdNavigatorWin(vcl::Window* pParent, SfxBindings* pInBindings) { get(maToolbox, "toolbox"); get(maTlbObjects, "tree"); - Size aSize(maTlbObjects->LogicToPixel(Size(97, 67), MapUnit::MapAppFont)); + Size aSize(maTlbObjects->LogicToPixel(Size(97, 67), MapMode(MapUnit::MapAppFont))); maTlbObjects->set_height_request(aSize.Width()); maTlbObjects->set_width_request(aSize.Height()); get(maLbDocs, "documents"); diff --git a/sd/source/ui/dlg/sdpreslt.cxx b/sd/source/ui/dlg/sdpreslt.cxx index d4f7c4b80dff..094a93098931 100644 --- a/sd/source/ui/dlg/sdpreslt.cxx +++ b/sd/source/ui/dlg/sdpreslt.cxx @@ -41,7 +41,7 @@ SdPresLayoutDlg::SdPresLayoutDlg(::sd::DrawDocShell* pDocShell, , maStrNone(SdResId(STR_NULL)) { get(m_pVS, "select"); - Size aPref(LogicToPixel(Size(144 , 141), MapUnit::MapAppFont)); + Size aPref(LogicToPixel(Size(144 , 141), MapMode(MapUnit::MapAppFont))); m_pVS->set_width_request(aPref.Width()); m_pVS->set_height_request(aPref.Height()); get(m_pCbxMasterPage, "masterpage"); diff --git a/sd/source/ui/dlg/vectdlg.cxx b/sd/source/ui/dlg/vectdlg.cxx index 3b060bce16d6..5099ce6539a7 100644 --- a/sd/source/ui/dlg/vectdlg.cxx +++ b/sd/source/ui/dlg/vectdlg.cxx @@ -45,7 +45,7 @@ SdVectorizeDlg::SdVectorizeDlg(vcl::Window* pParent, const Bitmap& rBmp, ::sd::D get(m_pBmpWin, "source"); get(m_pMtfWin, "vectorized"); - Size aSize(LogicToPixel(Size(92, 100), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(92, 100), MapMode(MapUnit::MapAppFont))); m_pBmpWin->set_width_request(aSize.Width()); m_pMtfWin->set_width_request(aSize.Width()); m_pBmpWin->set_height_request(aSize.Height()); diff --git a/sd/source/ui/func/fuinsert.cxx b/sd/source/ui/func/fuinsert.cxx index 5280fb3de736..b5a363b141d9 100644 --- a/sd/source/ui/func/fuinsert.cxx +++ b/sd/source/ui/func/fuinsert.cxx @@ -370,14 +370,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) // rectangle with balanced edge ratio aSize.Width() = 14100; aSize.Height() = 10000; - Size aTmp = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aUnit ); + Size aTmp = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(aUnit)); aSz.Width = aTmp.Width(); aSz.Height = aTmp.Height(); xObj->setVisualAreaSize( nAspect, aSz ); } else { - aSize = OutputDevice::LogicToLogic(aSize, aUnit, MapUnit::Map100thMM); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(aUnit), MapMode(MapUnit::Map100thMM)); } Point aPos; @@ -433,7 +433,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) } pOleObj->SetLogicRect(aRect); - Size aTmp( OutputDevice::LogicToLogic( aRect.GetSize(), MapUnit::Map100thMM, aUnit ) ); + Size aTmp( OutputDevice::LogicToLogic(aRect.GetSize(), MapMode(MapUnit::Map100thMM), MapMode(aUnit)) ); awt::Size aVisualSize; aVisualSize.Width = aTmp.Width(); aVisualSize.Height = aTmp.Height(); @@ -546,14 +546,14 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) // rectangle with balanced edge ratio aSize.Width() = 14100; aSize.Height() = 10000; - Size aTmp = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aMapUnit ); + Size aTmp = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(aMapUnit)); aSz.Width = aTmp.Width(); aSz.Height = aTmp.Height(); xObj->setVisualAreaSize( nAspect, aSz ); } else { - aSize = OutputDevice::LogicToLogic(aSize, aMapUnit, MapUnit::Map100thMM); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(aMapUnit), MapMode(MapUnit::Map100thMM)); } } @@ -589,7 +589,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) } else { - Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MapUnit::Map100thMM, aMapUnit ); + Size aTmp = OutputDevice::LogicToLogic(aRect.GetSize(), MapMode(MapUnit::Map100thMM), MapMode(aMapUnit)); awt::Size aSz( aTmp.Width(), aTmp.Height() ); xObj->setVisualAreaSize( nAspect, aSz ); } @@ -649,7 +649,7 @@ void FuInsertOLE::DoExecute( SfxRequest& rReq ) if ( nAspect != embed::Aspects::MSOLE_ICON ) { - Size aTmp = OutputDevice::LogicToLogic( aRect.GetSize(), MapUnit::Map100thMM, aMapUnit ); + Size aTmp = OutputDevice::LogicToLogic(aRect.GetSize(), MapMode(MapUnit::Map100thMM), MapMode(aMapUnit)); awt::Size aSz( aTmp.Width(), aTmp.Height() ); xObj->setVisualAreaSize( nAspect, aSz ); } @@ -737,9 +737,9 @@ void FuInsertAVMedia::DoExecute( SfxRequest& rReq ) if( aPrefSize.Width() && aPrefSize.Height() ) { if( mpWindow ) - aSize = mpWindow->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); + aSize = mpWindow->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM)); else - aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); + aSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM)); } else aSize = Size( 5000, 5000 ); @@ -823,9 +823,9 @@ void FuInsert3DModel::DoExecute( SfxRequest& ) Size aSize(480,360); if( mpWindow ) - aSize = mpWindow->PixelToLogic( aSize, MapUnit::Map100thMM ); + aSize = mpWindow->PixelToLogic(aSize, MapMode(MapUnit::Map100thMM)); else - aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, MapUnit::Map100thMM ); + aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, MapMode(MapUnit::Map100thMM)); if( mpWindow ) { diff --git a/sd/source/ui/presenter/PresenterHelper.cxx b/sd/source/ui/presenter/PresenterHelper.cxx index 87b0928d6796..71f85ad3102b 100644 --- a/sd/source/ui/presenter/PresenterHelper.cxx +++ b/sd/source/ui/presenter/PresenterHelper.cxx @@ -93,7 +93,7 @@ Reference<awt::XWindow> SAL_CALL PresenterHelper::createWindow ( pWindow->Show(bInitiallyVisible); - pWindow->SetMapMode(MapUnit::MapPixel); + pWindow->SetMapMode(MapMode(MapUnit::MapPixel)); pWindow->SetBackground(); if ( ! bEnableParentClip) { diff --git a/sd/source/ui/presenter/PresenterTextView.cxx b/sd/source/ui/presenter/PresenterTextView.cxx index 6a001902d173..4b8494078a5a 100644 --- a/sd/source/ui/presenter/PresenterTextView.cxx +++ b/sd/source/ui/presenter/PresenterTextView.cxx @@ -240,7 +240,7 @@ PresenterTextView::Implementation::Implementation() mnTop(0), mnTotalHeight(-1) { - mpOutputDevice->SetMapMode(MapUnit::MapPixel); + mpOutputDevice->SetMapMode(MapMode(MapUnit::MapPixel)); mpEditEngine = CreateEditEngine (); } @@ -312,7 +312,7 @@ EditEngine* PresenterTextView::Implementation::CreateEditEngine() EEControlBits(~EEControlBits::PASTESPECIAL) ); pEditEngine->SetWordDelimiters (" .=+-*/(){}[];\""); - pEditEngine->SetRefMapMode (MapUnit::MapPixel); + pEditEngine->SetRefMapMode(MapMode(MapUnit::MapPixel)); pEditEngine->SetPaperSize (Size(800, 0)); pEditEngine->EraseVirtualDevice(); pEditEngine->ClearModifyFlag(); @@ -436,7 +436,7 @@ Reference<rendering::XBitmap> const & PresenterTextView::Implementation::GetBitm mpOutputDevice.disposeAndClear(); mpOutputDevice = VclPtr<VirtualDevice>::Create(*Application::GetDefaultDevice(), DeviceFormat::DEFAULT, DeviceFormat::DEFAULT); - mpOutputDevice->SetMapMode(MapUnit::MapPixel); + mpOutputDevice->SetMapMode(MapMode(MapUnit::MapPixel)); mpOutputDevice->SetOutputSizePixel(maSize); mpOutputDevice->SetLineColor(); mpOutputDevice->SetFillColor(); diff --git a/sd/source/ui/slideshow/showwin.cxx b/sd/source/ui/slideshow/showwin.cxx index add43b39e195..b70234500935 100644 --- a/sd/source/ui/slideshow/showwin.cxx +++ b/sd/source/ui/slideshow/showwin.cxx @@ -451,8 +451,8 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) const MapMode& rMap = GetMapMode(); const Point aOutOrg( PixelToLogic( Point() ) ); const Size aOutSize( GetOutputSize() ); - const Size aTextSize( LogicToLogic( Size( 0, 14 ), MapUnit::MapPoint, rMap ) ); - const Size aOffset( LogicToLogic( Size( 1000, 1000 ), MapUnit::Map100thMM, rMap ) ); + const Size aTextSize(LogicToLogic(Size(0, 14), MapMode(MapUnit::MapPoint), rMap)); + const Size aOffset(LogicToLogic(Size(1000, 1000), MapMode(MapUnit::Map100thMM), rMap)); OUString aText( SdResId( STR_PRES_PAUSE ) ); bool bDrawn = false; @@ -468,7 +468,7 @@ void ShowWindow::DrawPauseScene( bool bTimeoutOnly ) { Size aGrfSize; - if( maLogo.GetPrefMapMode() == MapUnit::MapPixel ) + if (maLogo.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel) aGrfSize = PixelToLogic( maLogo.GetPrefSize() ); else aGrfSize = LogicToLogic( maLogo.GetPrefSize(), maLogo.GetPrefMapMode(), rMap ); @@ -525,7 +525,7 @@ void ShowWindow::DrawEndScene() vcl::Font aFont( GetSettings().GetStyleSettings().GetMenuFont() ); const Point aOutOrg( PixelToLogic( Point() ) ); - const Size aTextSize( LogicToLogic( Size( 0, 14 ), MapUnit::MapPoint, GetMapMode() ) ); + const Size aTextSize(LogicToLogic(Size(0, 14), MapMode(MapUnit::MapPoint), GetMapMode())); const OUString aText( SdResId( STR_PRES_SOFTEND ) ); aFont.SetFontSize( aTextSize ); diff --git a/sd/source/ui/unoidl/unomodel.cxx b/sd/source/ui/unoidl/unomodel.cxx index 74c379fed0c3..3bcc1c0f3db9 100644 --- a/sd/source/ui/unoidl/unomodel.cxx +++ b/sd/source/ui/unoidl/unomodel.cxx @@ -1915,7 +1915,7 @@ void SAL_CALL SdXImpressDocument::render( sal_Int32 nRenderer, const uno::Any& r pView->SetPageVisible( false ); pView->SetGlueVisible( false ); - pOut->SetMapMode( MapUnit::Map100thMM ); + pOut->SetMapMode(MapMode(MapUnit::Map100thMM)); pOut->IntersectClipRegion( aVisArea ); uno::Reference< frame::XModel > xModel; diff --git a/sd/source/ui/unoidl/unopage.cxx b/sd/source/ui/unoidl/unopage.cxx index 93f76f6cf57f..60a6e7bb07ca 100644 --- a/sd/source/ui/unoidl/unopage.cxx +++ b/sd/source/ui/unoidl/unopage.cxx @@ -1122,7 +1122,7 @@ Any SAL_CALL SdGenericDrawPage::getPropertyValue( const OUString& PropertyName ) Size aSize( GetPage()->GetSize() ); xMetaFile->AddAction( static_cast<MetaAction*>(new MetaFillColorAction( COL_WHITE, true )), 0 ); xMetaFile->AddAction( static_cast<MetaAction*>(new MetaRectAction( ::tools::Rectangle( aPoint, aSize ) )), 1 ); - xMetaFile->SetPrefMapMode( MapUnit::Map100thMM ); + xMetaFile->SetPrefMapMode(MapMode(MapUnit::Map100thMM)); xMetaFile->SetPrefSize( aSize ); SvMemoryStream aDestStrm( 65535, 65535 ); diff --git a/sd/source/ui/view/Outliner.cxx b/sd/source/ui/view/Outliner.cxx index 9d9a2663ee53..22ab4facd0ae 100644 --- a/sd/source/ui/view/Outliner.cxx +++ b/sd/source/ui/view/Outliner.cxx @@ -804,7 +804,7 @@ bool SdOutliner::SearchAndReplaceOnce(std::vector<sd::SearchSelection>* pSelecti { for (tools::Rectangle& rRectangle : aLogicRects) { - rRectangle = OutputDevice::LogicToLogic(rRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); + rRectangle = OutputDevice::LogicToLogic(rRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); } } diff --git a/sd/source/ui/view/ViewShellBase.cxx b/sd/source/ui/view/ViewShellBase.cxx index 8f72f80b558d..f7d7a02538bf 100644 --- a/sd/source/ui/view/ViewShellBase.cxx +++ b/sd/source/ui/view/ViewShellBase.cxx @@ -464,7 +464,7 @@ void ViewShellBase::InnerResizePixel (const Point& rOrigin, const Size &rSize, b Size aSize( rSize ); aSize.Width() -= (aBorder.Left() + aBorder.Right()); aSize.Height() -= (aBorder.Top() + aBorder.Bottom()); - Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel( aObjSize, MapUnit::Map100thMM ); + Size aObjSizePixel = mpImpl->mpViewWindow->LogicToPixel(aObjSize, MapMode(MapUnit::Map100thMM)); SfxViewShell::SetZoomFactor( Fraction( aSize.Width(), std::max( aObjSizePixel.Width(), (long int)1 ) ), Fraction( aSize.Height(), std::max( aObjSizePixel.Height(), (long int)1) ) ); @@ -1004,7 +1004,7 @@ void ViewShellBase::NotifyCursor(SfxViewShell* pOtherShell) const ::tools::Rectangle aRectangle = pOutlinerView->GetOutputArea(); vcl::Window* pWin = pThisShell->GetActiveWindow(); if (pWin && pWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); OString sRectangle = aRectangle.toString(); SfxLokHelper::notifyOtherView(&pDrawViewShell->GetViewShellBase(), pOtherShell, LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle); } diff --git a/sd/source/ui/view/sdview.cxx b/sd/source/ui/view/sdview.cxx index 62d84df6d8b2..24cde44a6dd8 100644 --- a/sd/source/ui/view/sdview.cxx +++ b/sd/source/ui/view/sdview.cxx @@ -703,7 +703,7 @@ bool View::SdrBeginTextEdit( { ::tools::Rectangle aRectangle = pView->GetOutputArea(); if (pWin && pWin->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); OString sRectangle = aRectangle.toString(); SfxLokHelper::notifyOtherViews(&mpViewSh->GetViewShellBase(), LOK_CALLBACK_VIEW_LOCK, "rectangle", sRectangle); } @@ -879,7 +879,7 @@ void View::SetMarkedOriginalSize() try { awt::Size aSz = xObj->getVisualAreaSize( nAspect ); - aOleSize = OutputDevice::LogicToLogic( Size( aSz.Width, aSz.Height ), aUnit, MapUnit::Map100thMM ); + aOleSize = OutputDevice::LogicToLogic(Size(aSz.Width, aSz.Height), MapMode(aUnit), MapMode(MapUnit::Map100thMM)); bOK = true; } catch( embed::NoVisualAreaSizeException& ) diff --git a/sd/source/ui/view/sdview3.cxx b/sd/source/ui/view/sdview3.cxx index ca02e197d0e6..00a6456edc8c 100644 --- a/sd/source/ui/view/sdview3.cxx +++ b/sd/source/ui/view/sdview3.cxx @@ -959,7 +959,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( aObjDesc.mnViewAspect ) ); if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() ) { - Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MapUnit::Map100thMM, aMapUnit ) ); + Size aTmp(OutputDevice::LogicToLogic(aObjDesc.maSize, MapMode(MapUnit::Map100thMM), MapMode(aMapUnit))); aSz.Width = aTmp.Width(); aSz.Height = aTmp.Height(); xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); @@ -980,13 +980,13 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, { aSize.Width() = 14100; aSize.Height() = 10000; - aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MapUnit::Map100thMM, aMapUnit ); + aSize = OutputDevice::LogicToLogic(Size(14100, 10000), MapMode(MapUnit::Map100thMM), MapMode(aMapUnit)); aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); } - aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MapUnit::Map100thMM ); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(aMapUnit), MapMode(MapUnit::Map100thMM)); } Size aMaxSize( mrDoc.GetMaxObjSize() ); @@ -1137,7 +1137,7 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( aObjDesc.maSize.Width() && aObjDesc.maSize.Height() ) { - Size aTmp( OutputDevice::LogicToLogic( aObjDesc.maSize, MapUnit::Map100thMM, aMapUnit ) ); + Size aTmp(OutputDevice::LogicToLogic(aObjDesc.maSize, MapMode(MapUnit::Map100thMM), MapMode(aMapUnit))); if ( aSz.Width != aTmp.Width() || aSz.Height != aTmp.Height() ) { aSz.Width = aTmp.Width(); @@ -1150,13 +1150,13 @@ bool View::InsertData( const TransferableDataHelper& rDataHelper, if( !aSize.Width() || !aSize.Height() ) { - aSize = OutputDevice::LogicToLogic( Size(14100, 10000), MapUnit::Map100thMM, aMapUnit ); + aSize = OutputDevice::LogicToLogic(Size(14100, 10000), MapMode(MapUnit::Map100thMM), MapMode(aMapUnit)); aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); xObj->setVisualAreaSize( aObjDesc.mnViewAspect, aSz ); } - aSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MapUnit::Map100thMM ); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(aMapUnit), MapMode(MapUnit::Map100thMM)); } Size aMaxSize( mrDoc.GetMaxObjSize() ); diff --git a/sd/source/ui/view/sdview4.cxx b/sd/source/ui/view/sdview4.cxx index 1754238355cd..c0968405aa52 100644 --- a/sd/source/ui/view/sdview4.cxx +++ b/sd/source/ui/view/sdview4.cxx @@ -182,7 +182,7 @@ SdrGrafObj* View::InsertGraphic( const Graphic& rGraphic, sal_Int8& rAction, pOutDev = Application::GetDefaultDevice(); if( pOutDev ) - aSize = pOutDev->PixelToLogic( rGraphic.GetPrefSize(), MapUnit::Map100thMM ); + aSize = pOutDev->PixelToLogic(rGraphic.GetPrefSize(), MapMode(MapUnit::Map100thMM)); } else { @@ -496,9 +496,9 @@ IMPL_LINK_NOARG(View, DropInsertFileHdl, Timer *, void) ::sd::Window* pWin = mpViewSh->GetActiveWindow(); if( pWin ) - aPrefSize = pWin->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); + aPrefSize = pWin->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM)); else - aPrefSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM)); } else aPrefSize = Size( 5000, 5000 ); diff --git a/sd/source/ui/view/sdwindow.cxx b/sd/source/ui/view/sdwindow.cxx index 7ddbcfccd712..c46be7b78302 100644 --- a/sd/source/ui/view/sdwindow.cxx +++ b/sd/source/ui/view/sdwindow.cxx @@ -1008,7 +1008,7 @@ void Window::LogicInvalidate(const ::tools::Rectangle* pRectangle) { ::tools::Rectangle aRectangle(*pRectangle); if (GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aRectangle = OutputDevice::LogicToLogic(aRectangle, MapUnit::Map100thMM, MapUnit::MapTwip); + aRectangle = OutputDevice::LogicToLogic(aRectangle, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); sRectangle = aRectangle.toString(); } SfxViewShell& rSfxViewShell = mpViewShell->GetViewShellBase(); diff --git a/sfx2/source/appl/newhelp.cxx b/sfx2/source/appl/newhelp.cxx index 4b8e33a2d980..93ea92fe6d08 100644 --- a/sfx2/source/appl/newhelp.cxx +++ b/sfx2/source/appl/newhelp.cxx @@ -434,7 +434,7 @@ ContentTabPage_Impl::ContentTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindo "sfx/ui/helpcontentpage.ui") { get(m_pContentBox, "content"); - Size aSize(LogicToPixel(Size(108 , 188), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(108 , 188), MapMode(MapUnit::MapAppFont))); m_pContentBox->set_width_request(aSize.Width()); m_pContentBox->set_height_request(aSize.Height()); } @@ -542,7 +542,7 @@ IndexTabPage_Impl::IndexTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_Im , bIsActivated(false) { get(m_pIndexCB, "terms"); - Size aSize(LogicToPixel(Size(108, 97), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(108, 97), MapMode(MapUnit::MapAppFont))); m_pIndexCB->set_width_request(aSize.Width()); m_pIndexCB->set_height_request(aSize.Height()); get(m_pOpenBtn, "display"); @@ -912,7 +912,7 @@ SearchTabPage_Impl::SearchTabPage_Impl(vcl::Window* pParent, SfxHelpIndexWindow_ get(m_pFullWordsCB, "completewords"); get(m_pScopeCB, "headings"); get(m_pResultsLB, "results"); - Size aSize(LogicToPixel(Size(128 , 30), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(128 , 30), MapMode(MapUnit::MapAppFont))); m_pResultsLB->set_width_request(aSize.Width()); m_pResultsLB->set_height_request(aSize.Height()); get(m_pOpenBtn, "display"); @@ -1271,7 +1271,7 @@ BookmarksTabPage_Impl::BookmarksTabPage_Impl(vcl::Window* pParent, SfxHelpIndexW { get(m_pBookmarksPB, "display"); get(m_pBookmarksBox, "bookmarks"); - Size aSize(LogicToPixel(Size(120 , 200), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(120 , 200), MapMode(MapUnit::MapAppFont))); m_pBookmarksBox->set_width_request(aSize.Width()); m_pBookmarksBox->set_height_request(aSize.Height()); @@ -1870,7 +1870,7 @@ SfxHelpTextWindow_Impl::SfxHelpTextWindow_Impl( SfxHelpWindow_Impl* pParent ) : bIsInClose ( false ), bIsFullWordSearch ( false ) { - aOnStartupCB->SetSizePixel(aOnStartupCB->PixelToLogic(Size(200, 10), MapUnit::MapAppFont)); + aOnStartupCB->SetSizePixel(aOnStartupCB->PixelToLogic(Size(200, 10), MapMode(MapUnit::MapAppFont))); sfx2::AddToTaskPaneList( aToolBox.get() ); @@ -2069,7 +2069,7 @@ void SfxHelpTextWindow_Impl::InitOnStartupBox() } // set position of the checkbox - Size a3Size = LogicToPixel( Size( 3, 3 ), MapUnit::MapAppFont ); + Size a3Size = LogicToPixel(Size(3, 3), MapMode(MapUnit::MapAppFont)); Size aTBSize = aToolBox->GetSizePixel(); Size aCBSize = aOnStartupCB->GetSizePixel(); Point aPnt = aToolBox->GetPosPixel(); @@ -2944,7 +2944,7 @@ SfxHelpWindow_Impl::SfxHelpWindow_Impl( pIndexWin = VclPtr<SfxHelpIndexWindow_Impl>::Create( this ); pIndexWin->SetDoubleClickHdl( LINK( this, SfxHelpWindow_Impl, OpenHdl ) ); pIndexWin->SetSelectFactoryHdl( LINK( this, SfxHelpWindow_Impl, SelectFactoryHdl ) ); - pIndexWin->SetSizePixel(LogicToPixel(Size(120, 200), MapUnit::MapAppFont)); + pIndexWin->SetSizePixel(LogicToPixel(Size(120, 200), MapMode(MapUnit::MapAppFont))); pIndexWin->Show(); pTextWin = VclPtr<SfxHelpTextWindow_Impl>::Create( this ); Reference < XFrames > xFrames = rFrame->getFrames(); diff --git a/sfx2/source/dialog/dialoghelper.cxx b/sfx2/source/dialog/dialoghelper.cxx index aaea7e22c1a8..89f5124d9c97 100644 --- a/sfx2/source/dialog/dialoghelper.cxx +++ b/sfx2/source/dialog/dialoghelper.cxx @@ -55,12 +55,12 @@ void setPreviewsToSamePlace(vcl::Window const *pParent, VclBuilderContainer *pPa Size getParagraphPreviewOptimalSize(const vcl::Window *pReference) { - return pReference->LogicToPixel(Size(68 , 112), MapUnit::MapAppFont); + return pReference->LogicToPixel(Size(68 , 112), MapMode(MapUnit::MapAppFont)); } Size getDrawPreviewOptimalSize(const vcl::Window *pReference) { - return pReference->LogicToPixel(Size(88, 42), MapUnit::MapAppFont); + return pReference->LogicToPixel(Size(88, 42), MapMode(MapUnit::MapAppFont)); } Size getPreviewStripSize(const vcl::Window *pReference) diff --git a/sfx2/source/dialog/dinfdlg.cxx b/sfx2/source/dialog/dinfdlg.cxx index 665de8babec5..24d6f9648382 100644 --- a/sfx2/source/dialog/dinfdlg.cxx +++ b/sfx2/source/dialog/dinfdlg.cxx @@ -1387,8 +1387,8 @@ void CustomPropertiesYesNoButton::Resize() { Size aParentSize(GetSizePixel()); const long nWidth = aParentSize.Width(); - const long n1Width = LogicToPixel(Size(1, 1), MapUnit::MapAppFont).Width(); - const long n3Width = LogicToPixel(Size(3, 3), MapUnit::MapAppFont).Width(); + const long n1Width = LogicToPixel(Size(1, 1), MapMode(MapUnit::MapAppFont)).Width(); + const long n3Width = LogicToPixel(Size(3, 3), MapMode(MapUnit::MapAppFont)).Width(); const long nNewWidth = (nWidth / 2) - n3Width - 2; Size aSize(nNewWidth, m_aYesButton->get_preferred_size().Height()); Point aPos(n1Width, (aParentSize.Height() - aSize.Height()) / 2); @@ -1517,7 +1517,7 @@ CustomPropertiesWindow::CustomPropertiesWindow(vcl::Window* pParent, m_nTypeBoxWidth = aSize.Width(); m_nWidgetHeight = aSize.Height(); - Point aPos(LogicToPixel(Point(0, 2), MapUnit::MapAppFont)); + Point aPos(LogicToPixel(Point(0, 2), MapMode(MapUnit::MapAppFont))); m_aEditLoseFocusIdle.SetPriority( TaskPriority::LOWEST ); m_aEditLoseFocusIdle.SetInvokeHandler( LINK( this, CustomPropertiesWindow, EditTimeoutHdl ) ); @@ -1962,7 +1962,7 @@ CustomPropertiesControl::CustomPropertiesControl(vcl::Window* pParent) , m_pVertScroll(nullptr) , m_nThumbPos(0) { - Size aRequest(LogicToPixel(Size(320, 141), MapUnit::MapAppFont)); + Size aRequest(LogicToPixel(Size(320, 141), MapMode(MapUnit::MapAppFont))); set_width_request(aRequest.Width()); } diff --git a/sfx2/source/dialog/versdlg.cxx b/sfx2/source/dialog/versdlg.cxx index 5e4792aa88a8..5f32f12cc6a3 100644 --- a/sfx2/source/dialog/versdlg.cxx +++ b/sfx2/source/dialog/versdlg.cxx @@ -207,7 +207,7 @@ SfxVersionDialog::SfxVersionDialog ( SfxViewFrame* pVwFrame, bool bIsSaveVersion SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("versions"); Size aControlSize(260, 114); - aControlSize = pContainer->LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = pContainer->LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pContainer->set_width_request(aControlSize.Width()); pContainer->set_height_request(aControlSize.Height()); @@ -538,7 +538,7 @@ SfxCmisVersionsDialog::SfxCmisVersionsDialog ( SfxViewFrame* pVwFrame ) SvSimpleTableContainer *pContainer = get<SvSimpleTableContainer>("versions"); Size aControlSize(260, 114); - aControlSize = pContainer->LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = pContainer->LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pContainer->set_width_request(aControlSize.Width()); pContainer->set_height_request(aControlSize.Height()); diff --git a/sfx2/source/doc/new.cxx b/sfx2/source/doc/new.cxx index 604fb0a58f18..f750dada8395 100644 --- a/sfx2/source/doc/new.cxx +++ b/sfx2/source/doc/new.cxx @@ -63,7 +63,7 @@ void SfxPreviewBase_Impl::Resize() Size SfxPreviewBase_Impl::GetOptimalSize() const { - return LogicToPixel(Size(127, 129), MapUnit::MapAppFont); + return LogicToPixel(Size(127, 129), MapMode(MapUnit::MapAppFont)); } void SfxPreviewWin_Impl::ImpPaint(vcl::RenderContext& rRenderContext, GDIMetaFile* pFile) @@ -348,7 +348,7 @@ SfxNewFileDialog_Impl::SfxNewFileDialog_Impl( pAntiImplP->get(m_pRegionLb, "categories"); pAntiImplP->get(m_pTemplateLb, "templates"); - Size aSize(m_pRegionLb->LogicToPixel(Size(127, 72), MapUnit::MapAppFont)); + Size aSize(m_pRegionLb->LogicToPixel(Size(127, 72), MapMode(MapUnit::MapAppFont))); m_pRegionLb->set_width_request(aSize.Width()); m_pRegionLb->set_height_request(aSize.Height()); m_pTemplateLb->set_width_request(aSize.Width()); diff --git a/sfx2/source/doc/objembed.cxx b/sfx2/source/doc/objembed.cxx index 7c9763b1aa8b..e4164e63a010 100644 --- a/sfx2/source/doc/objembed.cxx +++ b/sfx2/source/doc/objembed.cxx @@ -99,7 +99,7 @@ tools::Rectangle SfxObjectShell::GetVisArea( sal_uInt16 nAspect ) const { tools::Rectangle aRect; aRect.SetSize( OutputDevice::LogicToLogic( Size( 5000, 5000 ), - MapUnit::Map100thMM, GetMapUnit() ) ); + MapMode(MapUnit::Map100thMM), MapMode(GetMapUnit()))); return aRect; } return tools::Rectangle(); @@ -154,7 +154,7 @@ void SfxObjectShell::FillTransferableObjectDescriptor( TransferableObjectDescrip FillClass( &rDesc.maClassName, &nClipFormat, &aAppName, &rDesc.maTypeName, &aShortName, SOFFICE_FILEFORMAT_CURRENT ); rDesc.mnViewAspect = ASPECT_CONTENT; - rDesc.maSize = OutputDevice::LogicToLogic( GetVisArea().GetSize(), GetMapUnit(), MapUnit::Map100thMM ); + rDesc.maSize = OutputDevice::LogicToLogic(GetVisArea().GetSize(), MapMode(GetMapUnit()), MapMode(MapUnit::Map100thMM)); rDesc.maDragStartPos = Point(); rDesc.maDisplayName.clear(); } diff --git a/sfx2/source/doc/printhelper.cxx b/sfx2/source/doc/printhelper.cxx index e5c85169c7c9..e255b4ee87ea 100644 --- a/sfx2/source/doc/printhelper.cxx +++ b/sfx2/source/doc/printhelper.cxx @@ -432,7 +432,7 @@ void SfxPrintHelper::impl_setPrinter(const uno::Sequence< beans::PropertyValue > { // Bug 56929 - MapMode of 100mm which recalculated when // the device is set. Additionally only set if they were really changed. - aSetPaperSize = pPrinter->LogicToPixel( aSetPaperSize, MapUnit::Map100thMM ); + aSetPaperSize = pPrinter->LogicToPixel(aSetPaperSize, MapMode(MapUnit::Map100thMM)); if( aSetPaperSize != pPrinter->GetPaperSizePixel() ) { pPrinter->SetPaperSizeUser( pPrinter->PixelToLogic( aSetPaperSize ) ); diff --git a/sfx2/source/doc/sfxbasemodel.cxx b/sfx2/source/doc/sfxbasemodel.cxx index 0e3fbef0ec85..56ab68ea97df 100644 --- a/sfx2/source/doc/sfxbasemodel.cxx +++ b/sfx2/source/doc/sfxbasemodel.cxx @@ -865,7 +865,7 @@ sal_Bool SAL_CALL SfxBaseModel::attachResource( const OUString& if ( ( aArgs.get( "WinExtent" ) >>= aWinExtent )&& ( aWinExtent.getLength() == 4 ) ) { tools::Rectangle aVisArea( aWinExtent[0], aWinExtent[1], aWinExtent[2], aWinExtent[3] ); - aVisArea = OutputDevice::LogicToLogic( aVisArea, MapUnit::Map100thMM, pObjectShell->GetMapUnit() ); + aVisArea = OutputDevice::LogicToLogic(aVisArea, MapMode(MapUnit::Map100thMM), MapMode(pObjectShell->GetMapUnit())); pObjectShell->SetVisArea( aVisArea ); } @@ -956,7 +956,7 @@ Sequence< beans::PropertyValue > SAL_CALL SfxBaseModel::getArgs() // We can store it now to overwrite an old value // since it is not from ItemSet tools::Rectangle aTmpRect = m_pData->m_pObjectShell->GetVisArea( ASPECT_CONTENT ); - aTmpRect = OutputDevice::LogicToLogic( aTmpRect, m_pData->m_pObjectShell->GetMapUnit(), MapUnit::Map100thMM ); + aTmpRect = OutputDevice::LogicToLogic(aTmpRect, MapMode(m_pData->m_pObjectShell->GetMapUnit()), MapMode(MapUnit::Map100thMM)); Sequence< sal_Int32 > aRectSeq(4); aRectSeq[0] = aTmpRect.Left(); @@ -1892,7 +1892,7 @@ Any SAL_CALL SfxBaseModel::getTransferData( const datatransfer::DataFlavor& aFla Size aSize = m_pData->m_pObjectShell->GetVisArea().GetSize(); MapUnit aMapUnit = m_pData->m_pObjectShell->GetMapUnit(); - aDesc.maSize = OutputDevice::LogicToLogic( aSize, aMapUnit, MapUnit::Map100thMM ); + aDesc.maSize = OutputDevice::LogicToLogic(aSize, MapMode(aMapUnit), MapMode(MapUnit::Map100thMM)); aDesc.maDragStartPos = Point(); aDesc.maDisplayName.clear(); diff --git a/sfx2/source/sidebar/SidebarChildWindow.cxx b/sfx2/source/sidebar/SidebarChildWindow.cxx index c9bc920ca277..7153c1d461b1 100644 --- a/sfx2/source/sidebar/SidebarChildWindow.cxx +++ b/sfx2/source/sidebar/SidebarChildWindow.cxx @@ -70,7 +70,7 @@ sal_Int32 SidebarChildWindow::GetDefaultWidth (vcl::Window const * pWindow) // Width of the paragraph panel. const static sal_Int32 nMaxPropertyPageWidth(146); - return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MapUnit::MapAppFont).X() + return pWindow->LogicToPixel(Point(nMaxPropertyPageWidth,1), MapMode(MapUnit::MapAppFont)).X() + TabBar::GetDefaultWidth() * pWindow->GetDPIScaleFactor(); } else diff --git a/sfx2/source/view/classificationcontroller.cxx b/sfx2/source/view/classificationcontroller.cxx index 1efdb2fd523f..d334eca23688 100644 --- a/sfx2/source/view/classificationcontroller.cxx +++ b/sfx2/source/view/classificationcontroller.cxx @@ -281,7 +281,7 @@ void ClassificationControl::SetOptimalSize() { // Same as SvxColorDockingWindow. const Size aLogicalAttrSize(150, 0); - Size aSize(LogicToPixel(aLogicalAttrSize,MapUnit::MapAppFont)); + Size aSize(LogicToPixel(aLogicalAttrSize, MapMode(MapUnit::MapAppFont))); Point aPosition = m_pCategory->GetPosPixel(); diff --git a/slideshow/source/engine/rehearsetimingsactivity.cxx b/slideshow/source/engine/rehearsetimingsactivity.cxx index 0781a4eea247..dcb6fff399aa 100644 --- a/slideshow/source/engine/rehearsetimingsactivity.cxx +++ b/slideshow/source/engine/rehearsetimingsactivity.cxx @@ -161,7 +161,7 @@ RehearseTimingsActivity::RehearseTimingsActivity( const SlideShowContext& rConte ScopedVclPtrInstance< VirtualDevice > blackHole; blackHole->EnableOutput(false); blackHole->SetFont( maFont ); - blackHole->SetMapMode( MapUnit::MapPixel ); + blackHole->SetMapMode(MapMode(MapUnit::MapPixel)); tools::Rectangle rect; const FontMetric metric( blackHole->GetFontMetric() ); blackHole->GetTextBoundRect( rect, "XX:XX:XX" ); @@ -437,7 +437,7 @@ void RehearseTimingsActivity::paint( cppcanvas::CanvasSharedPtr const & canvas ) metaFile.Record( blackHole ); metaFile.SetPrefSize( Size( 1, 1 ) ); blackHole->EnableOutput(false); - blackHole->SetMapMode( MapUnit::MapPixel ); + blackHole->SetMapMode(MapMode(MapUnit::MapPixel)); blackHole->SetFont( maFont ); tools::Rectangle rect = tools::Rectangle( 0,0, maSpriteSizePixel.getX(), diff --git a/starmath/source/ElementsDockingWindow.cxx b/starmath/source/ElementsDockingWindow.cxx index d40e1606e2c6..9ddf2d21f5c6 100644 --- a/starmath/source/ElementsDockingWindow.cxx +++ b/starmath/source/ElementsDockingWindow.cxx @@ -529,7 +529,7 @@ void SmElementsControl::addElement(const OUString& aElementVisual, const OUStrin pNode->SetSize(Fraction(10,8)); pNode->Arrange(*this, maFormat); - Size aSizePixel = LogicToPixel(Size(pNode->GetWidth(), pNode->GetHeight()), MapUnit::Map100thMM); + Size aSizePixel = LogicToPixel(Size(pNode->GetWidth(), pNode->GetHeight()), MapMode(MapUnit::Map100thMM)); if (aSizePixel.Width() > maMaxElementDimensions.Width()) { maMaxElementDimensions.Width() = aSizePixel.Width(); } diff --git a/starmath/source/accessibility.cxx b/starmath/source/accessibility.cxx index f2d0f1b8655d..c7e7ad737c60 100644 --- a/starmath/source/accessibility.cxx +++ b/starmath/source/accessibility.cxx @@ -825,7 +825,7 @@ tools::Rectangle SmViewForwarder::GetVisArea() const MapMode aMapMode(pOutDev->GetMapMode()); aVisArea = OutputDevice::LogicToLogic( aVisArea, pEditEngine->GetRefMapMode(), - aMapMode.GetMapUnit() ); + MapMode(aMapMode.GetMapUnit())); aMapMode.SetOrigin(Point()); return pOutDev->LogicToPixel( aVisArea, aMapMode ); } @@ -843,7 +843,7 @@ Point SmViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMapMod { MapMode aMapMode(pOutDev->GetMapMode()); Point aPoint( OutputDevice::LogicToLogic( rPoint, rMapMode, - aMapMode.GetMapUnit() ) ); + MapMode(aMapMode.GetMapUnit())) ); aMapMode.SetOrigin(Point()); return pOutDev->LogicToPixel( aPoint, aMapMode ); } @@ -862,7 +862,7 @@ Point SmViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMapMod aMapMode.SetOrigin(Point()); Point aPoint( pOutDev->PixelToLogic( rPoint, aMapMode ) ); return OutputDevice::LogicToLogic( aPoint, - aMapMode.GetMapUnit(), + MapMode(aMapMode.GetMapUnit()), rMapMode ); } @@ -1431,7 +1431,7 @@ tools::Rectangle SmEditViewForwarder::GetVisArea() const MapMode aMapMode(pOutDev->GetMapMode()); aVisArea = OutputDevice::LogicToLogic( aVisArea, pEditEngine->GetRefMapMode(), - aMapMode.GetMapUnit() ); + MapMode(aMapMode.GetMapUnit())); aMapMode.SetOrigin(Point()); aRect = pOutDev->LogicToPixel( aVisArea, aMapMode ); } @@ -1449,7 +1449,7 @@ Point SmEditViewForwarder::LogicToPixel( const Point& rPoint, const MapMode& rMa { MapMode aMapMode(pOutDev->GetMapMode()); Point aPoint( OutputDevice::LogicToLogic( rPoint, rMapMode, - aMapMode.GetMapUnit() ) ); + MapMode(aMapMode.GetMapUnit()))); aMapMode.SetOrigin(Point()); return pOutDev->LogicToPixel( aPoint, aMapMode ); } @@ -1468,7 +1468,7 @@ Point SmEditViewForwarder::PixelToLogic( const Point& rPoint, const MapMode& rMa aMapMode.SetOrigin(Point()); Point aPoint( pOutDev->PixelToLogic( rPoint, aMapMode ) ); return OutputDevice::LogicToLogic( aPoint, - aMapMode.GetMapUnit(), + MapMode(aMapMode.GetMapUnit()), rMapMode ); } diff --git a/starmath/source/document.cxx b/starmath/source/document.cxx index 1baf0339b113..ae8587e9d3ca 100644 --- a/starmath/source/document.cxx +++ b/starmath/source/document.cxx @@ -342,7 +342,7 @@ EditEngine& SmDocShell::GetEditEngine() EEControlBits(~EEControlBits::PASTESPECIAL) ); mpEditEngine->SetWordDelimiters(" .=+-*/(){}[];\""); - mpEditEngine->SetRefMapMode( MapUnit::MapPixel ); + mpEditEngine->SetRefMapMode(MapMode(MapUnit::MapPixel)); mpEditEngine->SetPaperSize( Size( 800, 0 ) ); diff --git a/starmath/source/edit.cxx b/starmath/source/edit.cxx index d044bd1b7959..84094839b961 100644 --- a/starmath/source/edit.cxx +++ b/starmath/source/edit.cxx @@ -80,7 +80,7 @@ SmEditWindow::SmEditWindow( SmCmdBoxWindow &rMyCmdBoxWin ) : { set_id("math_edit"); SetHelpId(HID_SMA_COMMAND_WIN_EDIT); - SetMapMode(MapUnit::MapPixel); + SetMapMode(MapMode(MapUnit::MapPixel)); // Even RTL languages don't use RTL for math EnableRTL( false ); diff --git a/starmath/source/tmpdevice.cxx b/starmath/source/tmpdevice.cxx index 1983a0059765..e47bc1b72ffb 100644 --- a/starmath/source/tmpdevice.cxx +++ b/starmath/source/tmpdevice.cxx @@ -38,7 +38,7 @@ SmTmpDevice::SmTmpDevice(OutputDevice &rTheDev, bool bUseMap100th_mm) : if (bUseMap100th_mm && MapUnit::Map100thMM != rOutDev.GetMapMode().GetMapUnit()) { SAL_WARN("starmath", "incorrect MapMode?"); - rOutDev.SetMapMode( MapUnit::Map100thMM ); //format for 100% always + rOutDev.SetMapMode(MapMode(MapUnit::Map100thMM)); // format for 100% always } } diff --git a/starmath/source/unomodel.cxx b/starmath/source/unomodel.cxx index 114662deaf15..68527eb52e6b 100644 --- a/starmath/source/unomodel.cxx +++ b/starmath/source/unomodel.cxx @@ -982,7 +982,7 @@ void SAL_CALL SmModel::render( if (!pOut) throw RuntimeException(); - pOut->SetMapMode( MapUnit::Map100thMM ); + pOut->SetMapMode(MapMode(MapUnit::Map100thMM)); uno::Reference< frame::XModel > xModel; rSelection >>= xModel; diff --git a/starmath/source/view.cxx b/starmath/source/view.cxx index 1d433288bc6c..11c5b7148488 100644 --- a/starmath/source/view.cxx +++ b/starmath/source/view.cxx @@ -886,7 +886,7 @@ void SmViewShell::InnerResizePixel(const Point &rOfs, const Size &rSize, bool) Size aObjSize = GetObjectShell()->GetVisArea().GetSize(); if ( aObjSize.Width() > 0 && aObjSize.Height() > 0 ) { - Size aProvidedSize = GetWindow()->PixelToLogic( rSize, MapUnit::Map100thMM ); + Size aProvidedSize = GetWindow()->PixelToLogic(rSize, MapMode(MapUnit::Map100thMM)); SfxViewShell::SetZoomFactor( Fraction( aProvidedSize.Width(), aObjSize.Width() ), Fraction( aProvidedSize.Height(), aObjSize.Height() ) ); } diff --git a/svtools/source/brwbox/brwbox2.cxx b/svtools/source/brwbox/brwbox2.cxx index c73f3695838f..4e341b72dbf4 100644 --- a/svtools/source/brwbox/brwbox2.cxx +++ b/svtools/source/brwbox/brwbox2.cxx @@ -670,8 +670,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, // (as it is based on the settings of our data window, not the foreign device) if (!nDataRowHeight) ImpGetDataRowHeight(); - long nHeightLogic = PixelToLogic(Size(0, nDataRowHeight), MapUnit::Map10thMM).Height(); - long nForeignHeightPixel = pDev->LogicToPixel(Size(0, nHeightLogic), MapUnit::Map10thMM).Height(); + long nHeightLogic = PixelToLogic(Size(0, nDataRowHeight), MapMode(MapUnit::Map10thMM)).Height(); + long nForeignHeightPixel = pDev->LogicToPixel(Size(0, nHeightLogic), MapMode(MapUnit::Map10thMM)).Height(); long nOriginalHeight = nDataRowHeight; nDataRowHeight = nForeignHeightPixel; @@ -682,8 +682,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, { BrowserColumn* pCurrent = pCols[ nPos ]; - long nWidthLogic = PixelToLogic(Size(pCurrent->Width(), 0), MapUnit::Map10thMM).Width(); - long nForeignWidthPixel = pDev->LogicToPixel(Size(nWidthLogic, 0), MapUnit::Map10thMM).Width(); + long nWidthLogic = PixelToLogic(Size(pCurrent->Width(), 0), MapMode(MapUnit::Map10thMM)).Width(); + long nForeignWidthPixel = pDev->LogicToPixel(Size(nWidthLogic, 0), MapMode(MapUnit::Map10thMM)).Width(); pCurrent->SetWidth(nForeignWidthPixel, GetZoom()); if ( pBar ) @@ -700,8 +700,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, if ( pBar ) { // the title height with respect to the font set for the given device - long nTitleHeight = PixelToLogic(Size(0, GetTitleHeight()), MapUnit::Map10thMM).Height(); - nTitleHeight = pDev->LogicToPixel(Size(0, nTitleHeight), MapUnit::Map10thMM).Height(); + long nTitleHeight = PixelToLogic(Size(0, GetTitleHeight()), MapMode(MapUnit::Map10thMM)).Height(); + nTitleHeight = pDev->LogicToPixel(Size(0, nTitleHeight), MapMode(MapUnit::Map10thMM)).Height(); BrowserColumn* pFirstCol = !pCols.empty() ? pCols[ 0 ] : nullptr; @@ -761,8 +761,8 @@ void BrowseBox::Draw( OutputDevice* pDev, const Point& rPos, const Size& rSize, { BrowserColumn* pCurrent = pCols[ nPos ]; - long nForeignWidthLogic = pDev->PixelToLogic(Size(pCurrent->Width(), 0), MapUnit::Map10thMM).Width(); - long nWidthPixel = LogicToPixel(Size(nForeignWidthLogic, 0), MapUnit::Map10thMM).Width(); + long nForeignWidthLogic = pDev->PixelToLogic(Size(pCurrent->Width(), 0), MapMode(MapUnit::Map10thMM)).Width(); + long nWidthPixel = LogicToPixel(Size(nForeignWidthLogic, 0), MapMode(MapUnit::Map10thMM)).Width(); pCurrent->SetWidth(nWidthPixel, GetZoom()); if ( pBar ) diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx index 9e867fd8e258..24853fa6f268 100644 --- a/svtools/source/contnr/fileview.cxx +++ b/svtools/source/contnr/fileview.cxx @@ -999,7 +999,7 @@ extern "C" SAL_DLLPUBLIC_EXPORT void SAL_CALL makeSvtFileView(VclPtr<vcl::Window Size SvtFileView::GetOptimalSize() const { - return LogicToPixel(Size(208, 50), MapUnit::MapAppFont); + return LogicToPixel(Size(208, 50), MapMode(MapUnit::MapAppFont)); } void SvtFileView::SetViewMode( FileViewMode eMode ) diff --git a/svtools/source/control/roadmap.cxx b/svtools/source/control/roadmap.cxx index c6e60546c5ca..4cce5aec37ec 100644 --- a/svtools/source/control/roadmap.cxx +++ b/svtools/source/control/roadmap.cxx @@ -187,8 +187,8 @@ public: void RoadmapImpl::initItemSize() { Size aLabelSize( m_rAntiImpl.GetOutputSizePixel() ); - aLabelSize.Height() = m_rAntiImpl.LogicToPixel( Size( 0, LABELBASEMAPHEIGHT ), MapUnit::MapAppFont ).Height(); - aLabelSize.Width() -= m_rAntiImpl.LogicToPixel( Size( 2 * ROADMAP_INDENT_X, 0 ), MapUnit::MapAppFont ).Width(); + aLabelSize.Height() = m_rAntiImpl.LogicToPixel(Size(0, LABELBASEMAPHEIGHT), MapMode(MapUnit::MapAppFont)).Height(); + aLabelSize.Width() -= m_rAntiImpl.LogicToPixel(Size(2 * ROADMAP_INDENT_X, 0), MapMode(MapUnit::MapAppFont)).Width(); m_aItemSizePixel = aLabelSize; } @@ -570,7 +570,7 @@ void ORoadmap::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& void ORoadmap::DrawHeadline(vcl::RenderContext& rRenderContext) { - Point aTextPos = LogicToPixel(Point(ROADMAP_INDENT_X, 8), MapUnit::MapAppFont); + Point aTextPos = LogicToPixel(Point(ROADMAP_INDENT_X, 8), MapMode(MapUnit::MapAppFont)); Size aOutputSize(GetOutputSizePixel()); @@ -742,7 +742,7 @@ void RoadmapItem::SetPosition(RoadmapItem const * _pOldItem) Point aIDPos; if ( _pOldItem == nullptr ) { - aIDPos = mpID->LogicToPixel( Point( ROADMAP_INDENT_X, ROADMAP_INDENT_Y ), MapUnit::MapAppFont ); + aIDPos = mpID->LogicToPixel(Point(ROADMAP_INDENT_X, ROADMAP_INDENT_Y), MapMode(MapUnit::MapAppFont)); } else { diff --git a/svtools/source/dialogs/roadmapwizard.cxx b/svtools/source/dialogs/roadmapwizard.cxx index a0bcb0409a99..97c808a53f64 100644 --- a/svtools/source/dialogs/roadmapwizard.cxx +++ b/svtools/source/dialogs/roadmapwizard.cxx @@ -133,7 +133,7 @@ namespace svt m_pImpl->pRoadmap->SetPosPixel( Point( 0, 0 ) ); m_pImpl->pRoadmap->SetItemSelectHdl( LINK( this, RoadmapWizard, OnRoadmapItemSelected ) ); - Size aRoadmapSize =( LogicToPixel( Size( 85, 0 ), MapUnit::MapAppFont ) ); + Size aRoadmapSize = LogicToPixel(Size(85, 0), MapMode(MapUnit::MapAppFont)); aRoadmapSize.Height() = GetSizePixel().Height(); m_pImpl->pRoadmap->SetSizePixel( aRoadmapSize ); diff --git a/svtools/source/dialogs/wizardmachine.cxx b/svtools/source/dialogs/wizardmachine.cxx index 57ad496aab1f..b559d58e9e3e 100644 --- a/svtools/source/dialogs/wizardmachine.cxx +++ b/svtools/source/dialogs/wizardmachine.cxx @@ -125,7 +125,7 @@ namespace svt if (_nButtonFlags & WizardButtonFlags::HELP) { m_pHelp= VclPtr<HelpButton>::Create(this, WB_TABSTOP); - m_pHelp->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); + m_pHelp->SetSizePixel(LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont))); m_pHelp->Show(); AddButton( m_pHelp, WIZARDDIALOG_BUTTON_STDOFFSET_X); } @@ -135,7 +135,7 @@ namespace svt { m_pPrevPage = VclPtr<PushButton>::Create(this, WB_TABSTOP); m_pPrevPage->SetHelpId( HID_WIZARD_PREVIOUS ); - m_pPrevPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); + m_pPrevPage->SetSizePixel(LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont))); m_pPrevPage->SetText(SvtResId(STR_WIZDLG_PREVIOUS)); m_pPrevPage->Show(); m_pPrevPage->set_id("previous"); @@ -153,7 +153,7 @@ namespace svt { m_pNextPage = VclPtr<PushButton>::Create(this, WB_TABSTOP); m_pNextPage->SetHelpId( HID_WIZARD_NEXT ); - m_pNextPage->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); + m_pNextPage->SetSizePixel(LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont))); m_pNextPage->SetText(SvtResId(STR_WIZDLG_NEXT)); m_pNextPage->Show(); m_pNextPage->set_id("next"); @@ -167,7 +167,7 @@ namespace svt if (_nButtonFlags & WizardButtonFlags::FINISH) { m_pFinish = VclPtr<OKButton>::Create(this, WB_TABSTOP); - m_pFinish->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); + m_pFinish->SetSizePixel(LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont))); m_pFinish->SetText(SvtResId(STR_WIZDLG_FINISH)); m_pFinish->Show(); m_pFinish->set_id("finish"); @@ -180,7 +180,7 @@ namespace svt if (_nButtonFlags & WizardButtonFlags::CANCEL) { m_pCancel = VclPtr<CancelButton>::Create(this, WB_TABSTOP); - m_pCancel->SetSizePixel( LogicToPixel( Size( 50, 14 ), MapUnit::MapAppFont ) ); + m_pCancel->SetSizePixel(LogicToPixel(Size(50, 14), MapMode(MapUnit::MapAppFont))); m_pCancel->Show(); AddButton( m_pCancel, WIZARDDIALOG_BUTTON_STDOFFSET_X ); diff --git a/svtools/source/dialogs/wizdlg.cxx b/svtools/source/dialogs/wizdlg.cxx index 386ee9ac1836..7694f7f6add6 100644 --- a/svtools/source/dialogs/wizdlg.cxx +++ b/svtools/source/dialogs/wizdlg.cxx @@ -230,7 +230,7 @@ void WizardDialog::ImplPosCtrls() long WizardDialog::LogicalCoordinateToPixel(int iCoordinate){ - Size aLocSize = LogicToPixel(Size( iCoordinate, 0 ), MapUnit::MapAppFont ); + Size aLocSize = LogicToPixel(Size(iCoordinate, 0), MapMode(MapUnit::MapAppFont)); int iPixelCoordinate = aLocSize.Width(); return iPixelCoordinate; } diff --git a/svtools/source/filter/DocumentToGraphicRenderer.cxx b/svtools/source/filter/DocumentToGraphicRenderer.cxx index 33ac961f0928..b5274078e3b1 100644 --- a/svtools/source/filter/DocumentToGraphicRenderer.cxx +++ b/svtools/source/filter/DocumentToGraphicRenderer.cxx @@ -96,7 +96,7 @@ DocumentToGraphicRenderer::~DocumentToGraphicRenderer() Size DocumentToGraphicRenderer::getDocumentSizeInPixels(sal_Int32 nCurrentPage) { Size aSize100mm = getDocumentSizeIn100mm(nCurrentPage); - return Application::GetDefaultDevice()->LogicToPixel( aSize100mm, MapUnit::Map100thMM ); + return Application::GetDefaultDevice()->LogicToPixel(aSize100mm, MapMode(MapUnit::Map100thMM)); } bool DocumentToGraphicRenderer::hasSelection() const diff --git a/svtools/source/filter/exportdialog.cxx b/svtools/source/filter/exportdialog.cxx index 7f6d7652de77..b7f61c020683 100644 --- a/svtools/source/filter/exportdialog.cxx +++ b/svtools/source/filter/exportdialog.cxx @@ -664,7 +664,7 @@ ExportDialog::ExportDialog(FltCallDialogParameter& rPara, mnFormat = GetFilterFormat( maExt ); - Size aResolution( Application::GetDefaultDevice()->LogicToPixel( Size( 100, 100 ), MapUnit::MapCM ) ); + Size aResolution( Application::GetDefaultDevice()->LogicToPixel(Size(100, 100), MapMode(MapUnit::MapCM)) ); maResolution.Width = aResolution.Width(); maResolution.Height= aResolution.Height(); @@ -915,7 +915,8 @@ void ExportDialog::updateControls() if ( !mbIsPixelFormat ) { awt::Size aSize100thmm( maSize ); - Size aSize( LogicToLogic( Size( aSize100thmm.Width * 100, aSize100thmm.Height * 100 ), MapUnit::Map100thMM, + Size aSize( LogicToLogic( Size(aSize100thmm.Width * 100, aSize100thmm.Height * 100), + MapMode(MapUnit::Map100thMM), MapMode( GetMapUnit( mpLbSizeX->GetSelectedEntryPos() ) ) ) ); mpMfSizeX->SetValue( aSize.Width() ); mpMfSizeY->SetValue( aSize.Height() ); @@ -1092,7 +1093,7 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeX, Edit&, void) sal_Int32 nHeight= static_cast< sal_Int32 >( nWidth * fRatio ); const Size aSource( nWidth, nHeight ); MapMode aSourceMapMode( GetMapUnit( mpLbSizeX->GetSelectedEntryPos() ),Point(), aFract, aFract ); - Size aDest( LogicToLogic( aSource, aSourceMapMode, MapUnit::Map100thMM ) ); + Size aDest( LogicToLogic(aSource, aSourceMapMode, MapMode(MapUnit::Map100thMM)) ); maSize.Width = aDest.Width(); maSize.Height = aDest.Height(); @@ -1124,7 +1125,7 @@ IMPL_LINK_NOARG(ExportDialog, UpdateHdlMtfSizeY, Edit&, void) sal_Int32 nWidth = static_cast< sal_Int32 >( nHeight * fRatio ); const Size aSource( nWidth, nHeight ); MapMode aSourceMapMode( GetMapUnit( mpLbSizeX->GetSelectedEntryPos() ),Point(), aFract, aFract ); - Size aDest( LogicToLogic( aSource, aSourceMapMode, MapUnit::Map100thMM ) ); + Size aDest( LogicToLogic(aSource, aSourceMapMode, MapMode(MapUnit::Map100thMM)) ); maSize.Height = aDest.Height(); maSize.Width = aDest.Width(); diff --git a/svtools/source/graphic/descriptor.cxx b/svtools/source/graphic/descriptor.cxx index 719d650da7c0..54254afe70b3 100644 --- a/svtools/source/graphic/descriptor.cxx +++ b/svtools/source/graphic/descriptor.cxx @@ -348,7 +348,10 @@ void GraphicDescriptor::_getPropertyValues( const comphelper::PropertyMapEntry** { if( mpGraphic->GetPrefMapMode().GetMapUnit() != MapUnit::MapPixel ) { - const Size aSizeLog( OutputDevice::LogicToLogic( mpGraphic->GetPrefSize(), mpGraphic->GetPrefMapMode(), MapUnit::Map100thMM ) ); + const Size aSizeLog( OutputDevice::LogicToLogic( + mpGraphic->GetPrefSize(), + mpGraphic->GetPrefMapMode(), + MapMode(MapUnit::Map100thMM)) ); aAWTSize = awt::Size( aSizeLog.Width(), aSizeLog.Height() ); } } diff --git a/svtools/source/graphic/grfmgr.cxx b/svtools/source/graphic/grfmgr.cxx index 0664c190c192..fb6848544220 100644 --- a/svtools/source/graphic/grfmgr.cxx +++ b/svtools/source/graphic/grfmgr.cxx @@ -255,7 +255,7 @@ bool GraphicObject::ImplGetCropParams( OutputDevice const * pOut, Point& rPt, Si rClipPolyPoly = aClipPoly; - if( maGraphic.GetPrefMapMode() == MapUnit::MapPixel ) + if (maGraphic.GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel) aSize100 = Application::GetDefaultDevice()->PixelToLogic( maGraphic.GetPrefSize(), aMap100 ); else { @@ -669,7 +669,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo { GDIMetaFile aMtf( aTransGraphic.GetGDIMetaFile() ); - if( aMapGraph == MapUnit::MapPixel ) + if (aMapGraph.GetMapUnit() == MapUnit::MapPixel) { // crops are in 1/100th mm -> to aMapGraph -> to MapUnit::MapPixel aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel( @@ -742,7 +742,7 @@ Graphic GraphicObject::GetTransformedGraphic( const Size& rDestSize, const MapMo // convert crops to pixel if(rAttr.IsCropped()) { - if( aMapGraph == MapUnit::MapPixel ) + if (aMapGraph.GetMapUnit() == MapUnit::MapPixel) { // crops are in 1/100th mm -> to MapUnit::MapPixel aCropLeftTop = Application::GetDefaultDevice()->LogicToPixel( diff --git a/svtools/source/graphic/provider.cxx b/svtools/source/graphic/provider.cxx index a77fbd2b5cc6..8ac3a885d7ef 100644 --- a/svtools/source/graphic/provider.cxx +++ b/svtools/source/graphic/provider.cxx @@ -495,11 +495,11 @@ void ImplCalculateCropRect( ::Graphic const & rGraphic, const text::GraphicCrop& Size aSize100thMM( 0, 0 ); if( rGraphic.GetPrefMapMode().GetMapUnit() != MapUnit::MapPixel ) { - aSize100thMM = OutputDevice::LogicToLogic( rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode(), MapUnit::Map100thMM ); + aSize100thMM = OutputDevice::LogicToLogic(rGraphic.GetPrefSize(), rGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)); } else { - aSize100thMM = Application::GetDefaultDevice()->PixelToLogic( rGraphic.GetPrefSize(), MapUnit::Map100thMM ); + aSize100thMM = Application::GetDefaultDevice()->PixelToLogic(rGraphic.GetPrefSize(), MapMode(MapUnit::Map100thMM)); } if ( aSize100thMM.Width() && aSize100thMM.Height() ) { @@ -619,7 +619,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal { ScopedVclPtrInstance< VirtualDevice > aDummyVDev; GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() ); - Size aMtfSize( OutputDevice::LogicToLogic( aMtf.GetPrefSize(), aMtf.GetPrefMapMode(), MapUnit::Map100thMM ) ); + Size aMtfSize( OutputDevice::LogicToLogic(aMtf.GetPrefSize(), aMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) ); if ( aMtfSize.Width() && aMtfSize.Height() ) { MapMode aNewMapMode( MapUnit::Map100thMM ); @@ -672,7 +672,7 @@ void ImplApplyFilterData( ::Graphic& rGraphic, uno::Sequence< beans::PropertyVal } ::Graphic aGraphic( aBmpEx ); const Size aSize100thmm( aDummyVDev->LogicToPixel( aSize ) ); - Size aSize100thmm2( aDummyVDev->PixelToLogic( aSize100thmm, MapUnit::Map100thMM ) ); + Size aSize100thmm2( aDummyVDev->PixelToLogic(aSize100thmm, MapMode(MapUnit::Map100thMM)) ); ImplApplyBitmapResolution( aGraphic, nImageResolution, aGraphic.GetSizePixel(), awt::Size( aSize100thmm2.Width(), aSize100thmm2.Height() ) ); diff --git a/svtools/source/misc/embedhlp.cxx b/svtools/source/misc/embedhlp.cxx index 3192073cbd46..5355ce320b3a 100644 --- a/svtools/source/misc/embedhlp.cxx +++ b/svtools/source/misc/embedhlp.cxx @@ -480,7 +480,7 @@ Size EmbeddedObjectRef::GetSize( MapMode const * pTargetMapMode ) const try { - aSourceMapMode = VCLUnoHelper::UnoEmbed2VCLMapUnit(mpImpl->mxObj->getMapUnit(mpImpl->nViewAspect)); + aSourceMapMode = MapMode(VCLUnoHelper::UnoEmbed2VCLMapUnit(mpImpl->mxObj->getMapUnit(mpImpl->nViewAspect))); } catch (const uno::Exception& e) { diff --git a/svtools/source/misc/transfer.cxx b/svtools/source/misc/transfer.cxx index ebfe64ff5ad1..17c7983401dc 100644 --- a/svtools/source/misc/transfer.cxx +++ b/svtools/source/misc/transfer.cxx @@ -1618,16 +1618,16 @@ bool TransferableDataHelper::GetBitmapEx( const DataFlavor& rFlavor, BitmapEx& r if(MapUnit::MapPixel != aMapMode.GetMapUnit()) { - const Size aSize(OutputDevice::LogicToLogic(rBmpEx.GetPrefSize(), aMapMode, MapUnit::Map100thMM)); + const Size aSize(OutputDevice::LogicToLogic(rBmpEx.GetPrefSize(), aMapMode, MapMode(MapUnit::Map100thMM))); // #i122388# This wrongly corrects in the given case; changing from 5000 100th mm to // the described 50 cm (which is 50000 100th mm) if((aSize.Width() > 50000) || (aSize.Height() > 50000)) { - rBmpEx.SetPrefMapMode(MapUnit::MapPixel); + rBmpEx.SetPrefMapMode(MapMode(MapUnit::MapPixel)); // #i122388# also adapt size by applying the mew MapMode - const Size aNewSize(OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, MapUnit::MapPixel)); + const Size aNewSize(OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapPixel))); rBmpEx.SetPrefSize(aNewSize); } } diff --git a/svtools/source/table/tablecontrol_impl.cxx b/svtools/source/table/tablecontrol_impl.cxx index 53c19198f1fa..dd15c46b492b 100644 --- a/svtools/source/table/tablecontrol_impl.cxx +++ b/svtools/source/table/tablecontrol_impl.cxx @@ -547,15 +547,15 @@ namespace svt { namespace table void TableControl_Impl::impl_ni_updateCachedTableMetrics() { - m_nRowHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getRowHeight() ), MapUnit::MapAppFont ).Height(); + m_nRowHeightPixel = m_rAntiImpl.LogicToPixel(Size(0, m_pModel->getRowHeight()), MapMode(MapUnit::MapAppFont)).Height(); m_nColHeaderHeightPixel = 0; if ( m_pModel->hasColumnHeaders() ) - m_nColHeaderHeightPixel = m_rAntiImpl.LogicToPixel( Size( 0, m_pModel->getColumnHeaderHeight() ), MapUnit::MapAppFont ).Height(); + m_nColHeaderHeightPixel = m_rAntiImpl.LogicToPixel(Size(0, m_pModel->getColumnHeaderHeight()), MapMode(MapUnit::MapAppFont)).Height(); m_nRowHeaderWidthPixel = 0; if ( m_pModel->hasRowHeaders() ) - m_nRowHeaderWidthPixel = m_rAntiImpl.LogicToPixel( Size( m_pModel->getRowHeaderWidth(), 0 ), MapUnit::MapAppFont).Width(); + m_nRowHeaderWidthPixel = m_rAntiImpl.LogicToPixel(Size(m_pModel->getRowHeaderWidth(), 0), MapMode(MapUnit::MapAppFont)).Width(); } @@ -1793,13 +1793,13 @@ namespace svt { namespace table long TableControl_Impl::pixelWidthToAppFont( long const i_pixels ) const { - return m_pDataWindow->PixelToLogic( Size( i_pixels, 0 ), MapUnit::MapAppFont ).Width(); + return m_pDataWindow->PixelToLogic(Size(i_pixels, 0), MapMode(MapUnit::MapAppFont)).Width(); } long TableControl_Impl::appFontWidthToPixel( long const i_appFontUnits ) const { - return m_pDataWindow->LogicToPixel( Size( i_appFontUnits, 0 ), MapUnit::MapAppFont ).Width(); + return m_pDataWindow->LogicToPixel(Size(i_appFontUnits, 0), MapMode(MapUnit::MapAppFont)).Width(); } diff --git a/svtools/source/uno/svtxgridcontrol.cxx b/svtools/source/uno/svtxgridcontrol.cxx index 64561c743601..234b5767af82 100644 --- a/svtools/source/uno/svtxgridcontrol.cxx +++ b/svtools/source/uno/svtxgridcontrol.cxx @@ -212,7 +212,7 @@ void SVTXGridControl::setProperty( const OUString& PropertyName, const Any& aVal sal_Int32 columnHeaderHeight = 0; if ( !aValue.hasValue() ) { - columnHeaderHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MapUnit::MapAppFont ).Height(); + columnHeaderHeight = pTable->PixelToLogic(Size(0, pTable->GetTextHeight() + 3), MapMode(MapUnit::MapAppFont)).Height(); } else { @@ -252,7 +252,7 @@ void SVTXGridControl::setProperty( const OUString& PropertyName, const Any& aVal sal_Int32 rowHeight = 0; if ( !aValue.hasValue() ) { - rowHeight = pTable->PixelToLogic( Size( 0, pTable->GetTextHeight() + 3 ), MapUnit::MapAppFont ).Height(); + rowHeight = pTable->PixelToLogic(Size(0, pTable->GetTextHeight() + 3), MapMode(MapUnit::MapAppFont)).Height(); } else { diff --git a/svtools/source/uno/wizard/wizardshell.cxx b/svtools/source/uno/wizard/wizardshell.cxx index ad63261bd229..0fe2faa4a903 100644 --- a/svtools/source/uno/wizard/wizardshell.cxx +++ b/svtools/source/uno/wizard/wizardshell.cxx @@ -184,7 +184,7 @@ namespace svt { namespace uno { // fallback for ill-behaved clients: empty page pPage = VclPtr<TabPage>::Create( this, 0 ); - pPage->SetSizePixel( LogicToPixel( Size( 280, 185 ), MapUnit::MapAppFont ) ); + pPage->SetSizePixel(LogicToPixel(Size(280, 185), MapMode(MapUnit::MapAppFont))); } m_aPageControllers[ pPage ] = pController; diff --git a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx index 9d4faa31e5aa..68f796178d8a 100644 --- a/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx +++ b/svx/source/customshapes/EnhancedCustomShapeFontWork.cxx @@ -167,7 +167,7 @@ void CalculateHorizontalScalingFactor( const SdrObject* pCustomShape, // initializing virtual device ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK); - pVirDev->SetMapMode( MapUnit::Map100thMM ); + pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVirDev->SetFont( aFont ); if ( nOutlinesCount2d & 1 ) @@ -261,7 +261,7 @@ void GetTextAreaOutline( const FWData& rFWData, const SdrObject* pCustomShape, F // initializing virtual device ScopedVclPtrInstance< VirtualDevice > pVirDev(DeviceFormat::BITMASK); - pVirDev->SetMapMode( MapUnit::Map100thMM ); + pVirDev->SetMapMode(MapMode(MapUnit::Map100thMM)); pVirDev->SetFont( aFont ); pVirDev->EnableRTL(); if ( aParagraphIter->nFrameDirection == SvxFrameDirection::Horizontal_RL_TB ) diff --git a/svx/source/dialog/ClassificationEditView.cxx b/svx/source/dialog/ClassificationEditView.cxx index bfb0a159dccc..1c602a2f2343 100644 --- a/svx/source/dialog/ClassificationEditView.cxx +++ b/svx/source/dialog/ClassificationEditView.cxx @@ -48,7 +48,7 @@ ClassificationEditView::ClassificationEditView(vcl::Window* pParent, WinBits nBi const StyleSettings& rStyleSettings = Application::GetSettings().GetStyleSettings(); Color aBgColor = rStyleSettings.GetWindowColor(); - SetMapMode(MapUnit::MapTwip); + SetMapMode(MapMode(MapUnit::MapTwip)); SetPointer(PointerStyle::Text); SetBackground(aBgColor); diff --git a/svx/source/dialog/_bmpmask.cxx b/svx/source/dialog/_bmpmask.cxx index 5ad9ab460727..dd7e274087f5 100644 --- a/svx/source/dialog/_bmpmask.cxx +++ b/svx/source/dialog/_bmpmask.cxx @@ -77,7 +77,7 @@ public: virtual Size GetOptimalSize() const override { - return LogicToPixel(Size(43, 14), MapUnit::MapAppFont); + return LogicToPixel(Size(43, 14), MapMode(MapUnit::MapAppFont)); } }; @@ -94,7 +94,7 @@ public: virtual void GetFocus() override; virtual Size GetOptimalSize() const override { - return LogicToPixel(Size(24, 12), MapUnit::MapAppFont); + return LogicToPixel(Size(24, 12), MapMode(MapUnit::MapAppFont)); } void onEditColor(); diff --git a/svx/source/dialog/compressgraphicdialog.cxx b/svx/source/dialog/compressgraphicdialog.cxx index 32be4f4838b2..77ce8cdfc868 100644 --- a/svx/source/dialog/compressgraphicdialog.cxx +++ b/svx/source/dialog/compressgraphicdialog.cxx @@ -191,7 +191,7 @@ void CompressGraphicsDialog::Update() pDummyVDev->SetMapMode( m_aGraphic.GetPrefMapMode() ); Size aPixelSize = m_aGraphic.GetSizePixel(); - Size aOriginalSize100mm( pDummyVDev->PixelToLogic( m_aGraphic.GetSizePixel(), MapUnit::Map100thMM ) ); + Size aOriginalSize100mm(pDummyVDev->PixelToLogic(m_aGraphic.GetSizePixel(), MapMode(MapUnit::Map100thMM))); OUString aBitmapSizeString = SvxResId(STR_IMAGE_ORIGINAL_SIZE); OUString aWidthString = GetUnitString( aOriginalSize100mm.Width(), eFieldUnit, cSeparator ); diff --git a/svx/source/dialog/connctrl.cxx b/svx/source/dialog/connctrl.cxx index 909c70e7e034..0391efac9314 100644 --- a/svx/source/dialog/connctrl.cxx +++ b/svx/source/dialog/connctrl.cxx @@ -42,7 +42,7 @@ SvxXConnectionPreview::SvxXConnectionPreview( vcl::Window* pParent, WinBits nSty , pObjList(nullptr) , pView(nullptr) { - SetMapMode( MapUnit::Map100thMM ); + SetMapMode(MapMode(MapUnit::Map100thMM)); SetStyles(); } @@ -78,7 +78,7 @@ void SvxXConnectionPreview::AdaptSize() // Adapt size if( pObjList ) { - SetMapMode( MapUnit::Map100thMM ); + SetMapMode(MapMode(MapUnit::Map100thMM)); OutputDevice* pOD = pView->GetFirstOutputDevice(); // GetWin( 0 ); tools::Rectangle aRect = pObjList->GetAllObjBoundRect(); diff --git a/svx/source/dialog/contwnd.cxx b/svx/source/dialog/contwnd.cxx index 23b92b927ff7..9ae5d524a1fb 100644 --- a/svx/source/dialog/contwnd.cxx +++ b/svx/source/dialog/contwnd.cxx @@ -252,7 +252,7 @@ void ContourWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Recta Size ContourWindow::GetOptimalSize() const { - return LogicToPixel(Size(270, 170), MapUnit::MapAppFont); + return LogicToPixel(Size(270, 170), MapMode(MapUnit::MapAppFont)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/ctredlin.cxx b/svx/source/dialog/ctredlin.cxx index b51229a6f687..e7432febfd80 100644 --- a/svx/source/dialog/ctredlin.cxx +++ b/svx/source/dialog/ctredlin.cxx @@ -380,7 +380,7 @@ SvxTPView::SvxTPView(vcl::Window *pParent, VclBuilderContainer *pTopLevel) SvSimpleTableContainer* pTable = get<SvSimpleTableContainer>("changes"); Size aControlSize(80, 65); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pTable->set_width_request(aControlSize.Width()); pTable->set_height_request(aControlSize.Height()); m_pViewData = VclPtr<SvxRedlinTable>::Create(*pTable, 0); diff --git a/svx/source/dialog/dialcontrol.cxx b/svx/source/dialog/dialcontrol.cxx index 7808f1735b8b..c2bad056f7ec 100644 --- a/svx/source/dialog/dialcontrol.cxx +++ b/svx/source/dialog/dialcontrol.cxx @@ -377,7 +377,7 @@ sal_Int32 DialControl::GetRotation() const Size DialControl::GetOptimalSize() const { - return LogicToPixel(Size(42 , 43), MapUnit::MapAppFont); + return LogicToPixel(Size(42, 43), MapMode(MapUnit::MapAppFont)); } void DialControl::SetRotation( sal_Int32 nAngle ) diff --git a/svx/source/dialog/dlgctl3d.cxx b/svx/source/dialog/dlgctl3d.cxx index 60c2f4161358..cab2f5443e98 100644 --- a/svx/source/dialog/dlgctl3d.cxx +++ b/svx/source/dialog/dlgctl3d.cxx @@ -59,7 +59,7 @@ Svx3DPreviewControl::Svx3DPreviewControl(vcl::Window* pParent, WinBits nStyle) Size Svx3DPreviewControl::GetOptimalSize() const { - return LogicToPixel(Size(80, 100), MapUnit::MapAppFont); + return LogicToPixel(Size(80, 100), MapMode(MapUnit::MapAppFont)); } VCL_BUILDER_FACTORY(Svx3DPreviewControl) @@ -81,7 +81,7 @@ void Svx3DPreviewControl::Construct() // Do never mirror the preview window. This explicitly includes right // to left writing environments. EnableRTL (false); - SetMapMode( MapUnit::Map100thMM ); + SetMapMode(MapMode(MapUnit::Map100thMM)); // Model mpModel = new FmFormModel(); @@ -947,7 +947,7 @@ SvxLightCtl3D::SvxLightCtl3D( vcl::Window* pParent) Size SvxLightCtl3D::GetOptimalSize() const { - return LogicToPixel(Size(80, 100), MapUnit::MapAppFont); + return LogicToPixel(Size(80, 100), MapMode(MapUnit::MapAppFont)); } VCL_BUILDER_FACTORY(SvxLightCtl3D) diff --git a/svx/source/dialog/dlgctrl.cxx b/svx/source/dialog/dlgctrl.cxx index 6cfcb037a11f..34f71b8b7c33 100644 --- a/svx/source/dialog/dlgctrl.cxx +++ b/svx/source/dialog/dlgctrl.cxx @@ -79,7 +79,7 @@ SvxRectCtl::SvxRectCtl(vcl::Window* pParent, RectPoint eRpt, , mbUpdateForeground(true) , mbUpdateBackground(true) { - SetMapMode(MapUnit::Map100thMM); + SetMapMode(MapMode(MapUnit::Map100thMM)); Resize_Impl(); } @@ -93,7 +93,7 @@ void SvxRectCtl::SetControlSettings(RectPoint eRpt, sal_uInt16 nBorder, sal_uInt Size SvxRectCtl::GetOptimalSize() const { - return LogicToPixel(Size(78, 39), MapUnit::MapAppFont); + return LogicToPixel(Size(78, 39), MapMode(MapUnit::MapAppFont)); } VCL_BUILDER_FACTORY(SvxRectCtl) @@ -746,7 +746,7 @@ void SvxPixelCtl::Resize() Size SvxPixelCtl::GetOptimalSize() const { - return LogicToPixel(Size(72, 72), MapUnit::MapAppFont); + return LogicToPixel(Size(72, 72), MapMode(MapUnit::MapAppFont)); } VCL_BUILDER_FACTORY_ARGS(SvxPixelCtl, 8) @@ -1337,7 +1337,7 @@ SvxPreviewBase::SvxPreviewBase(vcl::Window* pParent) // Draw the control's border as a flat thin black line. SetBorderStyle(WindowBorderStyle::MONO); SetDrawMode( GetSettings().GetStyleSettings().GetHighContrastMode() ? OUTPUT_DRAWMODE_CONTRAST : OUTPUT_DRAWMODE_COLOR ); - SetMapMode(MapUnit::Map100thMM); + SetMapMode(MapMode(MapUnit::Map100thMM)); // init model mpModel->GetItemPool().FreezeIdRanges(); diff --git a/svx/source/dialog/docrecovery.cxx b/svx/source/dialog/docrecovery.cxx index 6306beaaf566..35a82a04ea57 100644 --- a/svx/source/dialog/docrecovery.cxx +++ b/svx/source/dialog/docrecovery.cxx @@ -855,7 +855,7 @@ RecoveryDialog::RecoveryDialog(vcl::Window* pParent, RecoveryCore* pCore) constexpr int RECOV_CONTROLWIDTH = 278; SvSimpleTableContainer* pFileListLBContainer = get<SvSimpleTableContainer>("filelist"); - Size aSize(LogicToPixel(Size(RECOV_CONTROLWIDTH, 68), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(RECOV_CONTROLWIDTH, 68), MapMode(MapUnit::MapAppFont))); pFileListLBContainer->set_height_request(aSize.Height()); m_pFileListLB = VclPtr<RecovDocList>::Create(*pFileListLBContainer); diff --git a/svx/source/dialog/frmsel.cxx b/svx/source/dialog/frmsel.cxx index af41b254815d..e3a6b6a9f8ba 100644 --- a/svx/source/dialog/frmsel.cxx +++ b/svx/source/dialog/frmsel.cxx @@ -1278,7 +1278,7 @@ void FrameSelector::Resize() Size FrameSelector::GetOptimalSize() const { - return LogicToPixel(Size(61, 65), MapUnit::MapAppFont); + return LogicToPixel(Size(61, 65), MapMode(MapUnit::MapAppFont)); } diff --git a/svx/source/dialog/imapwnd.cxx b/svx/source/dialog/imapwnd.cxx index 0fdf35cd8430..732abec9865a 100644 --- a/svx/source/dialog/imapwnd.cxx +++ b/svx/source/dialog/imapwnd.cxx @@ -83,7 +83,7 @@ void IMapWindow::dispose() Size IMapWindow::GetOptimalSize() const { - return LogicToPixel(Size(270, 170), MapUnit::MapAppFont); + return LogicToPixel(Size(270, 170), MapMode(MapUnit::MapAppFont)); } void IMapWindow::SetImageMap( const ImageMap& rImageMap ) diff --git a/svx/source/dialog/measctrl.cxx b/svx/source/dialog/measctrl.cxx index a2c3997eb3bf..9831067cc812 100644 --- a/svx/source/dialog/measctrl.cxx +++ b/svx/source/dialog/measctrl.cxx @@ -30,7 +30,7 @@ SvxXMeasurePreview::SvxXMeasurePreview(vcl::Window* pParent, WinBits nStyle) : Control(pParent, nStyle) { - SetMapMode(MapUnit::Map100thMM); + SetMapMode(MapMode(MapUnit::Map100thMM)); // Scale: 1:2 MapMode aMapMode = GetMapMode(); diff --git a/svx/source/dialog/rubydialog.cxx b/svx/source/dialog/rubydialog.cxx index 9dc96987cc18..f66d635f0db9 100644 --- a/svx/source/dialog/rubydialog.cxx +++ b/svx/source/dialog/rubydialog.cxx @@ -776,7 +776,7 @@ void RubyPreview::Paint(vcl::RenderContext& rRenderContext, const tools::Rectang { rRenderContext.Push(PushFlags::MAPMODE); - rRenderContext.SetMapMode(MapUnit::MapTwip); + rRenderContext.SetMapMode(MapMode(MapUnit::MapTwip)); Size aWinSize = rRenderContext.GetOutputSize(); diff --git a/svx/source/dialog/swframeexample.cxx b/svx/source/dialog/swframeexample.cxx index ec7e38747d17..895cb993afaa 100644 --- a/svx/source/dialog/swframeexample.cxx +++ b/svx/source/dialog/swframeexample.cxx @@ -472,7 +472,7 @@ tools::Rectangle SvxSwFrameExample::DrawInnerFrame_Impl(vcl::RenderContext& rRen void SvxSwFrameExample::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle&) { - rRenderContext.SetMapMode(MapUnit::MapPixel); + rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel)); InitAllRects_Impl(rRenderContext); diff --git a/svx/source/engine3d/float3d.cxx b/svx/source/engine3d/float3d.cxx index f31996e29fb2..9a4834847dbe 100644 --- a/svx/source/engine3d/float3d.cxx +++ b/svx/source/engine3d/float3d.cxx @@ -194,7 +194,7 @@ Svx3DWin::Svx3DWin(SfxBindings* pInBindings, SfxChildWindow *pCW, vcl::Window* p get(m_pCtlPreview, "preview"); get(m_pCtlLightPreview, "lightpreview"); - Size aSize(LogicToPixel(Size(83, 76), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(83, 76), MapMode(MapUnit::MapAppFont))); m_pCtlPreview->set_width_request(aSize.Width()); m_pCtlLightPreview->set_width_request(aSize.Width()); m_pCtlPreview->set_height_request(aSize.Height()); diff --git a/svx/source/fmcomp/fmgridcl.cxx b/svx/source/fmcomp/fmgridcl.cxx index a93864bf1b70..57af471fda3f 100644 --- a/svx/source/fmcomp/fmgridcl.cxx +++ b/svx/source/fmcomp/fmgridcl.cxx @@ -1478,7 +1478,7 @@ bool FmGridControl::isColumnMarked(sal_uInt16 nId) const long FmGridControl::QueryMinimumRowHeight() { long const nMinimalLogicHeight = 20; // 0.2 cm - long nMinimalPixelHeight = LogicToPixel( Point( 0, nMinimalLogicHeight ), MapUnit::Map10thMM ).Y(); + long nMinimalPixelHeight = LogicToPixel(Point(0, nMinimalLogicHeight), MapMode(MapUnit::Map10thMM)).Y(); return CalcZoom( nMinimalPixelHeight ); } @@ -1493,7 +1493,7 @@ void FmGridControl::RowHeightChanged() try { sal_Int32 nUnzoomedPixelHeight = CalcReverseZoom( GetDataRowHeight() ); - Any aProperty = makeAny( (sal_Int32)PixelToLogic( Point( 0, nUnzoomedPixelHeight ), MapUnit::Map10thMM ).Y() ); + Any aProperty = makeAny( static_cast<sal_Int32>(PixelToLogic( Point(0, nUnzoomedPixelHeight), MapMode(MapUnit::Map10thMM)).Y()) ); xModel->setPropertyValue( FM_PROP_ROWHEIGHT, aProperty ); } catch( const Exception& ) @@ -1516,7 +1516,7 @@ void FmGridControl::ColumnResized(sal_uInt16 nId) sal_Int32 nColumnWidth = GetColumnWidth(nId); nColumnWidth = CalcReverseZoom(nColumnWidth); // convert to 10THMM - aWidth <<= (sal_Int32)PixelToLogic(Point(nColumnWidth,0),MapUnit::Map10thMM).X(); + aWidth <<= (sal_Int32)PixelToLogic(Point(nColumnWidth, 0), MapMode(MapUnit::Map10thMM)).X(); xColModel->setPropertyValue(FM_PROP_WIDTH, aWidth); } } @@ -1609,7 +1609,7 @@ void FmGridControl::InitColumnsByModels(const Reference< css::container::XIndexC aWidth = xCol->getPropertyValue(FM_PROP_WIDTH); sal_Int32 nWidth = 0; if (aWidth >>= nWidth) - nWidth = LogicToPixel(Point(nWidth,0),MapUnit::Map10thMM).X(); + nWidth = LogicToPixel(Point(nWidth, 0), MapMode(MapUnit::Map10thMM)).X(); AppendColumn(aName, (sal_uInt16)nWidth); DbGridColumn* pCol = DbGridControl::GetColumns().at( i ); diff --git a/svx/source/fmcomp/fmgridif.cxx b/svx/source/fmcomp/fmgridif.cxx index 8237fdf34f8e..b88e4cd9afe2 100644 --- a/svx/source/fmcomp/fmgridif.cxx +++ b/svx/source/fmcomp/fmgridif.cxx @@ -1411,7 +1411,7 @@ void FmXGridPeer::propertyChange(const PropertyChangeEvent& evt) sal_Int32 nTest = 0; if (evt.NewValue >>= nTest) { - nWidth = pGrid->LogicToPixel(Point(nTest,0),MapUnit::Map10thMM).X(); + nWidth = pGrid->LogicToPixel(Point(nTest, 0), MapMode(MapUnit::Map10thMM)).X(); // take the zoom factor into account nWidth = pGrid->CalcZoom(nWidth); } @@ -1726,7 +1726,7 @@ void FmXGridPeer::elementInserted(const ContainerEvent& evt) Any aWidth = xNewColumn->getPropertyValue(FM_PROP_WIDTH); sal_Int32 nWidth = 0; if (aWidth >>= nWidth) - nWidth = pGrid->LogicToPixel(Point(nWidth,0),MapUnit::Map10thMM).X(); + nWidth = pGrid->LogicToPixel(Point(nWidth, 0), MapMode(MapUnit::Map10thMM)).X(); pGrid->AppendColumn(aName, (sal_uInt16)nWidth, (sal_Int16)::comphelper::getINT32(evt.Accessor)); @@ -1769,7 +1769,7 @@ void FmXGridPeer::elementReplaced(const ContainerEvent& evt) Any aWidth = xNewColumn->getPropertyValue(FM_PROP_WIDTH); sal_Int32 nWidth = 0; if (aWidth >>= nWidth) - nWidth = pGrid->LogicToPixel(Point(nWidth,0),MapUnit::Map10thMM).X(); + nWidth = pGrid->LogicToPixel(Point(nWidth, 0), MapMode(MapUnit::Map10thMM)).X(); sal_uInt16 nNewId = pGrid->AppendColumn(aName, (sal_uInt16)nWidth, (sal_Int16)::comphelper::getINT32(evt.Accessor)); sal_uInt16 nNewPos = pGrid->GetModelColumnPos(nNewId); @@ -1960,7 +1960,7 @@ void FmXGridPeer::setProperty( const OUString& PropertyName, const Any& Value) sal_Int32 nLogHeight(0); if (Value >>= nLogHeight) { - sal_Int32 nHeight = pGrid->LogicToPixel(Point(0,nLogHeight),MapUnit::Map10thMM).Y(); + sal_Int32 nHeight = pGrid->LogicToPixel(Point(0, nLogHeight), MapMode(MapUnit::Map10thMM)).Y(); // take the zoom factor into account nHeight = pGrid->CalcZoom(nHeight); pGrid->SetDataRowHeight(nHeight); @@ -2052,7 +2052,7 @@ Any FmXGridPeer::getProperty( const OUString& _rPropertyName ) sal_Int32 nPixelHeight = pGrid->GetDataRowHeight(); // take the zoom factor into account nPixelHeight = pGrid->CalcReverseZoom(nPixelHeight); - aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0,nPixelHeight),MapUnit::Map10thMM).Y(); + aProp <<= (sal_Int32)pGrid->PixelToLogic(Point(0, nPixelHeight), MapMode(MapUnit::Map10thMM)).Y(); } else if ( _rPropertyName == FM_PROP_HASNAVIGATION ) { diff --git a/svx/source/fmcomp/gridctrl.cxx b/svx/source/fmcomp/gridctrl.cxx index 55d374de2025..e688ef251705 100644 --- a/svx/source/fmcomp/gridctrl.cxx +++ b/svx/source/fmcomp/gridctrl.cxx @@ -427,7 +427,7 @@ sal_uInt16 DbGridControl::NavigationBar::ArrangeControls() tools::Rectangle aRect(static_cast<DbGridControl*>(GetParent())->GetControlArea()); long nH = aRect.GetSize().Height(); long nW = GetParent()->GetOutputSizePixel().Width(); - Size aBorder = LogicToPixel(Size(2, 2),MapUnit::MapAppFont); + Size aBorder = LogicToPixel(Size(2, 2), MapMode(MapUnit::MapAppFont)); aBorder = Size(CalcZoom(aBorder.Width()), CalcZoom(aBorder.Height())); sal_uInt16 nX = 1; sal_uInt16 nY = 0; diff --git a/svx/source/form/datanavi.cxx b/svx/source/form/datanavi.cxx index 55fc1004e21e..076a4c35c291 100644 --- a/svx/source/form/datanavi.cxx +++ b/svx/source/form/datanavi.cxx @@ -325,7 +325,7 @@ namespace svxform { get(m_pToolBox, "toolbar"); get(m_pItemList, "items"); - Size aSize(LogicToPixel(Size(63, 100), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(63, 100), MapMode(MapUnit::MapAppFont))); m_pItemList->set_width_request(aSize.Width()); m_pItemList->set_height_request(aSize.Height()); @@ -2143,7 +2143,7 @@ namespace svxform SetText( SvxResId( RID_STR_DATANAVIGATOR ) ); Size aSize = m_aDataWin->GetOutputSizePixel(); - Size aLogSize = PixelToLogic( aSize, MapUnit::MapAppFont ); + Size aLogSize = PixelToLogic(aSize, MapMode(MapUnit::MapAppFont)); SfxDockingWindow::SetFloatingSize( aLogSize ); m_aDataWin->Show(); @@ -2195,13 +2195,13 @@ namespace svxform { SfxDockingWindow::Resize(); - Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MapUnit::MapAppFont ); + Size aLogOutputSize = PixelToLogic(GetOutputSizePixel(), MapMode(MapUnit::MapAppFont)); Size aLogExplSize = aLogOutputSize; aLogExplSize.Width() -= 2; aLogExplSize.Height() -= 2; - Point aExplPos = LogicToPixel( Point(1,1), MapUnit::MapAppFont ); - Size aExplSize = LogicToPixel( aLogExplSize, MapUnit::MapAppFont ); + Point aExplPos = LogicToPixel(Point(1,1), MapMode(MapUnit::MapAppFont)); + Size aExplSize = LogicToPixel(aLogExplSize, MapMode(MapUnit::MapAppFont)); m_aDataWin->SetPosSizePixel( aExplPos, aExplSize ); } @@ -2612,7 +2612,7 @@ namespace svxform SAL_WARN( "svx.form", "AddDataItemDialog::InitFromNode(): exception caught" ); } - Size a3and1Sz = LogicToPixel( Size( 3, 1 ), MapUnit::MapAppFont ); + Size a3and1Sz = LogicToPixel( Size(3, 1), MapMode(MapUnit::MapAppFont)); Size aNewSz = m_pDefaultED->GetSizePixel(); Point aNewPnt = m_pDefaultED->GetPosPixel(); aNewPnt.Y() += a3and1Sz.Height(); @@ -2876,7 +2876,7 @@ namespace svxform SvSimpleTableContainer* pNamespacesListContainer = get<SvSimpleTableContainer>("namespaces"); Size aControlSize(175, 72); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); pNamespacesListContainer->set_width_request(aControlSize.Width()); pNamespacesListContainer->set_height_request(aControlSize.Height()); m_pNamespacesList = VclPtr<SvSimpleTable>::Create(*pNamespacesListContainer, 0); diff --git a/svx/source/form/filtnav.cxx b/svx/source/form/filtnav.cxx index 10b47ae09f61..989019e0a702 100644 --- a/svx/source/form/filtnav.cxx +++ b/svx/source/form/filtnav.cxx @@ -1918,13 +1918,13 @@ void FmFilterNavigatorWin::Resize() { SfxDockingWindow::Resize(); - Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MapUnit::MapAppFont ); + Size aLogOutputSize = PixelToLogic(GetOutputSizePixel(), MapMode(MapUnit::MapAppFont)); Size aLogExplSize = aLogOutputSize; aLogExplSize.Width() -= 6; aLogExplSize.Height() -= 6; - Point aExplPos = LogicToPixel( Point(3,3), MapUnit::MapAppFont ); - Size aExplSize = LogicToPixel( aLogExplSize, MapUnit::MapAppFont ); + Point aExplPos = LogicToPixel(Point(3,3), MapMode(MapUnit::MapAppFont)); + Size aExplSize = LogicToPixel(aLogExplSize, MapMode(MapUnit::MapAppFont)); m_pNavigator->SetPosSizePixel( aExplPos, aExplSize ); } diff --git a/svx/source/form/fmexpl.cxx b/svx/source/form/fmexpl.cxx index 7c0377254b1a..c798bd28b9fd 100644 --- a/svx/source/form/fmexpl.cxx +++ b/svx/source/form/fmexpl.cxx @@ -558,13 +558,13 @@ namespace svxform { SfxDockingWindow::Resize(); - Size aLogOutputSize = PixelToLogic( GetOutputSizePixel(), MapUnit::MapAppFont ); + Size aLogOutputSize = PixelToLogic(GetOutputSizePixel(), MapMode(MapUnit::MapAppFont)); Size aLogExplSize = aLogOutputSize; aLogExplSize.Width() -= 6; aLogExplSize.Height() -= 6; - Point aExplPos = LogicToPixel( Point(3,3), MapUnit::MapAppFont ); - Size aExplSize = LogicToPixel( aLogExplSize, MapUnit::MapAppFont ); + Point aExplPos = LogicToPixel(Point(3, 3), MapMode(MapUnit::MapAppFont)); + Size aExplSize = LogicToPixel(aLogExplSize, MapMode(MapUnit::MapAppFont)); m_pNavigatorTree->SetPosSizePixel( aExplPos, aExplSize ); } diff --git a/svx/source/gallery2/GalleryControl.cxx b/svx/source/gallery2/GalleryControl.cxx index aafa1161ce4d..8fec8739b291 100644 --- a/svx/source/gallery2/GalleryControl.cxx +++ b/svx/source/gallery2/GalleryControl.cxx @@ -131,7 +131,7 @@ void GalleryControl::Resize() } mbIsInitialResize = false; - const long nFrameLen = LogicToPixel( Size( 3, 0 ), MapUnit::MapAppFont ).Width(); + const long nFrameLen = LogicToPixel(Size(3, 0), MapMode(MapUnit::MapAppFont)).Width(); const long nFrameLen2 = nFrameLen << 1; if(bNewLayoutHorizontal) diff --git a/svx/source/gallery2/galbrws1.cxx b/svx/source/gallery2/galbrws1.cxx index cd34c6397357..447c26dd7c72 100644 --- a/svx/source/gallery2/galbrws1.cxx +++ b/svx/source/gallery2/galbrws1.cxx @@ -181,7 +181,7 @@ sal_uIntPtr GalleryBrowser1::ImplInsertThemeEntry( const GalleryThemeEntry* pEnt void GalleryBrowser1::ImplAdjustControls() { const Size aOutSize( GetOutputSizePixel() ); - const long nNewThemeHeight = LogicToPixel( Size( 0, 14 ), MapUnit::MapAppFont ).Height(); + const long nNewThemeHeight = LogicToPixel(Size(0, 14), MapMode(MapUnit::MapAppFont)).Height(); const long nStartY = nNewThemeHeight + 4; maNewTheme->SetPosSizePixel( Point(), diff --git a/svx/source/gallery2/galctrl.cxx b/svx/source/gallery2/galctrl.cxx index 0c156cd165d5..b711cbe21244 100644 --- a/svx/source/gallery2/galctrl.cxx +++ b/svx/source/gallery2/galctrl.cxx @@ -54,7 +54,7 @@ VCL_BUILDER_FACTORY_CONSTRUCTOR(GalleryPreview, WB_TABSTOP) Size GalleryPreview::GetOptimalSize() const { - return LogicToPixel(Size(70, 88), MapUnit::MapAppFont); + return LogicToPixel(Size(70, 88), MapMode(MapUnit::MapAppFont)); } bool GalleryPreview::SetGraphic( const INetURLObject& _aURL ) diff --git a/svx/source/gallery2/galobj.cxx b/svx/source/gallery2/galobj.cxx index d5fe56acde82..52ec75aafea0 100644 --- a/svx/source/gallery2/galobj.cxx +++ b/svx/source/gallery2/galobj.cxx @@ -105,7 +105,7 @@ bool SgaObject::CreateThumb( const Graphic& rGraphic ) aBmpEx.GetPrefSize().Width() > 0 && aBmpEx.GetPrefSize().Height() > 0 ) { - Size aLogSize( OutputDevice::LogicToLogic( aBmpEx.GetPrefSize(), aBmpEx.GetPrefMapMode(), MapUnit::Map100thMM ) ); + Size aLogSize( OutputDevice::LogicToLogic(aBmpEx.GetPrefSize(), aBmpEx.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) ); if( aLogSize.Width() > 0 && aLogSize.Height() > 0 ) { diff --git a/svx/source/sdr/contact/viewcontactofgraphic.cxx b/svx/source/sdr/contact/viewcontactofgraphic.cxx index 40a88daa4962..7b202510c75a 100644 --- a/svx/source/sdr/contact/viewcontactofgraphic.cxx +++ b/svx/source/sdr/contact/viewcontactofgraphic.cxx @@ -109,11 +109,11 @@ namespace sdr if(MapUnit::MapPixel == GetGrafObject().GetGrafPrefMapMode().GetMapUnit()) { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapUnit::Map100thMM); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM)); } else { - aPrefSize = OutputDevice::LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MapUnit::Map100thMM); + aPrefSize = OutputDevice::LogicToLogic(aPrefSize, GetGrafObject().GetGrafPrefMapMode(), MapMode(MapUnit::Map100thMM)); } // decompose object matrix to get single values @@ -201,11 +201,11 @@ namespace sdr if(MapUnit::MapPixel == aDraftBitmap.GetPrefMapMode().GetMapUnit()) { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MapUnit::Map100thMM); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aDraftBitmap.GetSizePixel(), MapMode(MapUnit::Map100thMM)); } else { - aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MapUnit::Map100thMM); + aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aDraftBitmap.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)); } const double fBitmapScaling(2.0); diff --git a/svx/source/sdr/overlay/overlayobjectlist.cxx b/svx/source/sdr/overlay/overlayobjectlist.cxx index 27baa4853df6..813a01205b90 100644 --- a/svx/source/sdr/overlay/overlayobjectlist.cxx +++ b/svx/source/sdr/overlay/overlayobjectlist.cxx @@ -76,7 +76,7 @@ namespace sdr { aSizeLogic = Size(DEFAULT_VALUE_FOR_HITTEST_TWIP, DEFAULT_VALUE_FOR_HITTEST_TWIP); if (pManager->getOutputDevice().GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aSizeLogic = OutputDevice::LogicToLogic(aSizeLogic, MapUnit::MapTwip, MapUnit::Map100thMM); + aSizeLogic = OutputDevice::LogicToLogic(aSizeLogic, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM)); } fLogicTolerance = aSizeLogic.Width(); diff --git a/svx/source/sdr/primitive2d/sdrattributecreator.cxx b/svx/source/sdr/primitive2d/sdrattributecreator.cxx index f0903f5d6b15..e68d05fb673e 100644 --- a/svx/source/sdr/primitive2d/sdrattributecreator.cxx +++ b/svx/source/sdr/primitive2d/sdrattributecreator.cxx @@ -643,7 +643,7 @@ namespace drawinglayer if(GraphicType::Bitmap == aGraphic.GetType()) { aGraphic.SetPrefSize(aGraphic.GetBitmapEx().GetSizePixel()); - aGraphic.SetPrefMapMode(MapUnit::MapPixel); + aGraphic.SetPrefMapMode(MapMode(MapUnit::MapPixel)); } } @@ -658,7 +658,7 @@ namespace drawinglayer const MapUnit aDestinationMapUnit(rSet.GetPool()->GetMetric(0)); basegfx::B2DVector aGraphicLogicSize(aGraphic.GetPrefSize().Width(), aGraphic.GetPrefSize().Height()); - if(aGraphic.GetPrefMapMode() != aDestinationMapUnit) + if (aGraphic.GetPrefMapMode().GetMapUnit() != aDestinationMapUnit) { // #i100360# for MapUnit::MapPixel, LogicToLogic will not work properly, // so fallback to Application::GetDefaultDevice() @@ -668,14 +668,14 @@ namespace drawinglayer { aNewSize = Application::GetDefaultDevice()->PixelToLogic( aGraphic.GetPrefSize(), - aDestinationMapUnit); + MapMode(aDestinationMapUnit)); } else { aNewSize = OutputDevice::LogicToLogic( aGraphic.GetPrefSize(), aGraphic.GetPrefMapMode(), - aDestinationMapUnit); + MapMode(aDestinationMapUnit)); } // #i124002# do not set new size using SetPrefSize at the graphic, this will lead to problems. diff --git a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx index ff77dad9b9bb..fae9ccfdfc1e 100644 --- a/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx +++ b/svx/source/sdr/primitive2d/sdrolecontentprimitive2d.cxx @@ -74,11 +74,11 @@ namespace drawinglayer if(MapUnit::MapPixel == aGraphic.GetPrefMapMode().GetMapUnit()) { - aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapUnit::Map100thMM); + aPrefSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM)); } else { - aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MapUnit::Map100thMM); + aPrefSize = OutputDevice::LogicToLogic(aPrefSize, aGraphic.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)); } const double fOffsetX((aScale.getX() - aPrefSize.getWidth()) / 2.0); diff --git a/svx/source/sidebar/line/LineWidthValueSet.cxx b/svx/source/sidebar/line/LineWidthValueSet.cxx index 9c31541f46e0..6ed3d9edf2d1 100644 --- a/svx/source/sidebar/line/LineWidthValueSet.cxx +++ b/svx/source/sidebar/line/LineWidthValueSet.cxx @@ -173,7 +173,7 @@ void LineWidthValueSet::UserDraw( const UserDrawEvent& rUDEvt ) Size LineWidthValueSet::GetOptimalSize() const { - return LogicToPixel(Size(80, 12 * 9), MapUnit::MapAppFont); + return LogicToPixel(Size(80, 12 * 9), MapMode(MapUnit::MapAppFont)); } } } // end of namespace svx::sidebar diff --git a/svx/source/sidebar/nbdtmg.cxx b/svx/source/sidebar/nbdtmg.cxx index 629f4ba26523..ac757f1a351d 100644 --- a/svx/source/sidebar/nbdtmg.cxx +++ b/svx/source/sidebar/nbdtmg.cxx @@ -851,7 +851,7 @@ void OutlineTypeMgr::ApplyNumRule(SvxNumRule& aNum, sal_uInt16 nIndex, sal_uInt1 aSize = SvxNumberFormat::GetGraphicSizeMM100( pGrf ); } } - aSize = OutputDevice::LogicToLogic(aSize, MapUnit::Map100thMM, GetMapUnit()); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(GetMapUnit())); aFmt.SetGraphicBrush( pLevelSettings->pBrushItem, &aSize, &eOrient ); } } else diff --git a/svx/source/sidebar/possize/SidebarDialControl.cxx b/svx/source/sidebar/possize/SidebarDialControl.cxx index 831fcbca1266..a934a9a08ebb 100644 --- a/svx/source/sidebar/possize/SidebarDialControl.cxx +++ b/svx/source/sidebar/possize/SidebarDialControl.cxx @@ -34,7 +34,7 @@ VCL_BUILDER_FACTORY_ARGS(SidebarDialControl, WB_TABSTOP) Size SidebarDialControl::GetOptimalSize() const { - return LogicToPixel(Size(10, 10), MapUnit::MapAppFont); + return LogicToPixel(Size(10, 10), MapMode(MapUnit::MapAppFont)); } void SidebarDialControl::MouseButtonDown( const MouseEvent& rMEvt ) diff --git a/svx/source/styles/CommonStylePreviewRenderer.cxx b/svx/source/styles/CommonStylePreviewRenderer.cxx index ab1d05fb94ed..9928960034e1 100644 --- a/svx/source/styles/CommonStylePreviewRenderer.cxx +++ b/svx/source/styles/CommonStylePreviewRenderer.cxx @@ -148,7 +148,7 @@ bool CommonStylePreviewRenderer::recalculate() { const SvxFontHeightItem* pFontHeightItem = static_cast<const SvxFontHeightItem*>(pItem); Size aFontSize(0, pFontHeightItem->GetHeight()); - maPixelSize = mrOutputDev.LogicToPixel(aFontSize, mrShell.GetMapUnit()); + maPixelSize = mrOutputDev.LogicToPixel(aFontSize, MapMode(mrShell.GetMapUnit())); pFont->SetFontSize(maPixelSize); vcl::Font aOldFont(mrOutputDev.GetFont()); diff --git a/svx/source/svdraw/sdrpagewindow.cxx b/svx/source/svdraw/sdrpagewindow.cxx index b727cfdccdc0..bd839fa6dcef 100644 --- a/svx/source/svdraw/sdrpagewindow.cxx +++ b/svx/source/svdraw/sdrpagewindow.cxx @@ -444,7 +444,7 @@ void SdrPageWindow::InvalidatePageWindow(const basegfx::B2DRange& rRange) static_cast<long>(ceil(rRange.getMaxX())), static_cast<long>(ceil(rRange.getMaxY()))); - const tools::Rectangle aRectTwips = OutputDevice::LogicToLogic(aRect100thMM, MapUnit::Map100thMM, MapUnit::MapTwip); + const tools::Rectangle aRectTwips = OutputDevice::LogicToLogic(aRect100thMM, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); if (SfxViewShell* pViewShell = SfxViewShell::Current()) SfxLokHelper::notifyInvalidation(pViewShell, aRectTwips.toString()); diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx index e44ece39364f..072b0ca84478 100644 --- a/svx/source/svdraw/svdmrkv.cxx +++ b/svx/source/svdraw/svdmrkv.cxx @@ -229,7 +229,7 @@ void SdrMarkView::ModelHasChanged() if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice()) { if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip); + aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); } } @@ -790,7 +790,7 @@ void SdrMarkView::SetMarkHandles(SfxViewShell* pOtherShell) if (OutputDevice* pOutputDevice = mpMarkedPV->GetView().GetFirstOutputDevice()) { if (pOutputDevice->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) - aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip); + aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); } } diff --git a/svx/source/svdraw/svdograf.cxx b/svx/source/svdraw/svdograf.cxx index d34c02ed9f9e..9745cd84b632 100644 --- a/svx/source/svdraw/svdograf.cxx +++ b/svx/source/svdraw/svdograf.cxx @@ -591,9 +591,9 @@ Size SdrGrafObj::getOriginalSize() const } if ( GetGrafPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) - aSize = Application::GetDefaultDevice()->PixelToLogic( aSize, GetModel()->GetScaleUnit() ); + aSize = Application::GetDefaultDevice()->PixelToLogic(aSize, MapMode(GetModel()->GetScaleUnit())); else - aSize = OutputDevice::LogicToLogic( aSize, GetGrafPrefMapMode(), GetModel()->GetScaleUnit() ); + aSize = OutputDevice::LogicToLogic(aSize, GetGrafPrefMapMode(), MapMode(GetModel()->GetScaleUnit())); return aSize; } @@ -1275,7 +1275,7 @@ void SdrGrafObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrink Size aSize; Size aMaxSize( rMaxRect.GetSize() ); if ( pGraphic->GetPrefMapMode().GetMapUnit() == MapUnit::MapPixel ) - aSize = Application::GetDefaultDevice()->PixelToLogic( pGraphic->GetPrefSize(), MapUnit::Map100thMM ); + aSize = Application::GetDefaultDevice()->PixelToLogic( pGraphic->GetPrefSize(), MapMode(MapUnit::Map100thMM)); else aSize = OutputDevice::LogicToLogic( pGraphic->GetPrefSize(), pGraphic->GetPrefMapMode(), diff --git a/svx/source/svdraw/svdomedia.cxx b/svx/source/svdraw/svdomedia.cxx index 1dc58e0e258b..204d6d9a84f3 100644 --- a/svx/source/svdraw/svdomedia.cxx +++ b/svx/source/svdraw/svdomedia.cxx @@ -186,7 +186,7 @@ void SdrMediaObj::AdjustToMaxRect( const tools::Rectangle& rMaxRect, bool bShrin { Size aSize( Application::GetDefaultDevice()->PixelToLogic( static_cast< sdr::contact::ViewContactOfSdrMediaObj& >( GetViewContact() ).getPreferredSize(), - MapUnit::Map100thMM ) ); + MapMode(MapUnit::Map100thMM)) ); Size aMaxSize( rMaxRect.GetSize() ); if( aSize.Height() != 0 && aSize.Width() != 0 ) diff --git a/svx/source/svdraw/svdoole2.cxx b/svx/source/svdraw/svdoole2.cxx index a6141cbdbfde..a43c341193db 100644 --- a/svx/source/svdraw/svdoole2.cxx +++ b/svx/source/svdraw/svdoole2.cxx @@ -245,7 +245,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj } aVisArea.SetSize( Size( aSz.Width, aSz.Height ) ); - aVisArea = OutputDevice::LogicToLogic( aVisArea, aObjMapUnit, aContainerMapUnit ); + aVisArea = OutputDevice::LogicToLogic(aVisArea, MapMode(aObjMapUnit), MapMode(aContainerMapUnit)); Size aScaledSize( static_cast< long >( m_aScaleWidth * Fraction( aVisArea.GetWidth() ) ), static_cast< long >( m_aScaleHeight * Fraction( aVisArea.GetHeight() ) ) ); tools::Rectangle aLogicRect( mpObj->GetLogicRect() ); @@ -255,7 +255,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::notifyEvent( const document::EventObj Application::GetDefaultDevice()->LogicToPixel( Size( aLogicRect.GetWidth() - aScaledSize.Width(), aLogicRect.GetHeight() - aScaledSize.Height() ), - aContainerMapUnit ); + MapMode(aContainerMapUnit)); if( aPixelDiff.Width() || aPixelDiff.Height() ) { mpObj->SetLogicRect( tools::Rectangle( aLogicRect.TopLeft(), aScaledSize ) ); @@ -437,7 +437,7 @@ awt::Rectangle SAL_CALL SdrLightEmbeddedClient_Impl::getPlacement() if ( xParentVis.is() ) aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) ); - aLogicRect = Application::GetDefaultDevice()->LogicToPixel(aLogicRect,aContainerMapUnit); + aLogicRect = Application::GetDefaultDevice()->LogicToPixel(aLogicRect, MapMode(aContainerMapUnit)); return AWTRectangle( aLogicRect ); } @@ -476,7 +476,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl if ( xParentVis.is() ) aContainerMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xParentVis->getMapUnit( mpObj->GetAspect() ) ); - tools::Rectangle aNewLogicRect = Application::GetDefaultDevice()->PixelToLogic(aNewPixelRect,aContainerMapUnit); + tools::Rectangle aNewLogicRect = Application::GetDefaultDevice()->PixelToLogic(aNewPixelRect, MapMode(aContainerMapUnit)); tools::Rectangle aLogicRect = impl_getScaledRect_nothrow(); if ( aNewLogicRect != aLogicRect ) @@ -496,7 +496,7 @@ void SAL_CALL SdrLightEmbeddedClient_Impl::changedPlacement( const awt::Rectangl Application::GetDefaultDevice()->LogicToPixel( Size( aLogicRect.GetWidth() - aNewObjSize.Width(), aLogicRect.GetHeight() - aNewObjSize.Height() ), - aContainerMapUnit ); + MapMode(aContainerMapUnit)); if( aPixelDiff.Width() || aPixelDiff.Height() ) { mpObj->SetLogicRect( tools::Rectangle( aLogicRect.TopLeft(), aNewObjSize ) ); @@ -1531,7 +1531,7 @@ void SdrOle2Obj::ImpSetVisAreaSize() Size aVisSize( (long)( Fraction( maRect.GetWidth() ) / aScaleWidth ), (long)( Fraction( maRect.GetHeight() ) / aScaleHeight ) ); - aVisSize = OutputDevice::LogicToLogic( aVisSize, pModel->GetScaleUnit(), aMapUnit); + aVisSize = OutputDevice::LogicToLogic(aVisSize, MapMode(pModel->GetScaleUnit()), MapMode(aMapUnit)); awt::Size aSz; aSz.Width = aVisSize.Width(); aSz.Height = aVisSize.Height(); @@ -1552,7 +1552,7 @@ void SdrOle2Obj::ImpSetVisAreaSize() // server changed VisArea to its liking and the VisArea is different than the suggested one // store the new value as given by the object MapUnit aNewMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) ); - maRect.SetSize(OutputDevice::LogicToLogic( aAcceptedVisArea.GetSize(), aNewMapUnit, pModel->GetScaleUnit())); + maRect.SetSize(OutputDevice::LogicToLogic(aAcceptedVisArea.GetSize(), MapMode(aNewMapUnit), MapMode(pModel->GetScaleUnit()))); } // make the new object area known to the client @@ -1601,8 +1601,8 @@ void SdrOle2Obj::ImpSetVisAreaSize() MapUnit aMapUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( mpImpl->mxObjRef->getMapUnit( GetAspect() ) ); Point aTL( maRect.TopLeft() ); Point aBR( maRect.BottomRight() ); - Point aTL2( OutputDevice::LogicToLogic( aTL, pModel->GetScaleUnit(), aMapUnit) ); - Point aBR2( OutputDevice::LogicToLogic( aBR, pModel->GetScaleUnit(), aMapUnit) ); + Point aTL2(OutputDevice::LogicToLogic(aTL, MapMode(pModel->GetScaleUnit()), MapMode(aMapUnit))); + Point aBR2(OutputDevice::LogicToLogic(aBR, MapMode(pModel->GetScaleUnit()), MapMode(aMapUnit))); tools::Rectangle aNewRect( aTL2, aBR2 ); xVisualObject->setVisualAreaSize( GetAspect(), awt::Size( aNewRect.GetWidth(), aNewRect.GetHeight() ) ); } diff --git a/svx/source/table/tablecontroller.cxx b/svx/source/table/tablecontroller.cxx index 2ffa6c6b1f83..f12b7b1d4e67 100644 --- a/svx/source/table/tablecontroller.cxx +++ b/svx/source/table/tablecontroller.cxx @@ -2130,9 +2130,9 @@ void SvxTableController::updateSelectionOverlay() if (pOutDev->GetMapMode().GetMapUnit() == MapUnit::Map100thMM) { - aSelectionStart = OutputDevice::LogicToLogic(aSelectionStart, MapUnit::Map100thMM, MapUnit::MapTwip); - aSelectionEnd = OutputDevice::LogicToLogic(aSelectionEnd, MapUnit::Map100thMM, MapUnit::MapTwip); - aSelection = OutputDevice::LogicToLogic(aSelection, MapUnit::Map100thMM, MapUnit::MapTwip); + aSelectionStart = OutputDevice::LogicToLogic(aSelectionStart, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); + aSelectionEnd = OutputDevice::LogicToLogic(aSelectionEnd, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); + aSelection = OutputDevice::LogicToLogic(aSelection, MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapTwip)); } if(SfxViewShell* pViewShell = SfxViewShell::Current()) diff --git a/svx/source/tbxctrls/bulletsnumbering.cxx b/svx/source/tbxctrls/bulletsnumbering.cxx index 1ca937bed72d..07f48303600f 100644 --- a/svx/source/tbxctrls/bulletsnumbering.cxx +++ b/svx/source/tbxctrls/bulletsnumbering.cxx @@ -92,7 +92,7 @@ NumberingPopup::NumberingPopup( NumberingToolBoxControl& rController, } } - Size aItemSize( LogicToPixel( Size( 30, 42 ), MapUnit::MapAppFont ) ); + Size aItemSize(LogicToPixel(Size(30, 42), MapMode(MapUnit::MapAppFont))); mpValueSet->SetExtraSpacing( 2 ); mpValueSet->SetOutputSizePixel( mpValueSet->CalcWindowSizePixel( aItemSize ) ); mpValueSet->SetColor( GetSettings().GetStyleSettings().GetFieldColor() ); diff --git a/svx/source/tbxctrls/fillctrl.cxx b/svx/source/tbxctrls/fillctrl.cxx index 00ff498e3b63..f763b7869825 100644 --- a/svx/source/tbxctrls/fillctrl.cxx +++ b/svx/source/tbxctrls/fillctrl.cxx @@ -890,7 +890,7 @@ void FillControl::Resize() void FillControl::SetOptimalSize() { const Size aLogicalAttrSize(50,0); - Size aSize(LogicToPixel(aLogicalAttrSize,MapUnit::MapAppFont)); + Size aSize(LogicToPixel(aLogicalAttrSize, MapMode(MapUnit::MapAppFont))); Point aAttrPnt = mpLbFillAttr->GetPosPixel(); diff --git a/svx/source/tbxctrls/fontworkgallery.cxx b/svx/source/tbxctrls/fontworkgallery.cxx index e57e9b624a3a..45bca9404639 100644 --- a/svx/source/tbxctrls/fontworkgallery.cxx +++ b/svx/source/tbxctrls/fontworkgallery.cxx @@ -77,7 +77,7 @@ FontWorkGalleryDialog::FontWorkGalleryDialog( SdrView* pSdrView, vcl::Window* pP { get(mpOKButton, "ok"); get(mpCtlFavorites, "ctlFavorites"); - Size aSize(LogicToPixel(Size(200, 200), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(200, 200), MapMode(MapUnit::MapAppFont))); mpCtlFavorites->set_width_request(aSize.Width()); mpCtlFavorites->set_height_request(aSize.Height()); diff --git a/svx/source/tbxctrls/itemwin.cxx b/svx/source/tbxctrls/itemwin.cxx index c59cd6721944..2bc48400da49 100644 --- a/svx/source/tbxctrls/itemwin.cxx +++ b/svx/source/tbxctrls/itemwin.cxx @@ -60,7 +60,7 @@ SvxLineBox::SvxLineBox( vcl::Window* pParent, const Reference< XFrame >& rFrame mpSh ( nullptr ), mxFrame ( rFrame ) { - SetSizePixel( LogicToPixel( aLogicalSize, MapUnit::MapAppFont )); + SetSizePixel(LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont))); Show(); aDelayTimer.SetTimeout( DELAY_TIMEOUT ); @@ -221,7 +221,7 @@ void SvxLineBox::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) { - SetSizePixel(LogicToPixel(aLogicalSize, MapUnit::MapAppFont)); + SetSizePixel(LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont))); } LineLB::DataChanged( rDCEvt ); @@ -250,7 +250,7 @@ SvxMetricField::SvxMetricField( { Size aSize( CalcMinimumSize() ); SetSizePixel( aSize ); - aLogicalSize = PixelToLogic(aSize, MapUnit::MapAppFont); + aLogicalSize = PixelToLogic(aSize, MapMode(MapUnit::MapAppFont)); SetUnit( FUNIT_MM ); SetDecimalDigits( 2 ); SetMax( 5000 ); @@ -374,7 +374,7 @@ void SvxMetricField::DataChanged( const DataChangedEvent& rDCEvt ) if ( (rDCEvt.GetType() == DataChangedEventType::SETTINGS) && (rDCEvt.GetFlags() & AllSettingsFlags::STYLE) ) { - SetSizePixel(LogicToPixel(aLogicalSize, MapUnit::MapAppFont)); + SetSizePixel(LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont))); } MetricField::DataChanged( rDCEvt ); @@ -385,7 +385,7 @@ SvxFillTypeBox::SvxFillTypeBox( vcl::Window* pParent ) : nCurPos ( 0 ), bSelect ( false ) { - SetSizePixel( LogicToPixel( Size(40, 40 ),MapUnit::MapAppFont )); + SetSizePixel(LogicToPixel(Size(40, 40), MapMode(MapUnit::MapAppFont))); Fill(); SelectEntryPos( (sal_Int32)drawing::FillStyle_SOLID ); Show(); @@ -464,7 +464,7 @@ SvxFillAttrBox::SvxFillAttrBox( vcl::Window* pParent ) : nCurPos( 0 ) { SetPosPixel( Point( 90, 0 ) ); - SetSizePixel( LogicToPixel( Size(50, 80 ), MapUnit::MapAppFont )); + SetSizePixel(LogicToPixel(Size(50, 80), MapMode(MapUnit::MapAppFont))); Show(); } diff --git a/svx/source/tbxctrls/lboxctrl.cxx b/svx/source/tbxctrls/lboxctrl.cxx index 1f5df981716e..8209c41e8f28 100644 --- a/svx/source/tbxctrls/lboxctrl.cxx +++ b/svx/source/tbxctrls/lboxctrl.cxx @@ -81,7 +81,7 @@ SvxPopupWindowListBox::SvxPopupWindowListBox(sal_uInt16 nSlotId, const OUString& WinBits nBits(m_pListBox->GetStyle()); nBits &= ~WB_SIMPLEMODE; m_pListBox->SetStyle(nBits); - Size aSize(LogicToPixel(Size(100, 85), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(100, 85), MapMode(MapUnit::MapAppFont))); m_pListBox->set_width_request(aSize.Width()); m_pListBox->set_height_request(aSize.Height()); m_pListBox->EnableMultiSelection( true, true ); diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx index f5194489338b..b23170484d7b 100644 --- a/svx/source/tbxctrls/tbcontrl.cxx +++ b/svx/source/tbxctrls/tbcontrl.cxx @@ -620,7 +620,7 @@ bool SvxStyleBox_Impl::AdjustFontForItemHeight(OutputDevice* pDevice, tools::Rec void SvxStyleBox_Impl::SetOptimalSize() { - Size aSize(LogicToPixel(aLogicalSize, MapUnit::MapAppFont)); + Size aSize(LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont))); set_width_request(aSize.Width()); set_height_request(aSize.Height()); SetSizePixel(aSize); @@ -683,7 +683,7 @@ void SvxStyleBox_Impl::SetupEntry(vcl::RenderContext& rRenderContext, vcl::Windo if ( pFontItem && pFontHeightItem ) { Size aFontSize( 0, pFontHeightItem->GetHeight() ); - Size aPixelSize(rRenderContext.LogicToPixel(aFontSize, pShell->GetMapUnit())); + Size aPixelSize(rRenderContext.LogicToPixel(aFontSize, MapMode(pShell->GetMapUnit()))); // setup the font properties SvxFont aFont; @@ -1098,7 +1098,7 @@ bool SvxFontNameBox_Impl::EventNotify( NotifyEvent& rNEvt ) void SvxFontNameBox_Impl::SetOptimalSize() { - Size aSize(LogicToPixel(aLogicalSize, MapUnit::MapAppFont)); + Size aSize(LogicToPixel(aLogicalSize, MapMode(MapUnit::MapAppFont))); set_width_request(aSize.Width()); set_height_request(aSize.Height()); SetSizePixel(aSize); diff --git a/svx/source/tbxctrls/tbunocontroller.cxx b/svx/source/tbxctrls/tbunocontroller.cxx index acdf84fbd6f5..cca2876053f9 100644 --- a/svx/source/tbxctrls/tbunocontroller.cxx +++ b/svx/source/tbxctrls/tbunocontroller.cxx @@ -245,7 +245,7 @@ bool SvxFontSizeBox_Impl::EventNotify( NotifyEvent& rNEvt ) void SvxFontSizeBox_Impl::SetOptimalSize() { - Size aPrefSize(LogicToPixel(m_aLogicalSize, MapUnit::MapAppFont)); + Size aPrefSize(LogicToPixel(m_aLogicalSize, MapMode(MapUnit::MapAppFont))); aPrefSize.Width() = get_preferred_size().Width(); SetSizePixel(aPrefSize); } diff --git a/svx/source/unodraw/unoshap4.cxx b/svx/source/unodraw/unoshap4.cxx index 0c0da807f5e2..4386f9a59d7d 100644 --- a/svx/source/unodraw/unoshap4.cxx +++ b/svx/source/unodraw/unoshap4.cxx @@ -98,7 +98,7 @@ bool SvxOle2Shape::setPropertyValueImpl( const OUString& rName, const SfxItemPro { // the API handles with MapUnit::Map100thMM map mode MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( embed::Aspects::MSOLE_CONTENT ) ); - aTmp = OutputDevice::LogicToLogic( aTmp, MapUnit::Map100thMM, aObjUnit ); + aTmp = OutputDevice::LogicToLogic(aTmp, MapMode(MapUnit::Map100thMM), MapMode(aObjUnit)); xObj->setVisualAreaSize( embed::Aspects::MSOLE_CONTENT, awt::Size( aTmp.Width(), aTmp.Height() ) ); } catch( uno::Exception& ) diff --git a/svx/source/unodraw/unoshape.cxx b/svx/source/unodraw/unoshape.cxx index 4ab0f675625f..9b32265423c5 100644 --- a/svx/source/unodraw/unoshape.cxx +++ b/svx/source/unodraw/unoshape.cxx @@ -702,7 +702,7 @@ uno::Any SvxShape::GetBitmap( bool bMetaFile /* = false */ ) const { Graphic aGraph(aMtf); aGraph.SetPrefSize(aSize); - aGraph.SetPrefMapMode(MapUnit::Map100thMM); + aGraph.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); Reference< awt::XBitmap > xBmp( aGraph.GetXGraphic(), UNO_QUERY ); aAny <<= xBmp; diff --git a/svx/source/xoutdev/_xoutbmp.cxx b/svx/source/xoutdev/_xoutbmp.cxx index 60f809d566fe..bd16f0113c65 100644 --- a/svx/source/xoutdev/_xoutbmp.cxx +++ b/svx/source/xoutdev/_xoutbmp.cxx @@ -280,7 +280,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GraphicType::Bitmap ) ) { ScopedVclPtrInstance< VirtualDevice > pVDev; - const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MapUnit::Map100thMM ) ); + const Size aSize(pVDev->LogicToPixel(*pMtfSize_100TH_MM, MapMode(MapUnit::Map100thMM))); if( pVDev->SetOutputSizePixel( aSize ) ) { @@ -313,7 +313,7 @@ ErrCode XOutBitmap::WriteGraphic( const Graphic& rGraphic, OUString& rFileName, if( pMtfSize_100TH_MM && ( rGraphic.GetType() != GraphicType::Bitmap ) ) { ScopedVclPtrInstance< VirtualDevice > pVDev; - const Size aSize( pVDev->LogicToPixel( *pMtfSize_100TH_MM, MapUnit::Map100thMM ) ); + const Size aSize(pVDev->LogicToPixel(*pMtfSize_100TH_MM, MapMode(MapUnit::Map100thMM))); if( pVDev->SetOutputSizePixel( aSize ) ) { diff --git a/svx/source/xoutdev/xtabdash.cxx b/svx/source/xoutdev/xtabdash.cxx index 815f0b1105f5..492731d52fa6 100644 --- a/svx/source/xoutdev/xtabdash.cxx +++ b/svx/source/xoutdev/xtabdash.cxx @@ -101,7 +101,7 @@ Bitmap XDashList::ImpCreateBitmapForXDash(const XDash* pDash) if(pDash && (pDash->GetDots() || pDash->GetDashes())) { - const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MapUnit::Map100thMM, MapUnit::MapPixel)); + const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapPixel))); const basegfx::B2DVector aScaleVector(aScaleMatrix * basegfx::B2DVector(1.0, 0.0)); const double fScaleValue(aScaleVector.getLength() * (nFactor * (1.4 / 2.0))); const double fLineWidthInUnits(fLineWidth / fScaleValue); diff --git a/svx/source/xoutdev/xtabhtch.cxx b/svx/source/xoutdev/xtabhtch.cxx index 97dd8fd76ee9..8d0dcaeb9800 100644 --- a/svx/source/xoutdev/xtabhtch.cxx +++ b/svx/source/xoutdev/xtabhtch.cxx @@ -112,7 +112,7 @@ Bitmap XHatchList::CreateBitmap( long nIndex, const Size& rSize) const } } - const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MapUnit::Map100thMM, MapUnit::MapPixel)); + const basegfx::B2DHomMatrix aScaleMatrix(OutputDevice::LogicToLogic(MapMode(MapUnit::Map100thMM), MapMode(MapUnit::MapPixel))); const basegfx::B2DVector aScaleVector(aScaleMatrix * basegfx::B2DVector(1.0, 0.0)); const double fScaleValue(aScaleVector.getLength()); diff --git a/sw/source/core/unocore/unoframe.cxx b/sw/source/core/unocore/unoframe.cxx index 87828b3eb23e..5f54e2daf937 100644 --- a/sw/source/core/unocore/unoframe.cxx +++ b/sw/source/core/unocore/unoframe.cxx @@ -2948,11 +2948,11 @@ void SwXFrame::attachToRange(const uno::Reference< text::XTextRange > & xTextRan if ( !aSz.Width() || !aSz.Height() ) { aSz.Width() = aSz.Height() = 5000; - aSz = OutputDevice::LogicToLogic - ( aSz, MapMode( MapUnit::Map100thMM ), aRefMap ); + aSz = OutputDevice::LogicToLogic(aSz, + MapMode(MapUnit::Map100thMM), MapMode(aRefMap)); } MapMode aMyMap( MapUnit::MapTwip ); - aSz = OutputDevice::LogicToLogic( aSz, aRefMap, aMyMap ); + aSz = OutputDevice::LogicToLogic(aSz, MapMode(aRefMap), aMyMap); SwFormatFrameSize aFrameSz; aFrameSz.SetSize(aSz); aFrameSet.Put(aFrameSz); diff --git a/sw/source/filter/ww8/ww8par3.cxx b/sw/source/filter/ww8/ww8par3.cxx index 1c0c9eeccdf8..51f9a7588cf0 100644 --- a/sw/source/filter/ww8/ww8par3.cxx +++ b/sw/source/filter/ww8/ww8par3.cxx @@ -2329,8 +2329,8 @@ awt::Size SwWW8ImplReader::MiserableDropDownFormHack(const OUString &rString, static_cast<const SvxFontHeightItem*>(pItem)->GetHeight() ); aTmp <<= ((float)aSize.Height()) / 20.0; - aFont.SetFontSize(OutputDevice::LogicToLogic(aSize, MapUnit::MapTwip, - MapUnit::Map100thMM)); + aFont.SetFontSize(OutputDevice::LogicToLogic(aSize, + MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM))); } break; diff --git a/sw/source/filter/ww8/ww8par4.cxx b/sw/source/filter/ww8/ww8par4.cxx index 52249be91ca7..7ee6fac81825 100644 --- a/sw/source/filter/ww8/ww8par4.cxx +++ b/sw/source/filter/ww8/ww8par4.cxx @@ -271,7 +271,7 @@ SwFrameFormat* SwWW8ImplReader::ImportOle(const Graphic* pGrf, pTempSet->Put( aAnchor ); const Size aSizeTwip = OutputDevice::LogicToLogic( - aGraph.GetPrefSize(), aGraph.GetPrefMapMode(), MapUnit::MapTwip ); + aGraph.GetPrefSize(), aGraph.GetPrefMapMode(), MapMode(MapUnit::MapTwip)); pTempSet->Put( SwFormatFrameSize( ATT_FIX_SIZE, aSizeTwip.Width(), aSizeTwip.Height() ) ); @@ -321,7 +321,7 @@ bool SwWW8ImplReader::ImportOleWMF(tools::SvRef<SotStorage> xSrc1,GDIMetaFile &r aFinalSize.Width() = rX; aFinalSize.Height() = rY; aFinalSize = OutputDevice::LogicToLogic( - aFinalSize, MapUnit::MapTwip, rWMF.GetPrefMapMode() ); + aFinalSize, MapMode(MapUnit::MapTwip), rWMF.GetPrefMapMode() ); aOrigSize = rWMF.GetPrefSize(); Fraction aScaleX(aFinalSize.Width(),aOrigSize.Width()); Fraction aScaleY(aFinalSize.Height(),aOrigSize.Height()); @@ -356,7 +356,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, { rGraph = *pGrf; const Size aSizeTwip = OutputDevice::LogicToLogic( - rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MapUnit::MapTwip ); + rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MapMode(MapUnit::MapTwip)); nX = aSizeTwip.Width(); nY = aSizeTwip.Height(); } @@ -370,7 +370,7 @@ SdrObject* SwWW8ImplReader::ImportOleBase( Graphic& rGraph, { // 03-META stream is not available. Maybe it's a 03-PICT? const Size aSizeTwip = OutputDevice::LogicToLogic( - rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MapUnit::MapTwip ); + rGraph.GetPrefSize(), rGraph.GetPrefMapMode(), MapMode(MapUnit::MapTwip)); nX = aSizeTwip.Width(); nY = aSizeTwip.Height(); // PICT: no WMF available -> Graphic instead of OLE diff --git a/sw/source/filter/xml/xmltexti.cxx b/sw/source/filter/xml/xmltexti.cxx index a7ea624175c4..78cab08507f0 100644 --- a/sw/source/filter/xml/xmltexti.cxx +++ b/sw/source/filter/xml/xmltexti.cxx @@ -124,7 +124,7 @@ static void lcl_setObjectVisualArea( const uno::Reference< embed::XEmbeddedObjec { // convert the visual area to the objects units MapUnit aObjUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); - Size aObjVisSize = OutputDevice::LogicToLogic( aVisSize, aUnit, aObjUnit ); + Size aObjVisSize = OutputDevice::LogicToLogic(aVisSize, MapMode(aUnit), MapMode(aObjUnit)); awt::Size aSz; aSz.Width = aObjVisSize.Width(); aSz.Height = aObjVisSize.Height(); diff --git a/sw/source/ui/config/optpage.cxx b/sw/source/ui/config/optpage.cxx index 922901abd31d..a603ef992b81 100644 --- a/sw/source/ui/config/optpage.cxx +++ b/sw/source/ui/config/optpage.cxx @@ -1573,7 +1573,7 @@ SwMarkPreview::SwMarkPreview( vcl::Window *pParent, WinBits nWinBits ) : { m_aInitialSize = getPreviewOptionsSize(this); InitColors(); - SetMapMode(MapUnit::MapPixel); + SetMapMode(MapMode(MapUnit::MapPixel)); } VCL_BUILDER_FACTORY_ARGS(SwMarkPreview, 0) diff --git a/sw/source/ui/dbui/addresslistdialog.cxx b/sw/source/ui/dbui/addresslistdialog.cxx index aa6b09aa4304..3782b92bf1c1 100644 --- a/sw/source/ui/dbui/addresslistdialog.cxx +++ b/sw/source/ui/dbui/addresslistdialog.cxx @@ -195,7 +195,7 @@ SwAddressListDialog::SwAddressListDialog(SwMailMergeAddressBlockPage* pParent) m_pTablePB->SetClickHdl(LINK( this, SwAddressListDialog, TableSelectHdl_Impl)); SvSimpleTableContainer *pHeaderTreeContainer = get<SvSimpleTableContainer>("sources"); - Size aSize = pHeaderTreeContainer->LogicToPixel(Size(182 , 102), MapUnit::MapAppFont); + Size aSize = pHeaderTreeContainer->LogicToPixel(Size(182 , 102), MapMode(MapUnit::MapAppFont)); pHeaderTreeContainer->set_width_request(aSize.Width()); pHeaderTreeContainer->set_height_request(aSize.Height()); m_pListLB = VclPtr<SwAddrSourceLB>::Create(*pHeaderTreeContainer); diff --git a/sw/source/ui/dbui/createaddresslistdialog.cxx b/sw/source/ui/dbui/createaddresslistdialog.cxx index 9960f0d978b2..199b093a4f8b 100644 --- a/sw/source/ui/dbui/createaddresslistdialog.cxx +++ b/sw/source/ui/dbui/createaddresslistdialog.cxx @@ -152,8 +152,8 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) std::vector< OUString >::iterator aHeaderIter; - long nFTXPos = m_pWindow->LogicToPixel(Point(RSC_SP_CTRL_X, RSC_SP_CTRL_X), MapUnit::MapAppFont).X(); - long nFTHeight = m_pWindow->LogicToPixel(Size(RSC_BS_CHARHEIGHT, RSC_BS_CHARHEIGHT), MapUnit::MapAppFont).Height(); + long nFTXPos = m_pWindow->LogicToPixel(Point(RSC_SP_CTRL_X, RSC_SP_CTRL_X), MapMode(MapUnit::MapAppFont)).X(); + long nFTHeight = m_pWindow->LogicToPixel(Size(RSC_BS_CHARHEIGHT, RSC_BS_CHARHEIGHT), MapMode(MapUnit::MapAppFont)).Height(); long nFTWidth = 0; //determine the width of the FixedTexts @@ -168,12 +168,12 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) //add some pixels nFTWidth += 2; long nEDXPos = nFTWidth + nFTXPos + - m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_X, RSC_SP_CTRL_DESC_X), MapUnit::MapAppFont).Width(); - long nEDHeight = m_pWindow->LogicToPixel(Size(RSC_CD_TEXTBOX_HEIGHT, RSC_CD_TEXTBOX_HEIGHT), MapUnit::MapAppFont).Height(); + m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_X, RSC_SP_CTRL_DESC_X), MapMode(MapUnit::MapAppFont)).Width(); + long nEDHeight = m_pWindow->LogicToPixel(Size(RSC_CD_TEXTBOX_HEIGHT, RSC_CD_TEXTBOX_HEIGHT), MapMode(MapUnit::MapAppFont)).Height(); long nEDWidth = m_aWinOutputSize.Width() - nEDXPos - nFTXPos; - m_nLineHeight = nEDHeight + m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MapUnit::MapAppFont).Height(); + m_nLineHeight = nEDHeight + m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MapMode(MapUnit::MapAppFont)).Height(); - long nEDYPos = m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_Y, RSC_SP_CTRL_DESC_Y), MapUnit::MapAppFont).Height(); + long nEDYPos = m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_DESC_Y, RSC_SP_CTRL_DESC_Y), MapMode(MapUnit::MapAppFont)).Height(); long nFTYPos = nEDYPos + nEDHeight - nFTHeight; Link<Control&,void> aFocusLink = LINK(this, SwAddressControl_Impl, GotFocusHdl_Impl); @@ -210,7 +210,7 @@ void SwAddressControl_Impl::SetData(SwCSVData& rDBData) { //the m_aWindow has to be at least as high as the ScrollBar and it must include the last Edit sal_Int32 nContentHeight = pLastEdit->GetPosPixel().Y() + nEDHeight + - m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MapUnit::MapAppFont).Height(); + m_pWindow->LogicToPixel(Size(RSC_SP_CTRL_GROUP_Y, RSC_SP_CTRL_GROUP_Y), MapMode(MapUnit::MapAppFont)).Height(); if(nContentHeight < m_pScrollBar->GetSizePixel().Height()) { nContentHeight = m_pScrollBar->GetSizePixel().Height(); @@ -362,7 +362,7 @@ bool SwAddressControl_Impl::PreNotify( NotifyEvent& rNEvt ) Size SwAddressControl_Impl::GetOptimalSize() const { - return LogicToPixel(Size(250, 160), MapUnit::MapAppFont); + return LogicToPixel(Size(250, 160), MapMode(MapUnit::MapAppFont)); } void SwAddressControl_Impl::Resize() diff --git a/sw/source/ui/dbui/dbtablepreviewdialog.cxx b/sw/source/ui/dbui/dbtablepreviewdialog.cxx index 347515038357..9676508fa7c6 100644 --- a/sw/source/ui/dbui/dbtablepreviewdialog.cxx +++ b/sw/source/ui/dbui/dbtablepreviewdialog.cxx @@ -37,7 +37,7 @@ SwDBTablePreviewDialog::SwDBTablePreviewDialog(vcl::Window* pParent, uno::Sequen { get(m_pDescriptionFI, "description"); get(m_pBeamerWIN, "beamer"); - Size aSize(LogicToPixel(Size(338, 150), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(338, 150), MapMode(MapUnit::MapAppFont))); m_pBeamerWIN->set_width_request(aSize.Width()); m_pBeamerWIN->set_height_request(aSize.Height()); diff --git a/sw/source/ui/dbui/mmaddressblockpage.cxx b/sw/source/ui/dbui/mmaddressblockpage.cxx index df119fba54fc..e166f4d7d3e7 100644 --- a/sw/source/ui/dbui/mmaddressblockpage.cxx +++ b/sw/source/ui/dbui/mmaddressblockpage.cxx @@ -67,14 +67,14 @@ SwMailMergeAddressBlockPage::SwMailMergeAddressBlockPage( SwMailMergeWizard* _pP get(m_pSettingsFI, "settingsft"); get(m_pAddressCB, "address"); get(m_pSettingsWIN, "settingspreview"); - Size aSize(LogicToPixel(Size(164 , 45), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(164 , 45), MapMode(MapUnit::MapAppFont))); m_pSettingsWIN->set_width_request(aSize.Width()); m_pSettingsWIN->set_height_request(aSize.Height()); get(m_pSettingsPB, "settings"); get(m_pHideEmptyParagraphsCB, "hideempty"); get(m_pAssignPB, "assign"); get(m_pPreviewWIN, "addresspreview"); - aSize = LogicToPixel(Size(176, 46), MapUnit::MapAppFont); + aSize = LogicToPixel(Size(176, 46), MapMode(MapUnit::MapAppFont)); m_pPreviewWIN->set_width_request(aSize.Width()); m_pPreviewWIN->set_height_request(aSize.Height()); get(m_pDocumentIndexFI, "documentindex"); @@ -324,7 +324,7 @@ SwSelectAddressBlockDialog::SwSelectAddressBlockDialog( , m_rConfig(rConfig) { get(m_pPreview, "preview"); - Size aSize(m_pPreview->LogicToPixel(Size(192, 100), MapUnit::MapAppFont)); + Size aSize(m_pPreview->LogicToPixel(Size(192, 100), MapMode(MapUnit::MapAppFont))); m_pPreview->set_width_request(aSize.Width()); m_pPreview->set_height_request(aSize.Height()); get(m_pNewPB, "new"); @@ -868,7 +868,7 @@ SwAssignFieldsControl::SwAssignFieldsControl(vcl::Window* pParent, WinBits nBits Size SwAssignFieldsControl::GetOptimalSize() const { - return LogicToPixel(Size(248 , 120), MapUnit::MapAppFont); + return LogicToPixel(Size(248, 120), MapMode(MapUnit::MapAppFont)); } void SwAssignFieldsControl::Init(SwMailMergeConfigItem& rConfigItem) @@ -1173,7 +1173,7 @@ SwAssignFieldsDialog::SwAssignFieldsDialog( get(m_pPreviewFI, "PREVIEW_LABEL"); get(m_pOK, "ok"); get(m_pPreviewWIN, "PREVIEW"); - Size aSize(LogicToPixel(Size(248 , 45), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(248, 45), MapMode(MapUnit::MapAppFont))); m_pPreviewWIN->set_width_request(aSize.Width()); m_pPreviewWIN->set_height_request(aSize.Height()); get(m_pFieldsControl, "FIELDS"); @@ -1328,7 +1328,7 @@ void AddressMultiLineEdit::dispose() Size AddressMultiLineEdit::GetOptimalSize() const { - return LogicToPixel(Size(160, 60), MapUnit::MapAppFont); + return LogicToPixel(Size(160, 60), MapMode(MapUnit::MapAppFont)); } diff --git a/sw/source/ui/dbui/mmgreetingspage.cxx b/sw/source/ui/dbui/mmgreetingspage.cxx index f5cbf1cea436..24bd60320a62 100644 --- a/sw/source/ui/dbui/mmgreetingspage.cxx +++ b/sw/source/ui/dbui/mmgreetingspage.cxx @@ -429,7 +429,7 @@ SwMailBodyDialog::SwMailBodyDialog(vcl::Window* pParent) : get(m_pBodyFT, "bodyft"); get(m_pBodyMLE, "bodymle"); m_pBodyMLE->SetStyle(m_pBodyMLE->GetStyle() | WB_HSCROLL | WB_VSCROLL | WB_IGNORETAB); - Size aSize(LogicToPixel(Size(180, 50), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(180, 50), MapMode(MapUnit::MapAppFont))); m_pBodyMLE->set_width_request(aSize.Width()); m_pBodyMLE->set_height_request(aSize.Height()); get(m_pOK, "ok"); diff --git a/sw/source/ui/dbui/mmlayoutpage.cxx b/sw/source/ui/dbui/mmlayoutpage.cxx index cf3e34411655..c37570d6d038 100644 --- a/sw/source/ui/dbui/mmlayoutpage.cxx +++ b/sw/source/ui/dbui/mmlayoutpage.cxx @@ -91,7 +91,7 @@ SwMailMergeLayoutPage::SwMailMergeLayoutPage( SwMailMergeWizard* _pParent) : get(m_pUpPB, "up"); get(m_pDownPB, "down"); get(m_pExampleContainerWIN, "example"); - Size aSize(LogicToPixel(Size(124, 159), MapUnit::MapAppFont)); + Size aSize(LogicToPixel(Size(124, 159), MapMode(MapUnit::MapAppFont))); m_pExampleContainerWIN->set_width_request(aSize.Width()); m_pExampleContainerWIN->set_height_request(aSize.Height()); get(m_pZoomLB, "zoom"); diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index 7697ea523cb4..0dd9bedcc917 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -263,7 +263,7 @@ SwSendMailDialog::SwSendMailDialog(vcl::Window *pParent, SwMailMergeConfigItem& m_nSendCount(0), m_nErrorCount(0) { - Size aSize = m_pContainer->LogicToPixel(Size(226, 80), MapUnit::MapAppFont); + Size aSize = m_pContainer->LogicToPixel(Size(226, 80), MapMode(MapUnit::MapAppFont)); m_pContainer->set_width_request(aSize.Width()); m_pContainer->set_height_request(aSize.Height()); m_pStatus = VclPtr<SvSimpleTable>::Create(*m_pContainer); diff --git a/sw/source/ui/dbui/selectdbtabledialog.cxx b/sw/source/ui/dbui/selectdbtabledialog.cxx index 235411a90ed9..e1b5909817ea 100644 --- a/sw/source/ui/dbui/selectdbtabledialog.cxx +++ b/sw/source/ui/dbui/selectdbtabledialog.cxx @@ -102,7 +102,7 @@ SwSelectDBTableDialog::SwSelectDBTableDialog(vcl::Window* pParent, get(m_pPreviewPB, "preview"); SvSimpleTableContainer *pHeaderTreeContainer = get<SvSimpleTableContainer>("table"); - Size aSize = pHeaderTreeContainer->LogicToPixel(Size(238 , 50), MapUnit::MapAppFont); + Size aSize = pHeaderTreeContainer->LogicToPixel(Size(238 , 50), MapMode(MapUnit::MapAppFont)); pHeaderTreeContainer->set_width_request(aSize.Width()); pHeaderTreeContainer->set_height_request(aSize.Height()); m_pTable = VclPtr<SwAddressTable>::Create(*pHeaderTreeContainer); diff --git a/sw/source/ui/envelp/envlop1.cxx b/sw/source/ui/envelp/envlop1.cxx index 29eea5e17ec5..19a9b1e5d33d 100644 --- a/sw/source/ui/envelp/envlop1.cxx +++ b/sw/source/ui/envelp/envlop1.cxx @@ -54,7 +54,7 @@ SwEnvPreview::SwEnvPreview(vcl::Window* pParent, WinBits nStyle) Size SwEnvPreview::GetOptimalSize() const { - return LogicToPixel(Size(84 , 63), MapUnit::MapAppFont); + return LogicToPixel(Size(84 , 63), MapMode(MapUnit::MapAppFont)); } VCL_BUILDER_FACTORY_ARGS(SwEnvPreview, 0) diff --git a/sw/source/ui/envelp/labfmt.cxx b/sw/source/ui/envelp/labfmt.cxx index 5a4bde52985e..cc8ce3437e28 100644 --- a/sw/source/ui/envelp/labfmt.cxx +++ b/sw/source/ui/envelp/labfmt.cxx @@ -109,7 +109,7 @@ SwLabPreview::SwLabPreview(vcl::Window* pParent) , m_aColsStr(SwResId(STR_COLS)) , m_aRowsStr(SwResId(STR_ROWS)) { - SetMapMode(MapUnit::MapPixel); + SetMapMode(MapMode(MapUnit::MapPixel)); // FIXME RenderContext diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx index 007108722ae3..fadd507f4f75 100644 --- a/sw/source/ui/index/cnttab.cxx +++ b/sw/source/ui/index/cnttab.cxx @@ -650,7 +650,7 @@ SwAddStylesDlg_Impl::SwAddStylesDlg_Impl(vcl::Window* pParent, get(m_pRightPB, "right"); OUString sHBFirst = get<FixedText>("notapplied")->GetText(); SvSimpleTableContainer *pHeaderTreeContainer = get<SvSimpleTableContainer>("styles"); - Size aSize = pHeaderTreeContainer->LogicToPixel(Size(273, 164), MapUnit::MapAppFont); + Size aSize = pHeaderTreeContainer->LogicToPixel(Size(273, 164), MapMode(MapUnit::MapAppFont)); pHeaderTreeContainer->set_width_request(aSize.Width()); pHeaderTreeContainer->set_height_request(aSize.Height()); m_pHeaderTree = VclPtr<SwIndexTreeLB>::Create(*pHeaderTreeContainer); diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx index a171fa3693c0..be6c855a8af3 100644 --- a/sw/source/ui/misc/glosbib.cxx +++ b/sw/source/ui/misc/glosbib.cxx @@ -56,7 +56,7 @@ SwGlossaryGroupDlg::SwGlossaryGroupDlg(vcl::Window * pParent, get(m_pGroupTLB, "group"); const int nAppFontUnits = 130; - long nWidth = LogicToPixel(Size(nAppFontUnits, 0), MapUnit::MapAppFont).Width(); + long nWidth = LogicToPixel(Size(nAppFontUnits, 0), MapMode(MapUnit::MapAppFont)).Width(); m_pPathLB->set_width_request(nWidth); //just has to be something small, real size will be available space m_pGroupTLB->set_width_request(nWidth); diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx index 9dd8145a7b0f..447205517e6e 100644 --- a/sw/source/uibase/app/appenv.cxx +++ b/sw/source/uibase/app/appenv.cxx @@ -344,7 +344,7 @@ void SwModule::InsertEnv( SfxRequest& rReq ) // Borders (are put together by Shift-Offset and alignment) Size aPaperSize = pPrt->PixelToLogic( pPrt->GetPaperSizePixel(), - MapUnit::MapTwip); + MapMode(MapUnit::MapTwip)); if ( !aPaperSize.Width() && !aPaperSize.Height() ) aPaperSize = SvxPaperInfo::GetPaperSize(PAPER_A4); if ( aPaperSize.Width() > aPaperSize.Height() ) diff --git a/sw/source/uibase/dochdl/swdtflvr.cxx b/sw/source/uibase/dochdl/swdtflvr.cxx index 1f206ea72bd4..f46c7767e5b8 100644 --- a/sw/source/uibase/dochdl/swdtflvr.cxx +++ b/sw/source/uibase/dochdl/swdtflvr.cxx @@ -831,7 +831,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut ) // --> OD #i98753# // set size of embedded object at the object description structure - m_aObjDesc.maSize = OutputDevice::LogicToLogic( m_pWrtShell->GetObjSize(), MapUnit::MapTwip, MapUnit::Map100thMM ); + m_aObjDesc.maSize = OutputDevice::LogicToLogic(m_pWrtShell->GetObjSize(), MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM)); // <-- PrepareOLE( m_aObjDesc ); AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); @@ -979,7 +979,7 @@ int SwTransferable::PrepareForCopy( bool bIsCut ) //Now adjust it. Thus in GetData the first query can still //be answered with delayed rendering. Size aSz( OLESIZE ); - m_aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MapUnit::MapTwip, MapUnit::Map100thMM ); + m_aObjDesc.maSize = OutputDevice::LogicToLogic(aSz, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM)); PrepareOLE( m_aObjDesc ); AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); @@ -1072,7 +1072,7 @@ int SwTransferable::CopyGlossary( SwTextBlocks& rGlossary, const OUString& rStr //Now adjust it. Thus in GetData the first query can still //be answered with delayed rendering. Size aSz( OLESIZE ); - m_aObjDesc.maSize = OutputDevice::LogicToLogic( aSz, MapUnit::MapTwip, MapUnit::Map100thMM ); + m_aObjDesc.maSize = OutputDevice::LogicToLogic(aSz, MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM)); PrepareOLE( m_aObjDesc ); AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); @@ -1882,7 +1882,7 @@ bool SwTransferable::PasteOLE( TransferableDataHelper& rData, SwWrtShell& rSh, { aSize = aObjDesc.maSize; //always 100TH_MM MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( aObjDesc.mnViewAspect ) ); - aSize = OutputDevice::LogicToLogic( aSize, MapUnit::Map100thMM, aUnit ); + aSize = OutputDevice::LogicToLogic(aSize, MapMode(MapUnit::Map100thMM), MapMode(aUnit)); awt::Size aSz; try { @@ -3101,7 +3101,7 @@ void SwTransferable::SetDataForDragAndDrop( const Point& rSttPos ) //be answered with delayed rendering. m_aObjDesc.maDragStartPos = rSttPos; m_aObjDesc.maSize = OutputDevice::LogicToLogic( Size( OLESIZE ), - MapUnit::MapTwip, MapUnit::Map100thMM ); + MapMode(MapUnit::MapTwip), MapMode(MapUnit::Map100thMM)); PrepareOLE( m_aObjDesc ); AddFormat( SotClipboardFormatId::OBJECTDESCRIPTOR ); } diff --git a/sw/source/uibase/docvw/srcedtw.cxx b/sw/source/uibase/docvw/srcedtw.cxx index abbc045031ae..5d6a131bfcbb 100644 --- a/sw/source/uibase/docvw/srcedtw.cxx +++ b/sw/source/uibase/docvw/srcedtw.cxx @@ -988,7 +988,7 @@ void SwSrcEditWindow::SetFont() //font height is stored in point and set in twip aSize.Height() = officecfg::Office::Common::Font::SourceViewFont::FontHeight::get() * 20; - aFont.SetFontSize(m_pOutWin->LogicToPixel(aSize, MapUnit::MapTwip)); + aFont.SetFontSize(m_pOutWin->LogicToPixel(aSize, MapMode(MapUnit::MapTwip))); GetTextEngine()->SetFont( aFont ); m_pOutWin->SetFont(aFont); } diff --git a/sw/source/uibase/ribbar/workctrl.cxx b/sw/source/uibase/ribbar/workctrl.cxx index 71eca1387699..fe285abb58bc 100644 --- a/sw/source/uibase/ribbar/workctrl.cxx +++ b/sw/source/uibase/ribbar/workctrl.cxx @@ -458,7 +458,7 @@ SwZoomBox_Impl::SwZoomBox_Impl(vcl::Window* pParent, sal_uInt16 nSlot) , bRelease(true) { SetHelpId(HID_PVIEW_ZOOM_LB); - SetSizePixel(LogicToPixel(Size(30, 86), MapUnit::MapAppFont)); + SetSizePixel(LogicToPixel(Size(30, 86), MapMode(MapUnit::MapAppFont))); EnableAutocomplete( false ); const char* const aZoomValues[] = { RID_SVXSTR_ZOOM_25 , RID_SVXSTR_ZOOM_50 , @@ -612,7 +612,7 @@ SwJumpToSpecificBox_Impl::SwJumpToSpecificBox_Impl(vcl::Window* pParent, sal_uIn : NumericField(pParent, WB_HIDE | WB_BORDER) , nSlotId(nSlot) { - SetSizePixel(LogicToPixel(Size(16, 12), MapUnit::MapAppFont)); + SetSizePixel(LogicToPixel(Size(16, 12), MapMode(MapUnit::MapAppFont))); } void SwJumpToSpecificBox_Impl::Select() diff --git a/sw/source/uibase/shells/grfshex.cxx b/sw/source/uibase/shells/grfshex.cxx index a8f92194cbb9..1f8f9928a021 100644 --- a/sw/source/uibase/shells/grfshex.cxx +++ b/sw/source/uibase/shells/grfshex.cxx @@ -110,9 +110,9 @@ bool SwTextShell::InsertMediaDlg( SfxRequest const & rReq ) if( aPrefSize.Width() && aPrefSize.Height() ) { if( pWindow ) - aSize = pWindow->PixelToLogic( aPrefSize, MapUnit::MapTwip ); + aSize = pWindow->PixelToLogic(aPrefSize, MapMode(MapUnit::MapTwip)); else - aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::MapTwip ); + aSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::MapTwip)); } else aSize = Size( 2835, 2835 ); diff --git a/sw/source/uibase/table/chartins.cxx b/sw/source/uibase/table/chartins.cxx index bc778aa90eea..283449964c5f 100644 --- a/sw/source/uibase/table/chartins.cxx +++ b/sw/source/uibase/table/chartins.cxx @@ -70,7 +70,7 @@ Point SwGetChartDialogPos( const vcl::Window *pParentWin, const Size& rDialogSiz pParentWin->OutputToAbsoluteScreenPixel( aObjPixel.BottomRight() ) ); tools::Rectangle aDesktop = pParentWin->GetDesktopRectPixel(); - Size aSpace = pParentWin->LogicToPixel( Size( 8, 12 ), MapUnit::MapAppFont ); + Size aSpace = pParentWin->LogicToPixel(Size(8, 12), MapMode(MapUnit::MapAppFont)); bool bLayoutRTL = ::GetActiveView()->GetWrtShell().IsTableRightToLeft(); bool bCenterHor = false; diff --git a/sw/source/uibase/uiview/srcview.cxx b/sw/source/uibase/uiview/srcview.cxx index 7988493a7579..0c0a78b628bd 100644 --- a/sw/source/uibase/uiview/srcview.cxx +++ b/sw/source/uibase/uiview/srcview.cxx @@ -683,10 +683,10 @@ sal_Int32 SwSrcView::PrintSource( pOutDev->Push(); TextEngine* pTextEngine = aEditWin->GetTextEngine(); - pOutDev->SetMapMode( MapUnit::Map100thMM ); + pOutDev->SetMapMode(MapMode(MapUnit::Map100thMM)); vcl::Font aFont( aEditWin->GetOutWin()->GetFont() ); Size aSize( aFont.GetFontSize() ); - aSize = aEditWin->GetOutWin()->PixelToLogic( aSize, MapUnit::Map100thMM ); + aSize = aEditWin->GetOutWin()->PixelToLogic(aSize, MapMode(MapUnit::Map100thMM)); aFont.SetFontSize( aSize ); aFont.SetColor( COL_BLACK ); pOutDev->SetFont( aFont ); diff --git a/sw/source/uibase/uiview/viewdraw.cxx b/sw/source/uibase/uiview/viewdraw.cxx index a85c8ffc2cc0..04cc5e8d57f2 100644 --- a/sw/source/uibase/uiview/viewdraw.cxx +++ b/sw/source/uibase/uiview/viewdraw.cxx @@ -176,9 +176,9 @@ void SwView::ExecDraw(SfxRequest& rReq) if( aPrefSize.Width() && aPrefSize.Height() ) { if( pWin ) - aSize = pWin->PixelToLogic( aPrefSize, MapUnit::MapTwip ); + aSize = pWin->PixelToLogic(aPrefSize, MapMode(MapUnit::MapTwip)); else - aSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::MapTwip ); + aSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::MapTwip)); } else aSize = Size( 2835, 2835 ); diff --git a/sw/source/uibase/uiview/viewport.cxx b/sw/source/uibase/uiview/viewport.cxx index eb3bcbdd8ae3..cdad0962be46 100644 --- a/sw/source/uibase/uiview/viewport.cxx +++ b/sw/source/uibase/uiview/viewport.cxx @@ -953,7 +953,7 @@ void SwView::InnerResizePixel( const Point &rOfst, const Size &rSize, bool ) Size aSize( rSize ); aSize.Width() -= (aBorder.Left() + aBorder.Right()); aSize.Height() -= (aBorder.Top() + aBorder.Bottom()); - Size aObjSizePixel = GetWindow()->LogicToPixel( aObjSize, MapUnit::MapTwip ); + Size aObjSizePixel = GetWindow()->LogicToPixel(aObjSize, MapMode(MapUnit::MapTwip)); SfxViewShell::SetZoomFactor( Fraction( aSize.Width(), aObjSizePixel.Width() ), Fraction( aSize.Height(), aObjSizePixel.Height() ) ); } diff --git a/sw/source/uibase/utlui/content.cxx b/sw/source/uibase/utlui/content.cxx index 4c932466493b..d690701a176f 100644 --- a/sw/source/uibase/utlui/content.cxx +++ b/sw/source/uibase/utlui/content.cxx @@ -897,7 +897,7 @@ void SwContentTree::dispose() Size SwContentTree::GetOptimalSize() const { - return LogicToPixel(Size(110, 112), MapUnit::MapAppFont); + return LogicToPixel(Size(110, 112), MapMode(MapUnit::MapAppFont)); } OUString SwContentTree::GetEntryAltText( SvTreeListEntry* pEntry ) const diff --git a/sw/source/uibase/utlui/glbltree.cxx b/sw/source/uibase/utlui/glbltree.cxx index 34f7ce07f756..17b29d4f1945 100644 --- a/sw/source/uibase/utlui/glbltree.cxx +++ b/sw/source/uibase/utlui/glbltree.cxx @@ -216,7 +216,7 @@ void SwGlobalTree::dispose() Size SwGlobalTree::GetOptimalSize() const { - return LogicToPixel(Size(110, 112), MapUnit::MapAppFont); + return LogicToPixel(Size(110, 112), MapMode(MapUnit::MapAppFont)); } sal_Int8 SwGlobalTree::ExecuteDrop( const ExecuteDropEvent& rEvt ) diff --git a/sw/source/uibase/utlui/shdwcrsr.cxx b/sw/source/uibase/utlui/shdwcrsr.cxx index 40c6931482fd..8180141cafbb 100644 --- a/sw/source/uibase/utlui/shdwcrsr.cxx +++ b/sw/source/uibase/utlui/shdwcrsr.cxx @@ -73,7 +73,7 @@ void SwShadowCursor::DrawCursor( const Point& rPt, long nHeight, sal_uInt16 nMod pWin->Push(); - pWin->SetMapMode( MapUnit::MapPixel ); + pWin->SetMapMode(MapMode(MapUnit::MapPixel)); pWin->SetRasterOp( RasterOp::Xor ); pWin->SetLineColor( Color( aCol.GetColor() ^ COL_WHITE ) ); diff --git a/sw/source/uibase/wrtsh/wrtsh1.cxx b/sw/source/uibase/wrtsh/wrtsh1.cxx index 898cbf57ab7d..ac5debe9ec49 100644 --- a/sw/source/uibase/wrtsh/wrtsh1.cxx +++ b/sw/source/uibase/wrtsh/wrtsh1.cxx @@ -647,7 +647,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); // TODO/LATER: needs complete VisArea?! - Size aSize( OutputDevice::LogicToLogic( aRect.SVRect(), MapUnit::MapTwip, aUnit ).GetSize() ); + Size aSize( OutputDevice::LogicToLogic(aRect.SVRect(), MapMode(MapUnit::MapTwip), MapMode(aUnit)).GetSize() ); awt::Size aSz; aSz.Width = aSize.Width(); aSz.Height = aSize.Height(); @@ -752,7 +752,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj, { const MapMode aTmp( MapUnit::MapTwip ); MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) ); - _aVisArea = OutputDevice::LogicToLogic( _aVisArea, aUnit, aTmp); + _aVisArea = OutputDevice::LogicToLogic(_aVisArea, MapMode(aUnit), aTmp); Size aObjArea; if ( pFlyPrtRect ) aObjArea = pFlyPrtRect->SSize(); diff --git a/toolkit/source/controls/dialogcontrol.cxx b/toolkit/source/controls/dialogcontrol.cxx index 3f0cf7ca93aa..2a27b237ee57 100644 --- a/toolkit/source/controls/dialogcontrol.cxx +++ b/toolkit/source/controls/dialogcontrol.cxx @@ -480,7 +480,7 @@ void UnoDialogControl::setMenuBar( const Reference< XMenuBar >& rxMenuBar ) } static ::Size ImplMapPixelToAppFont( OutputDevice const * pOutDev, const ::Size& aSize ) { - ::Size aTmp = pOutDev->PixelToLogic( aSize, MapUnit::MapAppFont ); + ::Size aTmp = pOutDev->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont)); return aTmp; } // css::awt::XWindowListener diff --git a/toolkit/source/controls/tabpagemodel.cxx b/toolkit/source/controls/tabpagemodel.cxx index 8982727fea3d..c45c8daad700 100644 --- a/toolkit/source/controls/tabpagemodel.cxx +++ b/toolkit/source/controls/tabpagemodel.cxx @@ -227,7 +227,7 @@ void UnoControlTabPage::createPeer( const Reference< XToolkit > & rxToolkit, con static ::Size ImplMapPixelToAppFont( OutputDevice const * pOutDev, const ::Size& aSize ) { - ::Size aTmp = pOutDev->PixelToLogic( aSize, MapUnit::MapAppFont ); + ::Size aTmp = pOutDev->PixelToLogic(aSize, MapMode(MapUnit::MapAppFont)); return aTmp; } // css::awt::XWindowListener diff --git a/uui/source/fltdlg.cxx b/uui/source/fltdlg.cxx index 3d4e524e3bb3..fa05f36ff413 100644 --- a/uui/source/fltdlg.cxx +++ b/uui/source/fltdlg.cxx @@ -50,7 +50,7 @@ FilterDialog::FilterDialog( vcl::Window* pParentWindow ) { get(m_pFtURL, "url"); get(m_pLbFilters, "filters"); - Size aSize(pParentWindow->LogicToPixel(Size(182, 175), MapUnit::MapAppFont)); + Size aSize(pParentWindow->LogicToPixel(Size(182, 175), MapMode(MapUnit::MapAppFont))); m_pLbFilters->set_height_request(aSize.Height()); m_pLbFilters->set_width_request(aSize.Width()); m_pFtURL->SetSizePixel(Size(aSize.Width(), m_pFtURL->GetOptimalSize().Height())); diff --git a/vcl/source/app/settings.cxx b/vcl/source/app/settings.cxx index b6f9a2d7b1b4..8be97308eb38 100644 --- a/vcl/source/app/settings.cxx +++ b/vcl/source/app/settings.cxx @@ -2050,7 +2050,7 @@ const Size& StyleSettings::GetListBoxPreviewDefaultPixelSize() const if(0 == mxData->maListBoxPreviewDefaultPixelSize.Width() || 0 == mxData->maListBoxPreviewDefaultPixelSize.Height()) { const_cast< StyleSettings* >(this)->mxData->maListBoxPreviewDefaultPixelSize = - Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MapUnit::MapAppFont); + Application::GetDefaultDevice()->LogicToPixel(mxData->maListBoxPreviewDefaultLogicSize, MapMode(MapUnit::MapAppFont)); } return mxData->maListBoxPreviewDefaultPixelSize; diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx index 8aa2cebc4f1b..875734f51d15 100644 --- a/vcl/source/control/button.cxx +++ b/vcl/source/control/button.cxx @@ -2807,7 +2807,7 @@ Image RadioButton::GetRadioImage( const AllSettings& rSettings, DrawButtonFlags void RadioButton::ImplSetMinimumNWFSize() { Push( PushFlags::MAPMODE ); - SetMapMode( MapUnit::MapPixel ); + SetMapMode(MapMode(MapUnit::MapPixel)); ImplControlValue aControlValue; Size aCurSize( GetSizePixel() ); @@ -3643,7 +3643,7 @@ Image CheckBox::GetCheckImage( const AllSettings& rSettings, DrawButtonFlags nFl void CheckBox::ImplSetMinimumNWFSize() { Push( PushFlags::MAPMODE ); - SetMapMode( MapUnit::MapPixel ); + SetMapMode(MapMode(MapUnit::MapPixel)); ImplControlValue aControlValue; Size aCurSize( GetSizePixel() ); diff --git a/vcl/source/control/listctrl.cxx b/vcl/source/control/listctrl.cxx index 1c42b0565fb9..fd94a50abed1 100644 --- a/vcl/source/control/listctrl.cxx +++ b/vcl/source/control/listctrl.cxx @@ -95,7 +95,7 @@ void ListControl::RecalcAll() Size ListControl::GetOptimalSize() const { - return LogicToPixel(Size(300, 185), MapUnit::MapAppFont); + return LogicToPixel(Size(300, 185), MapMode(MapUnit::MapAppFont)); } void ListControl::Resize() diff --git a/vcl/source/control/morebtn.cxx b/vcl/source/control/morebtn.cxx index acff4e0be2f2..95fd6fb78871 100644 --- a/vcl/source/control/morebtn.cxx +++ b/vcl/source/control/morebtn.cxx @@ -89,7 +89,7 @@ void MoreButton::Click() { vcl::Window* pParent = GetParent(); Size aSize( pParent->GetSizePixel() ); - long nDeltaPixel = LogicToPixel( Size( 0, 0 ), MapUnit::MapPixel ).Height(); + long nDeltaPixel = LogicToPixel(Size(0, 0), MapMode(MapUnit::MapPixel)).Height(); // Change status mbState = !mbState; diff --git a/vcl/source/filter/graphicfilter.cxx b/vcl/source/filter/graphicfilter.cxx index 19c32190e3d0..c555ac89aa06 100644 --- a/vcl/source/filter/graphicfilter.cxx +++ b/vcl/source/filter/graphicfilter.cxx @@ -835,10 +835,10 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r Size aOriginalSize; Size aPrefSize( rGraphic.GetPrefSize() ); MapMode aPrefMapMode( rGraphic.GetPrefMapMode() ); - if ( aPrefMapMode == MapUnit::MapPixel ) - aOriginalSize = Application::GetDefaultDevice()->PixelToLogic( aPrefSize, MapUnit::Map100thMM ); + if (aPrefMapMode.GetMapUnit() == MapUnit::MapPixel) + aOriginalSize = Application::GetDefaultDevice()->PixelToLogic(aPrefSize, MapMode(MapUnit::Map100thMM)); else - aOriginalSize = OutputDevice::LogicToLogic( aPrefSize, aPrefMapMode, MapUnit::Map100thMM ); + aOriginalSize = OutputDevice::LogicToLogic(aPrefSize, aPrefMapMode, MapMode(MapUnit::Map100thMM)); if ( !nLogicalWidth ) nLogicalWidth = aOriginalSize.Width(); if ( !nLogicalHeight ) @@ -887,7 +887,7 @@ static Graphic ImpGetScaledGraphic( const Graphic& rGraphic, FilterConfigItem& r if( ( nMode == 1 ) || ( nMode == 2 ) ) { GDIMetaFile aMtf( rGraphic.GetGDIMetaFile() ); - Size aNewSize( OutputDevice::LogicToLogic( Size( nLogicalWidth, nLogicalHeight ), MapUnit::Map100thMM, aMtf.GetPrefMapMode() ) ); + Size aNewSize( OutputDevice::LogicToLogic(Size(nLogicalWidth, nLogicalHeight), MapMode(MapUnit::Map100thMM), aMtf.GetPrefMapMode()) ); if( aNewSize.Width() && aNewSize.Height() ) { diff --git a/vcl/source/filter/igif/gifread.cxx b/vcl/source/filter/igif/gifread.cxx index 9d07b805417d..4b3ef39b7212 100644 --- a/vcl/source/filter/igif/gifread.cxx +++ b/vcl/source/filter/igif/gifread.cxx @@ -888,7 +888,7 @@ ReadState GIFReader::ReadGIF( Graphic& rGraphic ) if( nLogWidth100 && nLogHeight100 ) { rGraphic.SetPrefSize( Size( nLogWidth100, nLogHeight100 ) ); - rGraphic.SetPrefMapMode( MapUnit::Map100thMM ); + rGraphic.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); } } else diff --git a/vcl/source/filter/jpeg/JpegReader.cxx b/vcl/source/filter/jpeg/JpegReader.cxx index 014cdfd5d772..604b182b5bb1 100644 --- a/vcl/source/filter/jpeg/JpegReader.cxx +++ b/vcl/source/filter/jpeg/JpegReader.cxx @@ -225,7 +225,7 @@ bool JPEGReader::CreateBitmap(JPEGCreateBitmapParam& rParam) Fraction aFractX( 1, rParam.X_density ); Fraction aFractY( 1, rParam.Y_density ); MapMode aMapMode( nUnit == 1 ? MapUnit::MapInch : MapUnit::MapCM, aEmptyPoint, aFractX, aFractY ); - Size aPrefSize = OutputDevice::LogicToLogic( aSize, aMapMode, MapUnit::Map100thMM ); + Size aPrefSize = OutputDevice::LogicToLogic(aSize, aMapMode, MapMode(MapUnit::Map100thMM)); mpBitmap->SetPrefSize(aPrefSize); mpBitmap->SetPrefMapMode(MapMode(MapUnit::Map100thMM)); diff --git a/vcl/source/filter/wmf/emfwr.cxx b/vcl/source/filter/wmf/emfwr.cxx index 649425f20b83..fabada800ea9 100644 --- a/vcl/source/filter/wmf/emfwr.cxx +++ b/vcl/source/filter/wmf/emfwr.cxx @@ -250,7 +250,7 @@ bool EMFWriter::WriteEMF(const GDIMetaFile& rMtf) mnHorTextAlign = 0; const Size aMtfSizePix( maVDev->LogicToPixel( rMtf.GetPrefSize(), rMtf.GetPrefMapMode() ) ); - const Size aMtfSizeLog( OutputDevice::LogicToLogic( rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapUnit::Map100thMM ) ); + const Size aMtfSizeLog( OutputDevice::LogicToLogic(rMtf.GetPrefSize(), rMtf.GetPrefMapMode(), MapMode(MapUnit::Map100thMM)) ); // seek over header // use [MS-EMF 2.2.11] HeaderExtension2 Object, otherwise resulting EMF cannot be converted with GetWinMetaFileBits() diff --git a/vcl/source/gdi/dibtools.cxx b/vcl/source/gdi/dibtools.cxx index 02ab6d068bc8..8e20fd7a9aa3 100644 --- a/vcl/source/gdi/dibtools.cxx +++ b/vcl/source/gdi/dibtools.cxx @@ -1476,7 +1476,7 @@ bool ImplWriteDIBBody(const Bitmap& rBitmap, SvStream& rOStm, BitmapReadAccess c // MapMode is integer-based, and suffers from roundoffs, // especially if maPrefSize is small. Trying to circumvent // that by performing part of the math in floating point. - const Size aScale100000(OutputDevice::LogicToLogic(Size(100000, 100000), MapUnit::Map100thMM, rBitmap.GetPrefMapMode())); + const Size aScale100000(OutputDevice::LogicToLogic(Size(100000, 100000), MapMode(MapUnit::Map100thMM), rBitmap.GetPrefMapMode())); const double fBmpWidthM((double)rBitmap.GetPrefSize().Width() / aScale100000.Width()); const double fBmpHeightM((double)rBitmap.GetPrefSize().Height() / aScale100000.Height()); diff --git a/vcl/source/gdi/gdimetafiletools.cxx b/vcl/source/gdi/gdimetafiletools.cxx index a5bd77e1b4ab..e63f64ca6b4b 100644 --- a/vcl/source/gdi/gdimetafiletools.cxx +++ b/vcl/source/gdi/gdimetafiletools.cxx @@ -717,11 +717,11 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) if(MapUnit::MapPixel == rBitmapEx.GetPrefMapMode().GetMapUnit()) { - aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back().GetMapUnit()); + aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back()); } else { - aLogicalSize = OutputDevice::LogicToLogic(aLogicalSize, rBitmapEx.GetPrefMapMode(), aMapModes.back().GetMapUnit()); + aLogicalSize = OutputDevice::LogicToLogic(aLogicalSize, rBitmapEx.GetPrefMapMode(), aMapModes.back()); } bDone = handleBitmapContent( @@ -744,11 +744,11 @@ void clipMetafileContentAgainstOwnRegions(GDIMetaFile& rSource) if(MapUnit::MapPixel == rBitmap.GetPrefMapMode().GetMapUnit()) { - aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back().GetMapUnit()); + aLogicalSize = Application::GetDefaultDevice()->PixelToLogic(aLogicalSize, aMapModes.back()); } else { - aLogicalSize = OutputDevice::LogicToLogic(aLogicalSize, rBitmap.GetPrefMapMode(), aMapModes.back().GetMapUnit()); + aLogicalSize = OutputDevice::LogicToLogic(aLogicalSize, rBitmap.GetPrefMapMode(), aMapModes.back()); } bDone = handleBitmapContent( diff --git a/vcl/source/gdi/gdimtf.cxx b/vcl/source/gdi/gdimtf.cxx index a2310de9b564..a7c691fc1863 100644 --- a/vcl/source/gdi/gdimtf.cxx +++ b/vcl/source/gdi/gdimtf.cxx @@ -420,7 +420,7 @@ bool GDIMetaFile::ImplPlayWithRenderer( OutputDevice* pOut, const Point& rPos, S BitmapEx aBitmapEx; if( aBitmapEx.Create( xBitmapCanvas, aSize ) ) { - if ( pOut->GetMapMode() == MapUnit::MapPixel ) + if (pOut->GetMapMode().GetMapUnit() == MapUnit::MapPixel) pOut->DrawBitmapEx( rPos, aBitmapEx ); else pOut->DrawBitmapEx( rPos, rLogicDestSize, aBitmapEx ); diff --git a/vcl/source/gdi/graph.cxx b/vcl/source/gdi/graph.cxx index 9d8833683f34..d60a4f2cf0a2 100644 --- a/vcl/source/gdi/graph.cxx +++ b/vcl/source/gdi/graph.cxx @@ -416,7 +416,8 @@ basegfx::B2DSize Graphic::GetPPI() const } else { - const Size aGrf1000thInchSize = OutputDevice::LogicToLogic(aGrfPrefMapModeSize, aGrfMap, MapUnit::Map1000thInch); + const Size aGrf1000thInchSize = OutputDevice::LogicToLogic( + aGrfPrefMapModeSize, aGrfMap, MapMode(MapUnit::Map1000thInch)); nGrfDPIx = 1000.0 * aGrfPixelSize.Width() / aGrf1000thInchSize.Width(); nGrfDPIy = 1000.0 * aGrfPixelSize.Height() / aGrf1000thInchSize.Height(); } diff --git a/vcl/source/gdi/pdfwriter_impl.cxx b/vcl/source/gdi/pdfwriter_impl.cxx index d671c43b6e51..3e3525162845 100644 --- a/vcl/source/gdi/pdfwriter_impl.cxx +++ b/vcl/source/gdi/pdfwriter_impl.cxx @@ -2201,7 +2201,7 @@ OutputDevice* PDFWriterImpl::getReferenceDevice() pVDev->SetReferenceDevice( m_aContext.DPIx, m_aContext.DPIy ); pVDev->SetOutputSizePixel( Size( 640, 480 ) ); - pVDev->SetMapMode( MapUnit::MapMM ); + pVDev->SetMapMode(MapMode(MapUnit::MapMM)); m_pReferenceDevice->mpPDFWriter = this; m_pReferenceDevice->ImplUpdateFontData(); diff --git a/vcl/source/gdi/pdfwriter_impl2.cxx b/vcl/source/gdi/pdfwriter_impl2.cxx index 632e526c9471..dc47a65b6554 100644 --- a/vcl/source/gdi/pdfwriter_impl2.cxx +++ b/vcl/source/gdi/pdfwriter_impl2.cxx @@ -107,7 +107,7 @@ void PDFWriterImpl::implWriteBitmapEx( const Point& i_rPoint, const Size& i_rSiz if( i_rContext.m_nMaxImageResolution > 50 ) { // do downsampling if necessary - const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic( i_pDummyVDev->LogicToPixel( aSize ), MapUnit::MapTwip ) ); + const Size aDstSizeTwip( i_pDummyVDev->PixelToLogic(i_pDummyVDev->LogicToPixel(aSize), MapMode(MapUnit::MapTwip)) ); const Size aBmpSize( aBitmapEx.GetSizePixel() ); const double fBmpPixelX = aBmpSize.Width(); const double fBmpPixelY = aBmpSize.Height(); @@ -425,7 +425,7 @@ void PDFWriterImpl::playMetafile( const GDIMetaFile& i_rMtf, vcl::PDFExtOutDevDa } else { - const Size aDstSizeTwip( pDummyVDev->PixelToLogic( pDummyVDev->LogicToPixel( rSize ), MapUnit::MapTwip ) ); + const Size aDstSizeTwip( pDummyVDev->PixelToLogic(pDummyVDev->LogicToPixel(rSize), MapMode(MapUnit::MapTwip)) ); // i#115962# Always use at least 300 DPI for bitmap conversion of transparence gradients, // else the quality is not acceptable (see bugdoc as example) diff --git a/vcl/source/gdi/pngread.cxx b/vcl/source/gdi/pngread.cxx index 8dde053a7d82..0752d52ff6f7 100644 --- a/vcl/source/gdi/pngread.cxx +++ b/vcl/source/gdi/pngread.cxx @@ -436,7 +436,7 @@ BitmapEx PNGReaderImpl::GetBitmapEx( const Size& rPreviewSizeHint ) if ( mbpHYs && maPhysSize.Width() && maPhysSize.Height() ) { - aRet.SetPrefMapMode( MapUnit::Map100thMM ); + aRet.SetPrefMapMode(MapMode(MapUnit::Map100thMM)); aRet.SetPrefSize( maPhysSize ); } } diff --git a/vcl/source/gdi/pngwrite.cxx b/vcl/source/gdi/pngwrite.cxx index ab15754724f4..072e74d62530 100644 --- a/vcl/source/gdi/pngwrite.cxx +++ b/vcl/source/gdi/pngwrite.cxx @@ -355,7 +355,7 @@ void PNGWriterImpl::ImplWriteTransparent() void PNGWriterImpl::ImplWritepHYs(const BitmapEx& rBmpEx) { - if (rBmpEx.GetPrefMapMode() == MapUnit::Map100thMM) + if (rBmpEx.GetPrefMapMode().GetMapUnit() == MapUnit::Map100thMM) { Size aPrefSize(rBmpEx.GetPrefSize()); diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx index 5ac8a2a8d957..55f4b3fa3be9 100644 --- a/vcl/source/gdi/print.cxx +++ b/vcl/source/gdi/print.cxx @@ -241,7 +241,7 @@ void Printer::EmulateDrawTransparent ( const tools::PolyPolygon& rPolyPoly, mpAlphaVDev = pOldAlphaVDev; tools::Rectangle aPolyRect( LogicToPixel( rPolyPoly ).GetBoundRect() ); - const Size aDPISize( LogicToPixel( Size( 1, 1 ), MapUnit::MapInch ) ); + const Size aDPISize( LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch)) ); const long nBaseExtent = std::max( FRound( aDPISize.Width() / 300. ), 1L ); long nMove; const sal_uInt16 nTrans = ( nTransparencePercent < 13 ) ? 0 : @@ -1429,7 +1429,7 @@ bool Printer::SetPaperSizeUser( const Size& rSize, bool bMatchNearest ) return false; const Size aPixSize = LogicToPixel( rSize ); - const Size aPageSize = PixelToLogic( aPixSize, MapUnit::Map100thMM ); + const Size aPageSize = PixelToLogic(aPixSize, MapMode(MapUnit::Map100thMM)); bool bNeedToChange(maJobSetup.ImplGetConstData().GetPaperWidth() != aPageSize.Width() || maJobSetup.ImplGetConstData().GetPaperHeight() != aPageSize.Height()); @@ -1518,7 +1518,7 @@ OUString Printer::GetPaperName( Paper ePaper ) OUString Printer::GetPaperName() const { - Size aPageSize = PixelToLogic( GetPaperSizePixel(), MapUnit::Map100thMM ); + Size aPageSize = PixelToLogic( GetPaperSizePixel(), MapMode(MapUnit::Map100thMM)); Paper ePaper = ImplGetPaperFormat( aPageSize.Width(), aPageSize.Height() ); if( ePaper == PAPER_USER ) ePaper = ImplGetPaperFormat( aPageSize.Height(), aPageSize.Width() ); diff --git a/vcl/source/gdi/print3.cxx b/vcl/source/gdi/print3.cxx index 26d8f5fd2141..4a8006b2a8b6 100644 --- a/vcl/source/gdi/print3.cxx +++ b/vcl/source/gdi/print3.cxx @@ -1282,7 +1282,7 @@ void PrinterController::printFilteredPage( int i_nPage ) } // in N-Up printing set the correct page size - mpImplData->mxPrinter->SetMapMode( MapUnit::Map100thMM ); + mpImplData->mxPrinter->SetMapMode(MapMode(MapUnit::Map100thMM)); // aPageSize was filtered through mpImplData->getRealPaperSize already by getFilteredPageFile() mpImplData->mxPrinter->SetPaperSizeUser( aPageSize.aSize, ! mpImplData->isFixedPageSize() ); if( mpImplData->mnFixedPaperBin != -1 && diff --git a/vcl/source/gdi/textlayout.cxx b/vcl/source/gdi/textlayout.cxx index 8623cd0c6935..f533e84c0ba1 100644 --- a/vcl/source/gdi/textlayout.cxx +++ b/vcl/source/gdi/textlayout.cxx @@ -133,14 +133,14 @@ namespace vcl // now that the Zoom is part of the map mode, reset the target device's font to the "unzoomed" version Font aDrawFont( m_aUnzoomedPointFont ); - aDrawFont.SetFontSize( OutputDevice::LogicToLogic( aDrawFont.GetFontSize(), MapUnit::MapPoint, eTargetMapUnit ) ); + aDrawFont.SetFontSize( OutputDevice::LogicToLogic(aDrawFont.GetFontSize(), MapMode(MapUnit::MapPoint), MapMode(eTargetMapUnit)) ); _rTargetDevice.SetFont( aDrawFont ); // transfer font to the reference device m_rReferenceDevice.Push( PushFlags::FONT | PushFlags::TEXTLAYOUTMODE ); Font aRefFont( m_aUnzoomedPointFont ); aRefFont.SetFontSize( OutputDevice::LogicToLogic( - aRefFont.GetFontSize(), MapUnit::MapPoint, m_rReferenceDevice.GetMapMode().GetMapUnit() ) ); + aRefFont.GetFontSize(), MapMode(MapUnit::MapPoint), m_rReferenceDevice.GetMapMode()) ); m_rReferenceDevice.SetFont( aRefFont ); } diff --git a/vcl/source/gdi/vectorgraphicdata.cxx b/vcl/source/gdi/vectorgraphicdata.cxx index d5d66f80c440..48d6ecf65286 100644 --- a/vcl/source/gdi/vectorgraphicdata.cxx +++ b/vcl/source/gdi/vectorgraphicdata.cxx @@ -59,7 +59,7 @@ BitmapEx convertPrimitive2DSequenceToBitmapEx( aRealRect.Y2 = rTargetRange.getMaxY(); // get system DPI - const Size aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MapUnit::MapInch)); + const Size aDPI(Application::GetDefaultDevice()->LogicToPixel(Size(1, 1), MapMode(MapUnit::MapInch))); const uno::Reference< rendering::XBitmap > xBitmap( xPrimitive2DRenderer->rasterize( diff --git a/vcl/source/outdev/bitmap.cxx b/vcl/source/outdev/bitmap.cxx index 97dc646fda5b..cfdae8d46e9d 100644 --- a/vcl/source/outdev/bitmap.cxx +++ b/vcl/source/outdev/bitmap.cxx @@ -196,7 +196,7 @@ Bitmap OutputDevice::GetDownsampledBitmap( const Size& rDstSz, if( !aBmp.IsEmpty() ) { // do downsampling if necessary - Size aDstSizeTwip( PixelToLogic( LogicToPixel( rDstSz ), MapUnit::MapTwip ) ); + Size aDstSizeTwip( PixelToLogic(LogicToPixel(rDstSz), MapMode(MapUnit::MapTwip)) ); // #103209# Normalize size (mirroring has to happen outside of this method) aDstSizeTwip = Size( labs(aDstSizeTwip.Width()), labs(aDstSizeTwip.Height()) ); diff --git a/vcl/source/window/printdlg.cxx b/vcl/source/window/printdlg.cxx index 39219b35e8e0..441ea7d59721 100644 --- a/vcl/source/window/printdlg.cxx +++ b/vcl/source/window/printdlg.cxx @@ -279,7 +279,7 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap() maPageVDev->Erase(); maPageVDev->Push(); - maPageVDev->SetMapMode( MapUnit::Map100thMM ); + maPageVDev->SetMapMode(MapMode(MapUnit::Map100thMM)); DrawModeFlags nOldDrawMode = maPageVDev->GetDrawMode(); if( mbGreyscale ) maPageVDev->SetDrawMode( maPageVDev->GetDrawMode() | @@ -296,8 +296,8 @@ void PrintDialog::PrintPreviewWindow::preparePreviewBitmap() maPageVDev->Pop(); - SetMapMode( MapUnit::MapPixel ); - maPageVDev->SetMapMode( MapUnit::MapPixel ); + SetMapMode(MapMode(MapUnit::MapPixel)); + maPageVDev->SetMapMode(MapMode(MapUnit::MapPixel)); maPreviewBitmap = maPageVDev->GetBitmap(Point(0, 0), aVDevSize); @@ -322,7 +322,7 @@ void PrintDialog::ShowNupOrderWindow::Paint(vcl::RenderContext& rRenderContext, { Window::Paint(rRenderContext, i_rRect); - rRenderContext.SetMapMode(MapUnit::MapPixel); + rRenderContext.SetMapMode(MapMode(MapUnit::MapPixel)); rRenderContext.SetTextColor(rRenderContext.GetSettings().GetStyleSettings().GetFieldTextColor()); int nPages = mnRows * mnColumns; diff --git a/vcl/source/window/split.cxx b/vcl/source/window/split.cxx index ad991269c258..3421e679614f 100644 --- a/vcl/source/window/split.cxx +++ b/vcl/source/window/split.cxx @@ -695,7 +695,7 @@ void Splitter::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& Size Splitter::GetOptimalSize() const { - return LogicToPixel(Size(3, 3), MapUnit::MapAppFont); + return LogicToPixel(Size(3, 3), MapMode(MapUnit::MapAppFont)); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/xmlsecurity/source/dialogs/certificatechooser.cxx b/xmlsecurity/source/dialogs/certificatechooser.cxx index 941720c4d9f7..08a897f9f0ba 100644 --- a/xmlsecurity/source/dialogs/certificatechooser.cxx +++ b/xmlsecurity/source/dialogs/certificatechooser.cxx @@ -50,7 +50,7 @@ CertificateChooser::CertificateChooser(vcl::Window* _pParent, Size aControlSize(475, 122); const long nControlWidth = aControlSize.Width(); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); SvSimpleTableContainer *pSignatures = get<SvSimpleTableContainer>("signatures"); pSignatures->set_width_request(aControlSize.Width()); pSignatures->set_height_request(aControlSize.Height()); diff --git a/xmlsecurity/source/dialogs/certificateviewer.cxx b/xmlsecurity/source/dialogs/certificateviewer.cxx index 9e6f5760d132..4f206d256118 100644 --- a/xmlsecurity/source/dialogs/certificateviewer.cxx +++ b/xmlsecurity/source/dialogs/certificateviewer.cxx @@ -385,7 +385,7 @@ CertificateViewerCertPathTP::CertificateViewerCertPathTP( vcl::Window* _pParent, maCertImage = get<FixedImage>("imgok")->GetImage(); maCertNotValidatedImage = get<FixedImage>("imgnotok")->GetImage(); - Size aControlSize(LogicToPixel(Size(251, 45), MapUnit::MapAppFont)); + Size aControlSize(LogicToPixel(Size(251, 45), MapMode(MapUnit::MapAppFont))); mpCertPathLB->set_width_request(aControlSize.Width()); mpCertPathLB->set_height_request(aControlSize.Height()); mpCertStatusML->set_width_request(aControlSize.Width()); diff --git a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx index 2e95d0566514..ba726e04d0a5 100644 --- a/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx +++ b/xmlsecurity/source/dialogs/digitalsignaturesdialog.cxx @@ -135,7 +135,7 @@ DigitalSignaturesDialog::DigitalSignaturesDialog( Size aControlSize(375, 109); const long nControlWidth = aControlSize.Width(); - aControlSize = LogicToPixel(aControlSize, MapUnit::MapAppFont); + aControlSize = LogicToPixel(aControlSize, MapMode(MapUnit::MapAppFont)); SvSimpleTableContainer *pSignatures = get<SvSimpleTableContainer>("signatures"); pSignatures->set_width_request(aControlSize.Width()); pSignatures->set_height_request(aControlSize.Height()); |