diff options
author | Chris Sherlock <chris.sherlock79@gmail.com> | 2014-02-07 22:32:58 +1100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-02-10 20:38:22 +0000 |
commit | 19c5867f922e9acf0564b6213fa15cc899a77c16 (patch) | |
tree | 03e42a8535a955cec57f0e054f23878d2170ade3 | |
parent | 32210fc19324c659603e1dfed1ed006072ccf22f (diff) |
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@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | include/vcl/outdev.hxx | 2 | ||||
-rw-r--r-- | include/vcl/print.hxx | 2 | ||||
-rw-r--r-- | include/vcl/window.hxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/outdev.cxx | 4 | ||||
-rw-r--r-- | vcl/source/gdi/print.cxx | 6 | ||||
-rw-r--r-- | vcl/source/window/dockmgr.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/floatwin.cxx | 4 | ||||
-rw-r--r-- | vcl/source/window/status.cxx | 3 | ||||
-rw-r--r-- | vcl/source/window/window.cxx | 6 |
9 files changed, 23 insertions, 11 deletions
diff --git a/include/vcl/outdev.hxx b/include/vcl/outdev.hxx index 7458475a428b..546331be8ea1 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 93595fcfbc2c..672b1fd62ae2 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 bf6bf2467e59..51cd179760ef 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 485ebb2a91a8..b2c73b0ac324 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 a77bdce9ec51..f064c2ef7afd 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 f33886f327fa..495d8074e4db 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 e836e62d3aec..e459fadc527d 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 f2a92727dba5..d31c6447f4a8 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 e2569383406e..661362ac1a5c 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(); |