summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2015-10-23 17:12:43 +0200
committerAndras Timar <andras.timar@collabora.com>2015-11-03 18:10:26 +0100
commit009ff1e9089d69f0936421ae51f45e585ab6208d (patch)
treeeb65b383fd79f8a8224c4a60851c606b8589f33e
parente13e1ae22e8570334f550c7f17b8e8f98f83d010 (diff)
tdf#90987: SlideSorterBarOptions was missing Commit() too
Commit() of related _Impl class actually wasn't called anywhere after 465359c35fcd8c30a2bedd3d0beb07c0c1c36cba removed it from destructor. The config was also never tagged as modified, so fix that too. Change-Id: I8293fee20ec154d5d70a7cda8b015bf723b50c87 Reviewed-on: https://gerrit.libreoffice.org/19558 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit 2e528df76b168a221c6d251d9b076bce5ba051a3) Reviewed-on: https://gerrit.libreoffice.org/19688 Reviewed-by: Norbert Thiebaud <nthiebaud@gmail.com> (cherry picked from commit 7f5062f7a39f56e66992de9adaf9b8af25adab06)
-rw-r--r--svtools/source/config/slidesorterbaropt.cxx45
1 files changed, 38 insertions, 7 deletions
diff --git a/svtools/source/config/slidesorterbaropt.cxx b/svtools/source/config/slidesorterbaropt.cxx
index 9c729c089c96..4f3231e04837 100644
--- a/svtools/source/config/slidesorterbaropt.cxx
+++ b/svtools/source/config/slidesorterbaropt.cxx
@@ -94,7 +94,27 @@ class SvtSlideSorterBarOptions_Impl : public ConfigItem
*/
static Sequence< OUString > GetPropertyNames();
- protected:
+ void SetVisibleViewImpl( bool& bVisibleView, bool bVisible );
+
+ public:
+ void SetVisibleImpressView( bool bVisible)
+ { SetVisibleViewImpl( m_bVisibleImpressView, bVisible ); }
+
+ void SetVisibleOutlineView( bool bVisible)
+ { SetVisibleViewImpl( m_bVisibleOutlineView, bVisible ); }
+
+ void SetVisibleNotesView( bool bVisible)
+ { SetVisibleViewImpl( m_bVisibleNotesView, bVisible ); }
+
+ void SetVisibleHandoutView( bool bVisible)
+ { SetVisibleViewImpl( m_bVisibleHandoutView, bVisible ); }
+
+ void SetVisibleSlideSorterView( bool bVisible)
+ { SetVisibleViewImpl( m_bVisibleSlideSorterView, bVisible ); }
+
+ void SetVisibleDrawView( bool bVisible)
+ { SetVisibleViewImpl( m_bVisibleDrawView, bVisible ); }
+
};
SvtSlideSorterBarOptions_Impl::SvtSlideSorterBarOptions_Impl()
@@ -314,6 +334,15 @@ Sequence< OUString > SvtSlideSorterBarOptions_Impl::GetPropertyNames()
return Sequence< OUString >( pProperties, SAL_N_ELEMENTS( pProperties ) );
}
+void SvtSlideSorterBarOptions_Impl::SetVisibleViewImpl( bool& bVisibleView, bool bVisible )
+{
+ if( bVisibleView != bVisible )
+ {
+ bVisibleView = bVisible;
+ SetModified();
+ }
+}
+
// initialize static member, see definition for further information
// DON'T DO IT IN YOUR HEADER!
SvtSlideSorterBarOptions_Impl* SvtSlideSorterBarOptions::m_pDataContainer = NULL ;
@@ -339,6 +368,8 @@ SvtSlideSorterBarOptions::~SvtSlideSorterBarOptions()
// If last instance was deleted we must destroy our static data container!
if( m_nRefCount <= 0 )
{
+ if (m_pDataContainer->IsModified())
+ m_pDataContainer->Commit();
delete m_pDataContainer;
m_pDataContainer = NULL;
}
@@ -351,7 +382,7 @@ bool SvtSlideSorterBarOptions::GetVisibleImpressView() const
void SvtSlideSorterBarOptions::SetVisibleImpressView(bool bVisible)
{
- m_pDataContainer->m_bVisibleImpressView = bVisible;
+ m_pDataContainer->SetVisibleImpressView( bVisible );
}
bool SvtSlideSorterBarOptions::GetVisibleOutlineView() const
@@ -361,7 +392,7 @@ bool SvtSlideSorterBarOptions::GetVisibleOutlineView() const
void SvtSlideSorterBarOptions::SetVisibleOutlineView(bool bVisible)
{
- m_pDataContainer->m_bVisibleOutlineView = bVisible;
+ m_pDataContainer->SetVisibleOutlineView( bVisible );
}
bool SvtSlideSorterBarOptions::GetVisibleNotesView() const
@@ -371,7 +402,7 @@ bool SvtSlideSorterBarOptions::GetVisibleNotesView() const
void SvtSlideSorterBarOptions::SetVisibleNotesView(bool bVisible)
{
- m_pDataContainer->m_bVisibleNotesView = bVisible;
+ m_pDataContainer->SetVisibleNotesView( bVisible );
}
bool SvtSlideSorterBarOptions::GetVisibleHandoutView() const
@@ -381,7 +412,7 @@ bool SvtSlideSorterBarOptions::GetVisibleHandoutView() const
void SvtSlideSorterBarOptions::SetVisibleHandoutView(bool bVisible)
{
- m_pDataContainer->m_bVisibleHandoutView = bVisible;
+ m_pDataContainer->SetVisibleHandoutView( bVisible );
}
bool SvtSlideSorterBarOptions::GetVisibleSlideSorterView() const
@@ -391,7 +422,7 @@ bool SvtSlideSorterBarOptions::GetVisibleSlideSorterView() const
void SvtSlideSorterBarOptions::SetVisibleSlideSorterView(bool bVisible)
{
- m_pDataContainer->m_bVisibleSlideSorterView = bVisible;
+ m_pDataContainer->SetVisibleSlideSorterView( bVisible );
}
bool SvtSlideSorterBarOptions::GetVisibleDrawView() const
@@ -401,7 +432,7 @@ bool SvtSlideSorterBarOptions::GetVisibleDrawView() const
void SvtSlideSorterBarOptions::SetVisibleDrawView(bool bVisible)
{
- m_pDataContainer->m_bVisibleDrawView = bVisible;
+ m_pDataContainer->SetVisibleDrawView( bVisible );
}
namespace