summaryrefslogtreecommitdiff
path: root/sw
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2020-01-20 13:51:56 +0000
committerCaolán McNamara <caolanm@redhat.com>2020-01-20 15:56:06 +0100
commite0e0f634987c52a040e1514825d239013b05e7b2 (patch)
tree9292cd4e75cd1cfdfd0e38b3c0787190ac1d7616 /sw
parentf3797630be6ab21179e2496cc56a6d41f0ee8144 (diff)
StoreUserCustomValues should be used
Change-Id: I64d41d297c55d36fc14f16945fa1369be990aa3e Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87074 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.cxx36
-rw-r--r--sw/source/uibase/sidebar/PageMarginControl.hxx1
2 files changed, 37 insertions, 0 deletions
diff --git a/sw/source/uibase/sidebar/PageMarginControl.cxx b/sw/source/uibase/sidebar/PageMarginControl.cxx
index a0fdef8959b6..258b5996d052 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.cxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.cxx
@@ -233,6 +233,7 @@ void PageMarginControl::GrabFocus()
PageMarginControl::~PageMarginControl()
{
+ StoreUserCustomValues();
}
void PageMarginControl::SetMetricFieldMaxValues( const Size& rPageSize )
@@ -545,6 +546,41 @@ bool PageMarginControl::GetUserCustomValues()
return bUserCustomValuesAvailable;
}
+void PageMarginControl::StoreUserCustomValues()
+{
+ if ( !m_bCustomValuesUsed )
+ {
+ return;
+ }
+
+ css::uno::Sequence < css::beans::NamedValue > aSeq( 1 );
+ SvtViewOptions aWinOpt( EViewType::Window, SWPAGE_LEFT_GVALUE );
+
+ aSeq[0].Name = "mnPageLeftMargin";
+ aSeq[0].Value <<= OUString::number( m_nPageLeftMargin );
+ aWinOpt.SetUserData( aSeq );
+
+ SvtViewOptions aWinOpt2( EViewType::Window, SWPAGE_RIGHT_GVALUE );
+ aSeq[0].Name = "mnPageRightMargin";
+ aSeq[0].Value <<= OUString::number( m_nPageRightMargin );
+ aWinOpt2.SetUserData( aSeq );
+
+ SvtViewOptions aWinOpt3( EViewType::Window, SWPAGE_TOP_GVALUE );
+ aSeq[0].Name = "mnPageTopMargin";
+ aSeq[0].Value <<= OUString::number( m_nPageTopMargin );
+ aWinOpt3.SetUserData( aSeq );
+
+ SvtViewOptions aWinOpt4( EViewType::Window, SWPAGE_DOWN_GVALUE );
+ aSeq[0].Name = "mnPageBottomMargin";
+ aSeq[0].Value <<= OUString::number( m_nPageBottomMargin );
+ aWinOpt4.SetUserData( aSeq );
+
+ SvtViewOptions aWinOpt5( EViewType::Window, SWPAGE_MIRROR_GVALUE );
+ aSeq[0].Name = "mbMirrored";
+ aSeq[0].Value <<= OUString::number( (m_bMirrored ? 1 : 0) );
+ aWinOpt5.SetUserData( aSeq );
+}
+
} // end of namespace sw::sidebar
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/uibase/sidebar/PageMarginControl.hxx b/sw/source/uibase/sidebar/PageMarginControl.hxx
index a549948926fe..83b98c0e244c 100644
--- a/sw/source/uibase/sidebar/PageMarginControl.hxx
+++ b/sw/source/uibase/sidebar/PageMarginControl.hxx
@@ -97,6 +97,7 @@ private:
void SetMetricFieldMaxValues(const Size& rPageSize);
bool GetUserCustomValues();
+ void StoreUserCustomValues();
void FillHelpText( const bool bUserCustomValuesAvailable );
};