[Libreoffice-commits] core.git: Branch 'libreoffice-5-3' - cui/source include/svx include/vcl svx/source vcl/source

Caolán McNamara caolanm at redhat.com
Thu Jul 27 20:31:11 UTC 2017


 cui/source/inc/textanim.hxx      |    5 +++++
 cui/source/tabpages/textanim.cxx |   31 ++++++++++++++++---------------
 include/svx/colorbox.hxx         |    8 ++++++--
 include/vcl/button.hxx           |    4 ----
 svx/source/tbxctrls/tbcontrl.cxx |   10 ----------
 vcl/source/control/button.cxx    |    1 -
 6 files changed, 27 insertions(+), 32 deletions(-)

New commits:
commit d747a00f550cc8556e29b29b08c57f84afb4078f
Author: Caolán McNamara <caolanm at redhat.com>
Date:   Thu Jul 27 11:54:28 2017 +0100

    Resolves: tdf#109289 add SvxColorListBox::IsValueChangedFromSaved
    
    and remove PushButton::IsValueChangedFromSaved
    
    (cherry picked from commit 39fd7e97c253153a10161ef3694b64e90e65e80a)
    
    Related: tdf#109289 move PushButton::IsValueChangedFromSaved to consumer
    
    inheriting the IsValueChangedFromSaved from PushButton has allowed
    undesirable behaviour to be selected
    
    (cherry picked from commit 247607727986df0fd0fef198459eb6646e056ea3)
    
    Change-Id: Ib1c51e27fd708c5d4811c90ef5659b4d55dd8860
    fccb1657d2565005e6f9e239c6118f2e5ae7970c
    Reviewed-on: https://gerrit.libreoffice.org/40486
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Stahl <mstahl at redhat.com>

diff --git a/cui/source/inc/textanim.hxx b/cui/source/inc/textanim.hxx
index 8469f3601637..f4bd053d15b8 100644
--- a/cui/source/inc/textanim.hxx
+++ b/cui/source/inc/textanim.hxx
@@ -74,6 +74,11 @@ private:
     void                SelectDirection( SdrTextAniDirection nValue );
     sal_uInt16              GetSelectedDirection();
 
+    TriState m_aUpState;
+    TriState m_aLeftState;
+    TriState m_aRightState;
+    TriState m_aDownState;
+
 public:
     SvxTextAnimationPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs );
     virtual ~SvxTextAnimationPage() override;
diff --git a/cui/source/tabpages/textanim.cxx b/cui/source/tabpages/textanim.cxx
index 2dcc3d39e7f4..cb267984a943 100644
--- a/cui/source/tabpages/textanim.cxx
+++ b/cui/source/tabpages/textanim.cxx
@@ -89,13 +89,14 @@ void SvxTextTabDialog::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
 |*
 \************************************************************************/
 
-SvxTextAnimationPage::SvxTextAnimationPage( vcl::Window* pWindow, const SfxItemSet& rInAttrs ) :
-                SfxTabPage      ( pWindow
-                                  ,"TextAnimation"
-                                  ,"cui/ui/textanimtabpage.ui"
-                                  ,&rInAttrs ),
-                rOutAttrs       ( rInAttrs ),
-                eAniKind        ( SDRTEXTANI_NONE )
+SvxTextAnimationPage::SvxTextAnimationPage(vcl::Window* pWindow, const SfxItemSet& rInAttrs)
+    : SfxTabPage(pWindow, "TextAnimation", "cui/ui/textanimtabpage.ui", &rInAttrs)
+    , rOutAttrs(rInAttrs)
+    , eAniKind(SDRTEXTANI_NONE)
+    , m_aUpState(TRISTATE_INDET)
+    , m_aLeftState(TRISTATE_INDET)
+    , m_aRightState(TRISTATE_INDET)
+    , m_aDownState(TRISTATE_INDET)
 {
     get(m_pLbEffect, "LB_EFFECT");
     get(m_pBoxDirection,"boxDIRECTION");
@@ -201,10 +202,10 @@ void SvxTextAnimationPage::Reset( const SfxItemSet* rAttrs )
         m_pBtnRight->Check( false );
         m_pBtnDown->Check( false );
     }
-    m_pBtnUp->SaveValue();
-    m_pBtnLeft->SaveValue();
-    m_pBtnRight->SaveValue();
-    m_pBtnDown->SaveValue();
+    m_aUpState = m_pBtnUp->GetState();
+    m_aLeftState = m_pBtnLeft->GetState();
+    m_aRightState = m_pBtnRight->GetState();
+    m_aDownState = m_pBtnDown->GetState();
 
     // Start inside
     pItem = GetItem( *rAttrs, SDRATTR_TEXT_ANISTARTINSIDE );
@@ -376,10 +377,10 @@ bool SvxTextAnimationPage::FillItemSet( SfxItemSet* rAttrs)
     }
 
     // animation direction
-    if( m_pBtnUp->IsValueChangedFromSaved() ||
-        m_pBtnLeft->IsValueChangedFromSaved() ||
-        m_pBtnRight->IsValueChangedFromSaved() ||
-        m_pBtnDown->IsValueChangedFromSaved() )
+    if (m_aUpState != m_pBtnUp->GetState() ||
+        m_aLeftState != m_pBtnLeft->GetState() ||
+        m_aRightState != m_pBtnRight->GetState() ||
+        m_aDownState != m_pBtnDown->GetState())
     {
         SdrTextAniDirection eValue = (SdrTextAniDirection) GetSelectedDirection();
         rAttrs->Put( SdrTextAniDirectionItem( eValue ) );
diff --git a/include/svx/colorbox.hxx b/include/svx/colorbox.hxx
index 4b7f2513a984..1d73b5fe1c66 100644
--- a/include/svx/colorbox.hxx
+++ b/include/svx/colorbox.hxx
@@ -34,6 +34,7 @@ private:
     Link<SvxColorListBox&, void> m_aSelectedLink;
     SvxListBoxColorWrapper m_aColorWrapper;
     Color m_aAutoDisplayColor;
+    Color m_aSaveColor;
     NamedColor m_aSelectedColor;
     sal_uInt16 m_nSlotId;
     bool m_bShowNoneButton;
@@ -57,8 +58,8 @@ public:
 
     void SetSlotId(sal_uInt16 nSlotId, bool bShowNoneButton = false);
 
-    NamedColor GetSelectEntry() const;
-    Color GetSelectEntryColor() const;
+    Color GetSelectEntryColor() const { return m_aSelectedColor.first; }
+    NamedColor GetSelectEntry() const { return m_aSelectedColor; }
 
     void SelectEntry(const NamedColor& rColor);
     void SelectEntry(const Color& rColor);
@@ -68,6 +69,9 @@ public:
 
     void SetAutoDisplayColor(const Color &rColor) { m_aAutoDisplayColor = rColor; }
     void ShowPreview(const NamedColor &rColor);
+
+    void SaveValue() { m_aSaveColor = GetSelectEntryColor(); }
+    bool IsValueChangedFromSaved() const { return m_aSaveColor != GetSelectEntryColor(); }
 };
 
 /** A wrapper for SvxColorListBox. */
diff --git a/include/vcl/button.hxx b/include/vcl/button.hxx
index 78df45e006a4..777a784f8ae4 100644
--- a/include/vcl/button.hxx
+++ b/include/vcl/button.hxx
@@ -117,7 +117,6 @@ class VCL_DLLPUBLIC PushButton : public Button
 protected:
     SymbolType      meSymbol;
     TriState        meState;
-    TriState        meSaveValue;
     PushButtonDropdownStyle mnDDStyle;
     bool            mbPressed;
     bool            mbIsActive;
@@ -190,9 +189,6 @@ public:
 
     void            EndSelection();
 
-    void            SaveValue() { meSaveValue = GetState(); }
-    bool            IsValueChangedFromSaved() const { return meSaveValue != GetState(); }
-
     Size            CalcMinimumSize() const;
     virtual Size    GetOptimalSize() const override;
 
diff --git a/svx/source/tbxctrls/tbcontrl.cxx b/svx/source/tbxctrls/tbcontrl.cxx
index 7b5a6cfd7843..02012d508c3f 100644
--- a/svx/source/tbxctrls/tbcontrl.cxx
+++ b/svx/source/tbxctrls/tbcontrl.cxx
@@ -3372,16 +3372,6 @@ void SvxColorListBox::SelectEntry(const Color& rColor)
     ShowPreview(m_aSelectedColor);
 }
 
-Color SvxColorListBox::GetSelectEntryColor() const
-{
-    return m_aSelectedColor.first;
-}
-
-NamedColor SvxColorListBox::GetSelectEntry() const
-{
-    return m_aSelectedColor;
-}
-
 SvxColorListBoxWrapper::SvxColorListBoxWrapper(SvxColorListBox& rListBox)
     : sfx::SingleControlWrapper<SvxColorListBox, Color>(rListBox)
 {
diff --git a/vcl/source/control/button.cxx b/vcl/source/control/button.cxx
index 02cd28ca270a..41763f5a42a8 100644
--- a/vcl/source/control/button.cxx
+++ b/vcl/source/control/button.cxx
@@ -641,7 +641,6 @@ void PushButton::ImplInitPushButtonData()
 
     meSymbol        = SymbolType::DONTKNOW;
     meState         = TRISTATE_FALSE;
-    meSaveValue     = TRISTATE_FALSE;
     mnDDStyle       = PushButtonDropdownStyle::NONE;
     mbIsActive    = false;
     mbPressed       = false;


More information about the Libreoffice-commits mailing list