[Libreoffice-commits] core.git: include/vcl vcl/source

Chris Sherlock chris.sherlock79 at gmail.com
Mon Feb 10 12:38:51 PST 2014


 include/vcl/outdev.hxx         |    2 +-
 include/vcl/print.hxx          |    2 ++
 include/vcl/window.hxx         |    4 ++++
 vcl/source/gdi/outdev.cxx      |    4 ----
 vcl/source/gdi/print.cxx       |    6 ++++++
 vcl/source/window/dockmgr.cxx  |    3 +--
 vcl/source/window/floatwin.cxx |    4 ++--
 vcl/source/window/status.cxx   |    3 +--
 vcl/source/window/window.cxx   |    6 ++++++
 9 files changed, 23 insertions(+), 11 deletions(-)

New commits:
commit 19c5867f922e9acf0564b6213fa15cc899a77c16
Author: Chris Sherlock <chris.sherlock79 at gmail.com>
Date:   Fri Feb 7 22:32:58 2014 +1100

    fdo#74424 HasMirroredGraphics changes
    
    HasMirroredGraphics should be called upon by the object using the
    OutputDevice. As I'm focussing on Window, which will be shortly decoupled
    from OutputDevice, I have changed HasMirroredGraphics into a virtual
    function, and introduced a wrapper function of the same name into Window
    that calls upon Window's OutputDevice object.
    
    Due to a bug that never appears to have been fully fixed, mirroring in
    printing was broken and a workaround ("hotfix" in the code!) was
    implemented but never fully fixed. Therefore, I have overridden
    HasMirroredGraphics in Printer and just return false.
    
    Change-Id: I9029e2c50cdb339c1e936bed6b92e8b2aac1dcf9
    Reviewed-on: https://gerrit.libreoffice.org/7912
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx
index 7458475..546331b 100644
--- a/include/vcl/outdev.hxx
+++ b/include/vcl/outdev.hxx
@@ -755,7 +755,7 @@ public:
      */
     ///@{
     SAL_DLLPRIVATE sal_Bool     ImplIsRecordLayout() const;
-    SAL_DLLPRIVATE bool         HasMirroredGraphics() const;
+    virtual bool                HasMirroredGraphics() const;
     SAL_DLLPRIVATE void         ReMirror( Point &rPoint ) const;
     SAL_DLLPRIVATE void         ReMirror( Rectangle &rRect ) const;
     SAL_DLLPRIVATE void         ReMirror( Region &rRegion ) const;
diff --git a/include/vcl/print.hxx b/include/vcl/print.hxx
index 93595fc..672b1fd 100644
--- a/include/vcl/print.hxx
+++ b/include/vcl/print.hxx
@@ -373,6 +373,8 @@ public:
                           const JobSetup& i_rInitSetup
                           );
 
+    virtual bool HasMirroredGraphics() const;
+
     // implementation detail of PrintJob being asynchronous
     // not exported, not usable outside vcl
     static void SAL_DLLPRIVATE ImplPrintJob( const boost::shared_ptr<vcl::PrinterController>& i_pController,
diff --git a/include/vcl/window.hxx b/include/vcl/window.hxx
index bf6bf24..51cd179 100644
--- a/include/vcl/window.hxx
+++ b/include/vcl/window.hxx
@@ -575,6 +575,10 @@ protected:
     virtual Window* getAccessibleRelationLabelFor() const;
     virtual sal_uInt16 getDefaultAccessibleRole() const;
     virtual OUString getDefaultAccessibleName() const;
+
+public:
+    bool HasMirroredGraphics() const;
+
 public:
     // Single argument ctors shall be explicit.
     explicit            Window( Window* pParent, WinBits nStyle = 0 );
diff --git a/vcl/source/gdi/outdev.cxx b/vcl/source/gdi/outdev.cxx
index 485ebb2..b2c73b0 100644
--- a/vcl/source/gdi/outdev.cxx
+++ b/vcl/source/gdi/outdev.cxx
@@ -483,10 +483,6 @@ void OutputDevice::EnableRTL( sal_Bool bEnable )
 
 bool OutputDevice::HasMirroredGraphics() const
 {
-   // HOTFIX for #i55719#
-   if( meOutDevType == OUTDEV_PRINTER )
-       return false;
-
    return ( ImplGetGraphics() && (mpGraphics->GetLayout() & SAL_LAYOUT_BIDI_RTL) );
 }
 
diff --git a/vcl/source/gdi/print.cxx b/vcl/source/gdi/print.cxx
index a77bdce..f064c2e 100644
--- a/vcl/source/gdi/print.cxx
+++ b/vcl/source/gdi/print.cxx
@@ -213,6 +213,12 @@ void Printer::SetPrinterOptions( const PrinterOptions& i_rOptions )
     *mpPrinterOptions = i_rOptions;
 }
 
+bool Printer::HasMirroredGraphics() const
+{
+    // due to a "hotfix" for AOO bug i55719, this needs to return false
+    return false;
+}
+
 // QueueInfo
 QueueInfo::QueueInfo()
 {
diff --git a/vcl/source/window/dockmgr.cxx b/vcl/source/window/dockmgr.cxx
index f33886f..495d807 100644
--- a/vcl/source/window/dockmgr.cxx
+++ b/vcl/source/window/dockmgr.cxx
@@ -802,8 +802,7 @@ void ImplPopupFloatWin::MouseButtonDown( const MouseEvent& rMEvt )
     {
         // get mouse pos at a static window to have a fixed reference point
         PointerState aState = GetParent()->GetPointerState();
-        const OutputDevice *pOutDev = GetOutDev();
-        if (pOutDev->HasMirroredGraphics() && IsRTLEnabled())
+        if (HasMirroredGraphics() && IsRTLEnabled())
             ImplMirrorFramePos(aState.maPos);
         maTearOffPosition = GetWindow( WINDOW_BORDER )->GetPosPixel();
         maDelta = aState.maPos - maTearOffPosition;
diff --git a/vcl/source/window/floatwin.cxx b/vcl/source/window/floatwin.cxx
index e836e62..e459fad 100644
--- a/vcl/source/window/floatwin.cxx
+++ b/vcl/source/window/floatwin.cxx
@@ -457,7 +457,7 @@ FloatingWindow* FloatingWindow::ImplFloatHitTest( Window* pReference, const Poin
     const OutputDevice *pWindowOutDev = pReference->GetOutDev();
 
     // compare coordinates in absolute screen coordinates
-    if( pWindowOutDev->HasMirroredGraphics()  )
+    if( pReference->HasMirroredGraphics()  )
     {
         if(!pReference->IsRTLEnabled() )
             // --- RTL --- re-mirror back to get device coordiantes
@@ -690,7 +690,7 @@ void FloatingWindow::StartPopupMode( const Rectangle& rRect, sal_uLong nFlags )
 
     // compare coordinates in absolute screen coordinates
     // Keep in sync with FloatingWindow::ImplFloatHitTest, e.g. fdo#33509
-    if( pParentWinOutDev->HasMirroredGraphics()  )
+    if( pReference->HasMirroredGraphics()  )
     {
         if(!pReference->IsRTLEnabled() )
             // --- RTL --- re-mirror back to get device coordiantes
diff --git a/vcl/source/window/status.cxx b/vcl/source/window/status.cxx
index f2a9272..d31c644 100644
--- a/vcl/source/window/status.cxx
+++ b/vcl/source/window/status.cxx
@@ -283,8 +283,7 @@ void StatusBar::ImplFormat()
         }
         nX = STATUSBAR_OFFSET_X;
 
-        const OutputDevice *pOutDev = GetOutDev();
-        if( pOutDev->HasMirroredGraphics() && IsRTLEnabled() )
+        if( HasMirroredGraphics() && IsRTLEnabled() )
             nX += ImplGetSVData()->maNWFData.mnStatusBarLowerRightOffset;
     }
 
diff --git a/vcl/source/window/window.cxx b/vcl/source/window/window.cxx
index e256938..661362a 100644
--- a/vcl/source/window/window.cxx
+++ b/vcl/source/window/window.cxx
@@ -353,6 +353,12 @@ const char* ImplDbgCheckWindow( const void* pObj )
 
 // =======================================================================
 
+bool Window::HasMirroredGraphics() const
+{
+    const OutputDevice* pOutDev = GetOutDev();
+    return pOutDev->OutputDevice::HasMirroredGraphics();
+}
+
 void Window::ImplInitAppFontData( Window* pWindow )
 {
     ImplSVData* pSVData = ImplGetSVData();


More information about the Libreoffice-commits mailing list