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

Caolán McNamara caolanm at redhat.com
Thu Sep 24 09:06:12 PDT 2015


 sw/source/uibase/frmdlg/colex.cxx |   15 ++++++++-------
 sw/source/uibase/inc/colex.hxx    |    5 +++--
 2 files changed, 11 insertions(+), 9 deletions(-)

New commits:
commit 32193abe8ff1dfec2b95e152d0c421af48bd1b84
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Sep 24 17:04:15 2015 +0100

    move m_bVertical down to SwPageExample from SwPageGridExample
    
    Change-Id: I242d8e7296daff83d73c199f5f593200796607bc

diff --git a/sw/source/uibase/frmdlg/colex.cxx b/sw/source/uibase/frmdlg/colex.cxx
index 4da20e8..1bf1963 100644
--- a/sw/source/uibase/frmdlg/colex.cxx
+++ b/sw/source/uibase/frmdlg/colex.cxx
@@ -44,6 +44,14 @@
 // Taking the updated values from the set
 void SwPageExample::UpdateExample( const SfxItemSet& rSet )
 {
+    if (SfxItemState::DEFAULT <= rSet.GetItemState(RES_FRAMEDIR, true))
+    {
+        const SvxFrameDirectionItem& rDirItem =
+                    static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR));
+        m_bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT||
+                    rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT;
+    }
+
     SfxItemPool* pPool = rSet.GetPool();
     sal_uInt16 nWhich = pPool->GetWhich( SID_ATTR_PAGE );
     if ( rSet.GetItemState( nWhich, false ) == SfxItemState::SET )
@@ -590,13 +598,6 @@ void SwPageGridExample::UpdateExample( const SfxItemSet& rSet )
     //get the grid information
     if(SfxItemState::DEFAULT <= rSet.GetItemState(RES_TEXTGRID, true))
         pGridItem = static_cast<SwTextGridItem*>(static_cast<const SwTextGridItem&>(rSet.Get(RES_TEXTGRID)).Clone());
-    if( SfxItemState::DEFAULT <= rSet.GetItemState( RES_FRAMEDIR, true ))
-    {
-        const SvxFrameDirectionItem& rDirItem =
-                    static_cast<const SvxFrameDirectionItem&>(rSet.Get(RES_FRAMEDIR));
-        m_bVertical = rDirItem.GetValue() == FRMDIR_VERT_TOP_RIGHT||
-                    rDirItem.GetValue() == FRMDIR_VERT_TOP_LEFT;
-    }
     SwPageExample::UpdateExample(rSet);
 }
 
diff --git a/sw/source/uibase/inc/colex.hxx b/sw/source/uibase/inc/colex.hxx
index 506b416..f15e80b 100644
--- a/sw/source/uibase/inc/colex.hxx
+++ b/sw/source/uibase/inc/colex.hxx
@@ -30,9 +30,12 @@ class SfxItemSet;
 
 class SW_DLLPUBLIC SwPageExample : public SvxPageWindow
 {
+protected:
+    bool            m_bVertical;
 public:
     SwPageExample(vcl::Window* pPar)
         : SvxPageWindow(pPar)
+        , m_bVertical(false)
     {
         SetSize(SvxPaperInfo::GetPaperSize(PAPER_A4));
     }
@@ -45,7 +48,6 @@ class SwTextGridItem;
 class SW_DLLPUBLIC SwPageGridExample : public SwPageExample
 {
     SwTextGridItem*     pGridItem;
-    bool            m_bVertical;
 protected:
     virtual void DrawPage(vcl::RenderContext& rRenderContext,
                           const Point& rPoint,
@@ -55,7 +57,6 @@ public:
     SwPageGridExample(vcl::Window* pPar)
         : SwPageExample(pPar)
         , pGridItem(0)
-        , m_bVertical(false)
     {}
 
     virtual ~SwPageGridExample();


More information about the Libreoffice-commits mailing list