[Libreoffice-commits] core.git: 2 commits - svx/source sw/source vcl/source

Norbert Thiebaud nthiebaud at gmail.com
Tue Mar 11 13:44:54 PDT 2014


 svx/source/sidebar/tools/ValueSetWithTextControl.cxx |    7 +++----
 svx/source/stbctrls/modctrl.cxx                      |    4 ++--
 svx/source/stbctrls/pszctrl.cxx                      |    3 +--
 svx/source/stbctrls/selctrl.cxx                      |    4 ++--
 svx/source/stbctrls/xmlsecctrl.cxx                   |    2 --
 svx/source/stbctrls/zoomsliderctrl.cxx               |    4 ++--
 svx/source/tbxctrls/tbcontrl.cxx                     |    4 ++--
 sw/source/core/uibase/utlui/content.cxx              |    2 --
 sw/source/core/uibase/utlui/viewlayoutctrl.cxx       |    3 +--
 vcl/source/window/toolbox2.cxx                       |    3 +--
 vcl/source/window/window.cxx                         |   10 ++++++++--
 11 files changed, 22 insertions(+), 24 deletions(-)

New commits:
commit 58fae0f715433a72d814584d97a1368f8a1b62d2
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Mar 11 15:43:48 2014 -0500

    remove osolete ifdef
    
    now that the ScaleDPI is forced to 1 on mac there is no need
    for these ifdef
    
    Change-Id: I0ca3bc301b63f5f4c7d1eb36f27bc9b6ab41af29

diff --git a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
index 51c157f..5dd6e99 100644
--- a/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
+++ b/svx/source/sidebar/tools/ValueSetWithTextControl.cxx
@@ -101,7 +101,6 @@ void ValueSetWithTextControl::AddItem(
                                 ? *pSelectedItemImage
                                 : rItemImage;
 
-#ifndef MACOSX
     if ( GetDPIScaleFactor() > 1 )
     {
         BitmapEx b = aItem.maItemImage.GetBitmapEx();
@@ -115,7 +114,7 @@ void ValueSetWithTextControl::AddItem(
             aItem.maSelectedItemImage = Image(b);
         }
     }
-#endif
+
     aItem.maItemText = rItemText;
 
     maItems.push_back( aItem );
@@ -169,7 +168,7 @@ void ValueSetWithTextControl::ReplaceItemImages(
                                              ? *pSelectedItemImage
                                              : rItemImage;
 
-#ifndef MACOSX
+//#ifndef MACOSX
     if ( GetDPIScaleFactor() > 1 )
     {
         BitmapEx b = maItems[nItemId-1].maItemImage.GetBitmapEx();
@@ -183,7 +182,7 @@ void ValueSetWithTextControl::ReplaceItemImages(
             maItems[nItemId-1].maSelectedItemImage = Image(b);
         }
     }
-#endif
+//#endif
 }
 
 
diff --git a/svx/source/stbctrls/modctrl.cxx b/svx/source/stbctrls/modctrl.cxx
index 3d7c577..15bc693 100644
--- a/svx/source/stbctrls/modctrl.cxx
+++ b/svx/source/stbctrls/modctrl.cxx
@@ -73,7 +73,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, Status
     SfxStatusBarControl( _nSlotId, _nId, rStb ),
     mpImpl(new ImplData)
 {
-#ifndef MACOSX
+//#ifndef MACOSX
     if ( rStb.GetDPIScaleFactor() > 1 )
     {
         for (int i = 0; i < mpImpl->MODIFICATION_STATE_SIZE; i++)
@@ -83,7 +83,7 @@ SvxModifyControl::SvxModifyControl( sal_uInt16 _nSlotId, sal_uInt16 _nId, Status
             mpImpl->maImages[i] = Image(b);
         }
     }
-#endif
+//#endif
     mpImpl->maTimer.SetTimeoutHdl( LINK(this, SvxModifyControl, OnTimer) );
 }
 
diff --git a/svx/source/stbctrls/pszctrl.cxx b/svx/source/stbctrls/pszctrl.cxx
index 634badf..a3383fe 100644
--- a/svx/source/stbctrls/pszctrl.cxx
+++ b/svx/source/stbctrls/pszctrl.cxx
@@ -178,7 +178,6 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( sal_uInt16 _nSlotId,
     pImp->aPosImage = Image( ResId( RID_SVXBMP_POSITION, DIALOG_MGR() ) );
     pImp->aSizeImage = Image( ResId( RID_SVXBMP_SIZE, DIALOG_MGR() ) );
 
-#ifndef MACOSX
     if ( rStb.GetDPIScaleFactor() > 1)
     {
         BitmapEx b = pImp->aPosImage.GetBitmapEx();
@@ -189,7 +188,7 @@ SvxPosSizeStatusBarControl::SvxPosSizeStatusBarControl( sal_uInt16 _nSlotId,
         b.Scale(rStb.GetDPIScaleFactor(), rStb.GetDPIScaleFactor(), BMP_SCALE_FAST);
         pImp->aSizeImage = Image(b);
     }
-#endif
+
     addStatusListener( OUString( STR_POSITION ));         // SID_ATTR_POSITION
     addStatusListener( OUString( STR_TABLECELL ));   // SID_TABLE_CELL
     addStatusListener( OUString( STR_FUNC ));    // SID_PSZ_FUNCTION
diff --git a/svx/source/stbctrls/selctrl.cxx b/svx/source/stbctrls/selctrl.cxx
index a56cd0a..acfb2da 100644
--- a/svx/source/stbctrls/selctrl.cxx
+++ b/svx/source/stbctrls/selctrl.cxx
@@ -80,14 +80,14 @@ SvxSelectionModeControl::SvxSelectionModeControl( sal_uInt16 _nSlotId,
     mnState( 0 ),
     maImage( SVX_RES( RID_SVXBMP_SELECTION ) )
 {
-#ifndef MACOSX
+//#ifndef MACOSX
     if ( GetStatusBar().GetDPIScaleFactor() > 1 )
     {
         BitmapEx b = maImage.GetBitmapEx();
         b.Scale(GetStatusBar().GetDPIScaleFactor(), GetStatusBar().GetDPIScaleFactor(), BMP_SCALE_FAST);
         maImage = Image(b);
     }
-#endif
+//#endif
     GetStatusBar().SetItemText( GetId(), "" );
 }
 
diff --git a/svx/source/stbctrls/xmlsecctrl.cxx b/svx/source/stbctrls/xmlsecctrl.cxx
index 1ecfd52..46ea35b 100644
--- a/svx/source/stbctrls/xmlsecctrl.cxx
+++ b/svx/source/stbctrls/xmlsecctrl.cxx
@@ -61,7 +61,6 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nSlotId,  sal_uInt16
     mpImpl->maImageBroken       = Image( SVX_RES( RID_SVXBMP_SIGNET_BROKEN       ) );
     mpImpl->maImageNotValidated = Image( SVX_RES( RID_SVXBMP_SIGNET_NOTVALIDATED ) );
 
-#ifndef MACOSX
     if (_rStb.GetDPIScaleFactor() > 1)
     {
         Image arr[3] = {mpImpl->maImage, mpImpl->maImageBroken, mpImpl->maImageNotValidated};
@@ -77,7 +76,6 @@ XmlSecStatusBarControl::XmlSecStatusBarControl( sal_uInt16 _nSlotId,  sal_uInt16
         mpImpl->maImageBroken = arr[1];
         mpImpl->maImageNotValidated = arr[2];
     }
-#endif
 
 }
 
diff --git a/svx/source/stbctrls/zoomsliderctrl.cxx b/svx/source/stbctrls/zoomsliderctrl.cxx
index 95aeda1..7497bfa 100644
--- a/svx/source/stbctrls/zoomsliderctrl.cxx
+++ b/svx/source/stbctrls/zoomsliderctrl.cxx
@@ -171,7 +171,7 @@ SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId,  sal_uInt16 _nI
     mpImpl->maIncreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERINCREASE ) );
     mpImpl->maDecreaseButton = Image( SVX_RES( RID_SVXBMP_SLIDERDECREASE ) );
 
-#ifndef MACOSX
+//#ifndef MACOSX
     if ( _rStb.GetDPIScaleFactor() > 1)
     {
         Image arr[3] = {mpImpl->maSliderButton, mpImpl->maIncreaseButton, mpImpl->maDecreaseButton};
@@ -187,7 +187,7 @@ SvxZoomSliderControl::SvxZoomSliderControl( sal_uInt16 _nSlotId,  sal_uInt16 _nI
         mpImpl->maIncreaseButton = arr[1];
         mpImpl->maDecreaseButton = arr[2];
     }
-#endif
+//#endif
 }
 
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 5a7cec2..3d47566 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -1275,7 +1275,7 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl( sal_uInt16 nId, const Reference< XFram
     BindListener();
     AddStatusListener(OUString(".uno:BorderReducedMode"));
     aImgList = ImageList( SVX_RES( RID_SVXIL_FRAME ) );
-#ifndef MACOSX
+
     if( pParentWindow->GetDPIScaleFactor() > 1 )
     {
         for (short i = 0; i < aImgList.GetImageCount(); i++)
@@ -1286,7 +1286,7 @@ SvxFrameWindow_Impl::SvxFrameWindow_Impl( sal_uInt16 nId, const Reference< XFram
             aImgList.ReplaceImage(rImageName, Image(b));
         }
     }
-#endif
+
     /*
      *  1       2        3         4
      *  -------------------------------------
diff --git a/sw/source/core/uibase/utlui/content.cxx b/sw/source/core/uibase/utlui/content.cxx
index 9ffcf86..2204074 100644
--- a/sw/source/core/uibase/utlui/content.cxx
+++ b/sw/source/core/uibase/utlui/content.cxx
@@ -1563,7 +1563,6 @@ void SwContentTree::Display( bool bActive )
     {
         aEntryImages = ImageList(SW_RES(IMG_NAVI_ENTRYBMP));
 
-#ifndef MACSOX
         if ( GetDPIScaleFactor() > 1 )
         {
             for (short i = 0; i < aEntryImages.GetImageCount(); i++)
@@ -1575,7 +1574,6 @@ void SwContentTree::Display( bool bActive )
                 aEntryImages.ReplaceImage(rImageName, Image(b));
             }
         }
-#endif
         bIsImageListInitialized = true;
     }
     // First read the selected entry to select it later again if necessary
diff --git a/sw/source/core/uibase/utlui/viewlayoutctrl.cxx b/sw/source/core/uibase/utlui/viewlayoutctrl.cxx
index 18a9212..798213d 100644
--- a/sw/source/core/uibase/utlui/viewlayoutctrl.cxx
+++ b/sw/source/core/uibase/utlui/viewlayoutctrl.cxx
@@ -52,7 +52,6 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId,
     mpImpl->maImageBookMode             = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE) );
     mpImpl->maImageBookMode_Active      = Image( SW_RES(IMG_VIEWLAYOUT_BOOKMODE_ACTIVE) );
 
-#ifndef MACOSX
     if ( rStb.GetDPIScaleFactor() > 1)
     {
         Image arr[6] = {mpImpl->maImageSingleColumn, mpImpl->maImageSingleColumn_Active,
@@ -76,7 +75,7 @@ SwViewLayoutControl::SwViewLayoutControl( sal_uInt16 _nSlotId, sal_uInt16 _nId,
         mpImpl->maImageBookMode = arr[4];
         mpImpl->maImageBookMode_Active = arr[5];
     }
-#endif
+
 }
 
 SwViewLayoutControl::~SwViewLayoutControl()
diff --git a/vcl/source/window/toolbox2.cxx b/vcl/source/window/toolbox2.cxx
index af2f167..c62016e 100644
--- a/vcl/source/window/toolbox2.cxx
+++ b/vcl/source/window/toolbox2.cxx
@@ -1236,7 +1236,6 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
     {
         Image aImage(rImage);
 
-#ifndef MACOSX
         if ( GetDPIScaleFactor() > 1)
         {
             BitmapEx aBitmap(aImage.GetBitmapEx());
@@ -1249,7 +1248,7 @@ void ToolBox::SetItemImage( sal_uInt16 nItemId, const Image& rImage )
                 aImage = Image(aBitmap);
             }
         }
-#endif
+
         ImplToolItem* pItem = &mpData->m_aItems[nPos];
         // only once all is calculated, do extra work
         if ( !mbCalc )
commit 4dbb04e5701efe084fbfd3f06128dd33a7d8965b
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date:   Tue Mar 11 15:42:49 2014 -0500

    force DPIScaleFactor to 1 on Mac
    
    Change-Id: I37629e1ef18f9843fcbdd643d8aaee0b3c8baa73

diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index 54a6835..d4a0087 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -1067,8 +1067,11 @@ void Window::ImplInit( Window* pParent, WinBits nStyle, SystemParentData* pSyste
     }
 
     // setup the scale factor for Hi-DPI displays
+#ifdef MACOSX
+    mnDPIScaleFactor = 1;
+#else
     mnDPIScaleFactor = std::max((sal_Int32)1, (mpWindowImpl->mpFrameData->mnDPIY + 48) / 96);
-
+#endif
     const StyleSettings& rStyleSettings = mxSettings->GetStyleSettings();
     sal_uInt16 nScreenZoom = rStyleSettings.GetScreenZoom();
     mnDPIX          = (mpWindowImpl->mpFrameData->mnDPIX*nScreenZoom)/100;
@@ -1812,8 +1815,11 @@ void Window::ImplInitResolutionSettings()
         mnDPIY = (mpWindowImpl->mpFrameData->mnDPIY*nScreenZoom)/100;
 
         // setup the scale factor for Hi-DPI displays
+#ifdef MACOSX
+        mnDPIScaleFactor = 1;
+#else
         mnDPIScaleFactor = std::max((sal_Int32)1, (mpWindowImpl->mpFrameData->mnDPIY + 48) / 96);
-
+#endif
         SetPointFont( rStyleSettings.GetAppFont() );
     }
     else if ( mpWindowImpl->mpParent )


More information about the Libreoffice-commits mailing list