xref: /AOO41X/main/sw/source/ui/sidebar/PageMarginControl.cxx (revision ff0525f24f03981d56b7579b645949f111420994)
1*ff0525f2SOliver-Rainer Wittmann /**************************************************************
2*ff0525f2SOliver-Rainer Wittmann  *
3*ff0525f2SOliver-Rainer Wittmann  * Licensed to the Apache Software Foundation (ASF) under one
4*ff0525f2SOliver-Rainer Wittmann  * or more contributor license agreements.  See the NOTICE file
5*ff0525f2SOliver-Rainer Wittmann  * distributed with this work for additional information
6*ff0525f2SOliver-Rainer Wittmann  * regarding copyright ownership.  The ASF licenses this file
7*ff0525f2SOliver-Rainer Wittmann  * to you under the Apache License, Version 2.0 (the
8*ff0525f2SOliver-Rainer Wittmann  * "License"); you may not use this file except in compliance
9*ff0525f2SOliver-Rainer Wittmann  * with the License.  You may obtain a copy of the License at
10*ff0525f2SOliver-Rainer Wittmann  *
11*ff0525f2SOliver-Rainer Wittmann  *   http://www.apache.org/licenses/LICENSE-2.0
12*ff0525f2SOliver-Rainer Wittmann  *
13*ff0525f2SOliver-Rainer Wittmann  * Unless required by applicable law or agreed to in writing,
14*ff0525f2SOliver-Rainer Wittmann  * software distributed under the License is distributed on an
15*ff0525f2SOliver-Rainer Wittmann  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*ff0525f2SOliver-Rainer Wittmann  * KIND, either express or implied.  See the License for the
17*ff0525f2SOliver-Rainer Wittmann  * specific language governing permissions and limitations
18*ff0525f2SOliver-Rainer Wittmann  * under the License.
19*ff0525f2SOliver-Rainer Wittmann  *
20*ff0525f2SOliver-Rainer Wittmann  *************************************************************/
21*ff0525f2SOliver-Rainer Wittmann 
22*ff0525f2SOliver-Rainer Wittmann #include "precompiled_sw.hxx"
23*ff0525f2SOliver-Rainer Wittmann 
24*ff0525f2SOliver-Rainer Wittmann #include "PageMarginControl.hxx"
25*ff0525f2SOliver-Rainer Wittmann #include "PagePropertyPanel.hxx"
26*ff0525f2SOliver-Rainer Wittmann #include "PagePropertyPanel.hrc"
27*ff0525f2SOliver-Rainer Wittmann 
28*ff0525f2SOliver-Rainer Wittmann #include <swtypes.hxx>
29*ff0525f2SOliver-Rainer Wittmann 
30*ff0525f2SOliver-Rainer Wittmann #include <svx/sidebar/ValueSetWithTextControl.hxx>
31*ff0525f2SOliver-Rainer Wittmann 
32*ff0525f2SOliver-Rainer Wittmann #define SWPAGE_LEFT_GVALUE      String("Sw_Page_Left", 12, RTL_TEXTENCODING_ASCII_US)
33*ff0525f2SOliver-Rainer Wittmann #define SWPAGE_RIGHT_GVALUE     String("Sw_Page_Right", 13, RTL_TEXTENCODING_ASCII_US)
34*ff0525f2SOliver-Rainer Wittmann #define SWPAGE_TOP_GVALUE       String("Sw_Page_Top", 11, RTL_TEXTENCODING_ASCII_US)
35*ff0525f2SOliver-Rainer Wittmann #define SWPAGE_DOWN_GVALUE      String("Sw_Page_Down", 12, RTL_TEXTENCODING_ASCII_US)
36*ff0525f2SOliver-Rainer Wittmann #define SWPAGE_MIRROR_GVALUE    String("Sw_Page_Mirrored", 16, RTL_TEXTENCODING_ASCII_US)
37*ff0525f2SOliver-Rainer Wittmann 
38*ff0525f2SOliver-Rainer Wittmann 
39*ff0525f2SOliver-Rainer Wittmann namespace sw { namespace sidebar {
40*ff0525f2SOliver-Rainer Wittmann 
41*ff0525f2SOliver-Rainer Wittmann PageMarginControl::PageMarginControl(
42*ff0525f2SOliver-Rainer Wittmann     Window* pParent,
43*ff0525f2SOliver-Rainer Wittmann     PagePropertyPanel& rPanel,
44*ff0525f2SOliver-Rainer Wittmann     const SvxLongLRSpaceItem& aPageLRMargin,
45*ff0525f2SOliver-Rainer Wittmann     const SvxLongULSpaceItem& aPageULMargin,
46*ff0525f2SOliver-Rainer Wittmann     const bool bMirrored,
47*ff0525f2SOliver-Rainer Wittmann     const Size aPageSize,
48*ff0525f2SOliver-Rainer Wittmann     const sal_Bool bLandscape,
49*ff0525f2SOliver-Rainer Wittmann     const FieldUnit eFUnit,
50*ff0525f2SOliver-Rainer Wittmann     const SfxMapUnit eUnit )
51*ff0525f2SOliver-Rainer Wittmann     : ::svx::sidebar::PopupControl( pParent, SW_RES(RID_POPUP_SWPAGE_MARGIN) )
52*ff0525f2SOliver-Rainer Wittmann     , mpMarginValueSet( new ::svx::sidebar::ValueSetWithTextControl( ::svx::sidebar::ValueSetWithTextControl::IMAGE_TEXT, this, SW_RES(VS_MARGIN) ) )
53*ff0525f2SOliver-Rainer Wittmann     , maCustom(this, SW_RES(FT_CUSTOM))
54*ff0525f2SOliver-Rainer Wittmann     , maLeft(this, SW_RES(FT_LEFT))
55*ff0525f2SOliver-Rainer Wittmann     , maInner(this, SW_RES(FT_INNER))
56*ff0525f2SOliver-Rainer Wittmann     , maLeftMarginEdit(this, SW_RES(MF_SWLEFT_MARGIN))
57*ff0525f2SOliver-Rainer Wittmann     , maRight(this, SW_RES(FT_RIGHT))
58*ff0525f2SOliver-Rainer Wittmann     , maOuter(this, SW_RES(FT_OUTER))
59*ff0525f2SOliver-Rainer Wittmann     , maRightMarginEdit(this, SW_RES(MF_SWRIGHT_MARGIN))
60*ff0525f2SOliver-Rainer Wittmann     , maTop(this, SW_RES(FT_TOP))
61*ff0525f2SOliver-Rainer Wittmann     , maTopMarginEdit(this, SW_RES(MF_SWTOP_MARGIN))
62*ff0525f2SOliver-Rainer Wittmann     , maBottom(this, SW_RES(FT_BOTTOM))
63*ff0525f2SOliver-Rainer Wittmann     , maBottomMarginEdit(this, SW_RES(MF_SWBOTTOM_MARGIN))
64*ff0525f2SOliver-Rainer Wittmann     , maWidthHeightField( this, SW_RES(FLD_WIDTH_HEIGHT) )
65*ff0525f2SOliver-Rainer Wittmann     , mnPageLeftMargin( aPageLRMargin.GetLeft() )
66*ff0525f2SOliver-Rainer Wittmann     , mnPageRightMargin( aPageLRMargin.GetRight() )
67*ff0525f2SOliver-Rainer Wittmann     , mnPageTopMargin( aPageULMargin.GetUpper() )
68*ff0525f2SOliver-Rainer Wittmann     , mnPageBottomMargin( aPageULMargin.GetLower() )
69*ff0525f2SOliver-Rainer Wittmann     , mbMirrored( bMirrored )
70*ff0525f2SOliver-Rainer Wittmann     , meUnit( eUnit )
71*ff0525f2SOliver-Rainer Wittmann     , mnUserCustomPageLeftMargin(0)
72*ff0525f2SOliver-Rainer Wittmann     , mnUserCustomPageRightMargin(0)
73*ff0525f2SOliver-Rainer Wittmann     , mnUserCustomPageTopMargin(0)
74*ff0525f2SOliver-Rainer Wittmann     , mnUserCustomPageBottomMargin(0)
75*ff0525f2SOliver-Rainer Wittmann     , mbUserCustomMirrored(false)
76*ff0525f2SOliver-Rainer Wittmann     , mbCustomValuesUsed( false )
77*ff0525f2SOliver-Rainer Wittmann     , mrPagePropPanel(rPanel)
78*ff0525f2SOliver-Rainer Wittmann {
79*ff0525f2SOliver-Rainer Wittmann     maWidthHeightField.Hide();
80*ff0525f2SOliver-Rainer Wittmann     SetFieldUnit( maWidthHeightField, eFUnit );
81*ff0525f2SOliver-Rainer Wittmann 
82*ff0525f2SOliver-Rainer Wittmann     const bool bCustomValuesAvailable = GetUserCustomValues();
83*ff0525f2SOliver-Rainer Wittmann 
84*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->SetStyle( mpMarginValueSet->GetStyle() | WB_3DLOOK | WB_NO_DIRECTSELECT );
85*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->SetColor( GetSettings().GetStyleSettings().GetMenuColor() );
86*ff0525f2SOliver-Rainer Wittmann 
87*ff0525f2SOliver-Rainer Wittmann     FillValueSet( bLandscape, bCustomValuesAvailable );
88*ff0525f2SOliver-Rainer Wittmann 
89*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->SetNoSelection();
90*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->SetSelectHdl( LINK(this, PageMarginControl,ImplMarginHdl ) );
91*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->Show();
92*ff0525f2SOliver-Rainer Wittmann 
93*ff0525f2SOliver-Rainer Wittmann     SelectValueSetItem();
94*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->Format();
95*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->StartSelection();
96*ff0525f2SOliver-Rainer Wittmann 
97*ff0525f2SOliver-Rainer Wittmann     SetFieldUnit( maLeftMarginEdit, eFUnit );
98*ff0525f2SOliver-Rainer Wittmann     Link aLinkLR = LINK( this, PageMarginControl, ModifyLRMarginHdl );
99*ff0525f2SOliver-Rainer Wittmann     maLeftMarginEdit.SetModifyHdl( aLinkLR );
100*ff0525f2SOliver-Rainer Wittmann     SetMetricValue( maLeftMarginEdit, mnPageLeftMargin, meUnit );
101*ff0525f2SOliver-Rainer Wittmann 
102*ff0525f2SOliver-Rainer Wittmann     SetFieldUnit( maRightMarginEdit, eFUnit );
103*ff0525f2SOliver-Rainer Wittmann     maRightMarginEdit.SetModifyHdl( aLinkLR );
104*ff0525f2SOliver-Rainer Wittmann     SetMetricValue( maRightMarginEdit, mnPageRightMargin, meUnit );
105*ff0525f2SOliver-Rainer Wittmann 
106*ff0525f2SOliver-Rainer Wittmann     Link aLinkUL = LINK( this, PageMarginControl, ModifyULMarginHdl );
107*ff0525f2SOliver-Rainer Wittmann     SetFieldUnit( maTopMarginEdit, eFUnit );
108*ff0525f2SOliver-Rainer Wittmann     maTopMarginEdit.SetModifyHdl( aLinkUL );
109*ff0525f2SOliver-Rainer Wittmann     SetMetricValue( maTopMarginEdit, mnPageTopMargin, meUnit );
110*ff0525f2SOliver-Rainer Wittmann 
111*ff0525f2SOliver-Rainer Wittmann     SetFieldUnit( maBottomMarginEdit, eFUnit );
112*ff0525f2SOliver-Rainer Wittmann     maBottomMarginEdit.SetModifyHdl( aLinkUL );
113*ff0525f2SOliver-Rainer Wittmann     SetMetricValue( maBottomMarginEdit, mnPageBottomMargin, meUnit );
114*ff0525f2SOliver-Rainer Wittmann 
115*ff0525f2SOliver-Rainer Wittmann     SetMetricFieldMaxValues( aPageSize );
116*ff0525f2SOliver-Rainer Wittmann 
117*ff0525f2SOliver-Rainer Wittmann     if ( mbMirrored )
118*ff0525f2SOliver-Rainer Wittmann     {
119*ff0525f2SOliver-Rainer Wittmann         maLeft.Hide();
120*ff0525f2SOliver-Rainer Wittmann         maRight.Hide();
121*ff0525f2SOliver-Rainer Wittmann         maInner.Show();
122*ff0525f2SOliver-Rainer Wittmann         maOuter.Show();
123*ff0525f2SOliver-Rainer Wittmann     }
124*ff0525f2SOliver-Rainer Wittmann     else
125*ff0525f2SOliver-Rainer Wittmann     {
126*ff0525f2SOliver-Rainer Wittmann         maLeft.Show();
127*ff0525f2SOliver-Rainer Wittmann         maRight.Show();
128*ff0525f2SOliver-Rainer Wittmann         maInner.Hide();
129*ff0525f2SOliver-Rainer Wittmann         maOuter.Hide();
130*ff0525f2SOliver-Rainer Wittmann     }
131*ff0525f2SOliver-Rainer Wittmann 
132*ff0525f2SOliver-Rainer Wittmann     FreeResource();
133*ff0525f2SOliver-Rainer Wittmann }
134*ff0525f2SOliver-Rainer Wittmann 
135*ff0525f2SOliver-Rainer Wittmann 
136*ff0525f2SOliver-Rainer Wittmann PageMarginControl::~PageMarginControl(void)
137*ff0525f2SOliver-Rainer Wittmann {
138*ff0525f2SOliver-Rainer Wittmann     delete mpMarginValueSet;
139*ff0525f2SOliver-Rainer Wittmann 
140*ff0525f2SOliver-Rainer Wittmann     StoreUserCustomValues();
141*ff0525f2SOliver-Rainer Wittmann }
142*ff0525f2SOliver-Rainer Wittmann 
143*ff0525f2SOliver-Rainer Wittmann 
144*ff0525f2SOliver-Rainer Wittmann void PageMarginControl::SetMetricFieldMaxValues( const Size aPageSize )
145*ff0525f2SOliver-Rainer Wittmann {
146*ff0525f2SOliver-Rainer Wittmann     const long nML = maLeftMarginEdit.Denormalize( maLeftMarginEdit.GetValue(FUNIT_TWIP) );
147*ff0525f2SOliver-Rainer Wittmann     const long nMR = maRightMarginEdit.Denormalize( maRightMarginEdit.GetValue(FUNIT_TWIP) );
148*ff0525f2SOliver-Rainer Wittmann     const long nMT = maTopMarginEdit.Denormalize(maTopMarginEdit.GetValue(FUNIT_TWIP) );
149*ff0525f2SOliver-Rainer Wittmann     const long nMB = maBottomMarginEdit.Denormalize( maBottomMarginEdit.GetValue(FUNIT_TWIP) );
150*ff0525f2SOliver-Rainer Wittmann 
151*ff0525f2SOliver-Rainer Wittmann     const long nPH  = LogicToLogic( aPageSize.Height(), (MapUnit)meUnit, MAP_TWIP );
152*ff0525f2SOliver-Rainer Wittmann     const long nPW  = LogicToLogic( aPageSize.Width(),  (MapUnit)meUnit, MAP_TWIP );
153*ff0525f2SOliver-Rainer Wittmann 
154*ff0525f2SOliver-Rainer Wittmann     // Left
155*ff0525f2SOliver-Rainer Wittmann     long nMax = nPW - nMR - MINBODY;
156*ff0525f2SOliver-Rainer Wittmann     maLeftMarginEdit.SetMax(maLeftMarginEdit.Normalize(nMax), FUNIT_TWIP);
157*ff0525f2SOliver-Rainer Wittmann 
158*ff0525f2SOliver-Rainer Wittmann     // Right
159*ff0525f2SOliver-Rainer Wittmann     nMax = nPW - nML - MINBODY;
160*ff0525f2SOliver-Rainer Wittmann     maRightMarginEdit.SetMax(maRightMarginEdit.Normalize(nMax), FUNIT_TWIP);
161*ff0525f2SOliver-Rainer Wittmann 
162*ff0525f2SOliver-Rainer Wittmann     //Top
163*ff0525f2SOliver-Rainer Wittmann     nMax = nPH - nMB - MINBODY;
164*ff0525f2SOliver-Rainer Wittmann     maTopMarginEdit.SetMax(maTopMarginEdit.Normalize(nMax), FUNIT_TWIP);
165*ff0525f2SOliver-Rainer Wittmann 
166*ff0525f2SOliver-Rainer Wittmann     //Bottom
167*ff0525f2SOliver-Rainer Wittmann     nMax = nPH - nMT -  MINBODY;
168*ff0525f2SOliver-Rainer Wittmann     maBottomMarginEdit.SetMax(maTopMarginEdit.Normalize(nMax), FUNIT_TWIP);
169*ff0525f2SOliver-Rainer Wittmann }
170*ff0525f2SOliver-Rainer Wittmann 
171*ff0525f2SOliver-Rainer Wittmann 
172*ff0525f2SOliver-Rainer Wittmann void PageMarginControl::FillValueSet(
173*ff0525f2SOliver-Rainer Wittmann     const bool bLandscape,
174*ff0525f2SOliver-Rainer Wittmann     const bool bUserCustomValuesAvailable )
175*ff0525f2SOliver-Rainer Wittmann {
176*ff0525f2SOliver-Rainer Wittmann     const XubString aLeft = SW_RES(STR_MARGIN_TOOLTIP_LEFT);
177*ff0525f2SOliver-Rainer Wittmann     const XubString aRight = SW_RES(STR_MARGIN_TOOLTIP_RIGHT);
178*ff0525f2SOliver-Rainer Wittmann     const XubString aTop = SW_RES(STR_MARGIN_TOOLTIP_TOP);
179*ff0525f2SOliver-Rainer Wittmann     const XubString aBottom = SW_RES(STR_MARGIN_TOOLTIP_BOT);
180*ff0525f2SOliver-Rainer Wittmann 
181*ff0525f2SOliver-Rainer Wittmann     SetMetricValue( maWidthHeightField, SWPAGE_NARROW_VALUE, meUnit );
182*ff0525f2SOliver-Rainer Wittmann     const XubString aNarrowValText = maWidthHeightField.GetText();
183*ff0525f2SOliver-Rainer Wittmann     XubString aHelpText = aLeft;
184*ff0525f2SOliver-Rainer Wittmann     aHelpText += aNarrowValText;
185*ff0525f2SOliver-Rainer Wittmann     aHelpText += aRight;
186*ff0525f2SOliver-Rainer Wittmann     aHelpText += aNarrowValText;
187*ff0525f2SOliver-Rainer Wittmann     aHelpText += aTop;
188*ff0525f2SOliver-Rainer Wittmann     aHelpText += aNarrowValText;
189*ff0525f2SOliver-Rainer Wittmann     aHelpText += aBottom;
190*ff0525f2SOliver-Rainer Wittmann     aHelpText += aNarrowValText;
191*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->AddItem(
192*ff0525f2SOliver-Rainer Wittmann         (bLandscape ? SW_RES(IMG_NARROW_L) : SW_RES(IMG_NARROW) ), 0,
193*ff0525f2SOliver-Rainer Wittmann         SW_RES(STR_NARROW), &aHelpText );
194*ff0525f2SOliver-Rainer Wittmann 
195*ff0525f2SOliver-Rainer Wittmann     SetMetricValue( maWidthHeightField, SWPAGE_NORMAL_VALUE, meUnit );
196*ff0525f2SOliver-Rainer Wittmann     const XubString aNormalValText = maWidthHeightField.GetText();
197*ff0525f2SOliver-Rainer Wittmann     aHelpText = aLeft;
198*ff0525f2SOliver-Rainer Wittmann     aHelpText += aNormalValText;
199*ff0525f2SOliver-Rainer Wittmann     aHelpText += aRight;
200*ff0525f2SOliver-Rainer Wittmann     aHelpText += aNormalValText;
201*ff0525f2SOliver-Rainer Wittmann     aHelpText += aTop;
202*ff0525f2SOliver-Rainer Wittmann     aHelpText += aNormalValText;
203*ff0525f2SOliver-Rainer Wittmann     aHelpText += aBottom;
204*ff0525f2SOliver-Rainer Wittmann     aHelpText += aNormalValText;
205*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->AddItem(
206*ff0525f2SOliver-Rainer Wittmann         (bLandscape ? SW_RES(IMG_NORMAL_L) : SW_RES(IMG_NORMAL) ), 0,
207*ff0525f2SOliver-Rainer Wittmann         SW_RES(STR_NORMAL), &aHelpText );
208*ff0525f2SOliver-Rainer Wittmann 
209*ff0525f2SOliver-Rainer Wittmann     SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE1, meUnit );
210*ff0525f2SOliver-Rainer Wittmann     const XubString aWide1ValText = maWidthHeightField.GetText();
211*ff0525f2SOliver-Rainer Wittmann     SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE2, meUnit );
212*ff0525f2SOliver-Rainer Wittmann     const XubString aWide2ValText = maWidthHeightField.GetText();
213*ff0525f2SOliver-Rainer Wittmann     aHelpText = aLeft;
214*ff0525f2SOliver-Rainer Wittmann     aHelpText += aWide2ValText;
215*ff0525f2SOliver-Rainer Wittmann     aHelpText += aRight;
216*ff0525f2SOliver-Rainer Wittmann     aHelpText += aWide2ValText;
217*ff0525f2SOliver-Rainer Wittmann     aHelpText += aTop;
218*ff0525f2SOliver-Rainer Wittmann     aHelpText += aWide1ValText;
219*ff0525f2SOliver-Rainer Wittmann     aHelpText += aBottom;
220*ff0525f2SOliver-Rainer Wittmann     aHelpText += aWide1ValText;
221*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->AddItem(
222*ff0525f2SOliver-Rainer Wittmann         (bLandscape ? SW_RES(IMG_WIDE_L) : SW_RES(IMG_WIDE) ), 0,
223*ff0525f2SOliver-Rainer Wittmann         SW_RES(STR_WIDE), &aHelpText );
224*ff0525f2SOliver-Rainer Wittmann 
225*ff0525f2SOliver-Rainer Wittmann     const XubString aInner = SW_RES(STR_MARGIN_TOOLTIP_INNER);
226*ff0525f2SOliver-Rainer Wittmann     const XubString aOuter = SW_RES(STR_MARGIN_TOOLTIP_OUTER);
227*ff0525f2SOliver-Rainer Wittmann 
228*ff0525f2SOliver-Rainer Wittmann     SetMetricValue( maWidthHeightField, SWPAGE_WIDE_VALUE3, meUnit );
229*ff0525f2SOliver-Rainer Wittmann     const XubString aWide3ValText = maWidthHeightField.GetText();
230*ff0525f2SOliver-Rainer Wittmann     aHelpText = aInner;
231*ff0525f2SOliver-Rainer Wittmann     aHelpText += aWide3ValText;
232*ff0525f2SOliver-Rainer Wittmann     aHelpText += aOuter;
233*ff0525f2SOliver-Rainer Wittmann     aHelpText += aWide3ValText;
234*ff0525f2SOliver-Rainer Wittmann     aHelpText += aTop;
235*ff0525f2SOliver-Rainer Wittmann     aHelpText += aWide1ValText;
236*ff0525f2SOliver-Rainer Wittmann     aHelpText += aBottom;
237*ff0525f2SOliver-Rainer Wittmann     aHelpText += aWide1ValText;
238*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->AddItem(
239*ff0525f2SOliver-Rainer Wittmann         (bLandscape ? SW_RES(IMG_MIRRORED_L) : SW_RES(IMG_MIRRORED) ), 0,
240*ff0525f2SOliver-Rainer Wittmann         SW_RES(STR_MIRRORED), &aHelpText );
241*ff0525f2SOliver-Rainer Wittmann 
242*ff0525f2SOliver-Rainer Wittmann     if ( bUserCustomValuesAvailable )
243*ff0525f2SOliver-Rainer Wittmann     {
244*ff0525f2SOliver-Rainer Wittmann         aHelpText = mbUserCustomMirrored ? aInner : aLeft;
245*ff0525f2SOliver-Rainer Wittmann         SetMetricValue( maWidthHeightField, mnUserCustomPageLeftMargin, meUnit );
246*ff0525f2SOliver-Rainer Wittmann         aHelpText += maWidthHeightField.GetText();
247*ff0525f2SOliver-Rainer Wittmann         aHelpText += mbUserCustomMirrored ? aOuter : aRight;
248*ff0525f2SOliver-Rainer Wittmann         SetMetricValue( maWidthHeightField, mnUserCustomPageRightMargin, meUnit );
249*ff0525f2SOliver-Rainer Wittmann         aHelpText += maWidthHeightField.GetText();
250*ff0525f2SOliver-Rainer Wittmann         aHelpText += aTop;
251*ff0525f2SOliver-Rainer Wittmann         SetMetricValue( maWidthHeightField, mnUserCustomPageTopMargin, meUnit );
252*ff0525f2SOliver-Rainer Wittmann         aHelpText += maWidthHeightField.GetText();
253*ff0525f2SOliver-Rainer Wittmann         aHelpText += aBottom;
254*ff0525f2SOliver-Rainer Wittmann         SetMetricValue( maWidthHeightField, mnUserCustomPageBottomMargin, meUnit );
255*ff0525f2SOliver-Rainer Wittmann         aHelpText += maWidthHeightField.GetText();
256*ff0525f2SOliver-Rainer Wittmann     }
257*ff0525f2SOliver-Rainer Wittmann     else
258*ff0525f2SOliver-Rainer Wittmann     {
259*ff0525f2SOliver-Rainer Wittmann         aHelpText = XubString();
260*ff0525f2SOliver-Rainer Wittmann     }
261*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->AddItem(
262*ff0525f2SOliver-Rainer Wittmann         (bUserCustomValuesAvailable ? SW_RES(IMG_CUSTOM) : SW_RES(IMG_CUSTOM_DIS) ), 0,
263*ff0525f2SOliver-Rainer Wittmann         SW_RES(STR_LCVALUE), &aHelpText );
264*ff0525f2SOliver-Rainer Wittmann }
265*ff0525f2SOliver-Rainer Wittmann 
266*ff0525f2SOliver-Rainer Wittmann 
267*ff0525f2SOliver-Rainer Wittmann void PageMarginControl::SelectValueSetItem()
268*ff0525f2SOliver-Rainer Wittmann {
269*ff0525f2SOliver-Rainer Wittmann     const long cTolerance = 5;
270*ff0525f2SOliver-Rainer Wittmann 
271*ff0525f2SOliver-Rainer Wittmann     if( abs(mnPageLeftMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
272*ff0525f2SOliver-Rainer Wittmann         abs(mnPageRightMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
273*ff0525f2SOliver-Rainer Wittmann         abs(mnPageTopMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
274*ff0525f2SOliver-Rainer Wittmann         abs(mnPageBottomMargin - SWPAGE_NARROW_VALUE) <= cTolerance &&
275*ff0525f2SOliver-Rainer Wittmann         !mbMirrored )
276*ff0525f2SOliver-Rainer Wittmann     {
277*ff0525f2SOliver-Rainer Wittmann         mpMarginValueSet->SelectItem(1);
278*ff0525f2SOliver-Rainer Wittmann     }
279*ff0525f2SOliver-Rainer Wittmann     else if( abs(mnPageLeftMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
280*ff0525f2SOliver-Rainer Wittmann         abs(mnPageRightMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
281*ff0525f2SOliver-Rainer Wittmann         abs(mnPageTopMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
282*ff0525f2SOliver-Rainer Wittmann         abs(mnPageBottomMargin - SWPAGE_NORMAL_VALUE) <= cTolerance &&
283*ff0525f2SOliver-Rainer Wittmann         !mbMirrored )
284*ff0525f2SOliver-Rainer Wittmann     {
285*ff0525f2SOliver-Rainer Wittmann         mpMarginValueSet->SelectItem(2);
286*ff0525f2SOliver-Rainer Wittmann     }
287*ff0525f2SOliver-Rainer Wittmann     else if( abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE2) <= cTolerance &&
288*ff0525f2SOliver-Rainer Wittmann         abs(mnPageRightMargin - SWPAGE_WIDE_VALUE2) <= cTolerance &&
289*ff0525f2SOliver-Rainer Wittmann         abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
290*ff0525f2SOliver-Rainer Wittmann         abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
291*ff0525f2SOliver-Rainer Wittmann         !mbMirrored )
292*ff0525f2SOliver-Rainer Wittmann     {
293*ff0525f2SOliver-Rainer Wittmann         mpMarginValueSet->SelectItem(3);
294*ff0525f2SOliver-Rainer Wittmann     }
295*ff0525f2SOliver-Rainer Wittmann     else if( abs(mnPageLeftMargin - SWPAGE_WIDE_VALUE3) <= cTolerance &&
296*ff0525f2SOliver-Rainer Wittmann         abs(mnPageRightMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
297*ff0525f2SOliver-Rainer Wittmann         abs(mnPageTopMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
298*ff0525f2SOliver-Rainer Wittmann         abs(mnPageBottomMargin - SWPAGE_WIDE_VALUE1) <= cTolerance &&
299*ff0525f2SOliver-Rainer Wittmann         mbMirrored )
300*ff0525f2SOliver-Rainer Wittmann     {
301*ff0525f2SOliver-Rainer Wittmann         mpMarginValueSet->SelectItem(4);
302*ff0525f2SOliver-Rainer Wittmann     }
303*ff0525f2SOliver-Rainer Wittmann     else
304*ff0525f2SOliver-Rainer Wittmann     {
305*ff0525f2SOliver-Rainer Wittmann         mpMarginValueSet->SelectItem(0);
306*ff0525f2SOliver-Rainer Wittmann     }
307*ff0525f2SOliver-Rainer Wittmann };
308*ff0525f2SOliver-Rainer Wittmann 
309*ff0525f2SOliver-Rainer Wittmann 
310*ff0525f2SOliver-Rainer Wittmann IMPL_LINK(PageMarginControl, ImplMarginHdl, void *, pControl)
311*ff0525f2SOliver-Rainer Wittmann {
312*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->SetNoSelection();
313*ff0525f2SOliver-Rainer Wittmann     if ( pControl == mpMarginValueSet )
314*ff0525f2SOliver-Rainer Wittmann     {
315*ff0525f2SOliver-Rainer Wittmann         const sal_uInt16 iPos = mpMarginValueSet->GetSelectItemId();
316*ff0525f2SOliver-Rainer Wittmann         bool bMirrored = false;
317*ff0525f2SOliver-Rainer Wittmann         switch ( iPos )
318*ff0525f2SOliver-Rainer Wittmann         {
319*ff0525f2SOliver-Rainer Wittmann         case 1:
320*ff0525f2SOliver-Rainer Wittmann             mnPageLeftMargin = SWPAGE_NARROW_VALUE;
321*ff0525f2SOliver-Rainer Wittmann             mnPageRightMargin = SWPAGE_NARROW_VALUE;
322*ff0525f2SOliver-Rainer Wittmann             mnPageTopMargin = SWPAGE_NARROW_VALUE;
323*ff0525f2SOliver-Rainer Wittmann             mnPageBottomMargin = SWPAGE_NARROW_VALUE;
324*ff0525f2SOliver-Rainer Wittmann             bMirrored = false;
325*ff0525f2SOliver-Rainer Wittmann             break;
326*ff0525f2SOliver-Rainer Wittmann         case 2:
327*ff0525f2SOliver-Rainer Wittmann             mnPageLeftMargin = SWPAGE_NORMAL_VALUE;
328*ff0525f2SOliver-Rainer Wittmann             mnPageRightMargin = SWPAGE_NORMAL_VALUE;
329*ff0525f2SOliver-Rainer Wittmann             mnPageTopMargin = SWPAGE_NORMAL_VALUE;
330*ff0525f2SOliver-Rainer Wittmann             mnPageBottomMargin = SWPAGE_NORMAL_VALUE;
331*ff0525f2SOliver-Rainer Wittmann             bMirrored = false;
332*ff0525f2SOliver-Rainer Wittmann             break;
333*ff0525f2SOliver-Rainer Wittmann         case 3:
334*ff0525f2SOliver-Rainer Wittmann             mnPageLeftMargin = SWPAGE_WIDE_VALUE2;
335*ff0525f2SOliver-Rainer Wittmann             mnPageRightMargin = SWPAGE_WIDE_VALUE2;
336*ff0525f2SOliver-Rainer Wittmann             mnPageTopMargin = SWPAGE_WIDE_VALUE1;
337*ff0525f2SOliver-Rainer Wittmann             mnPageBottomMargin = SWPAGE_WIDE_VALUE1;
338*ff0525f2SOliver-Rainer Wittmann             bMirrored = false;
339*ff0525f2SOliver-Rainer Wittmann             break;
340*ff0525f2SOliver-Rainer Wittmann         case 4:
341*ff0525f2SOliver-Rainer Wittmann             mnPageLeftMargin = SWPAGE_WIDE_VALUE3;
342*ff0525f2SOliver-Rainer Wittmann             mnPageRightMargin = SWPAGE_WIDE_VALUE1;
343*ff0525f2SOliver-Rainer Wittmann             mnPageTopMargin = SWPAGE_WIDE_VALUE1;
344*ff0525f2SOliver-Rainer Wittmann             mnPageBottomMargin = SWPAGE_WIDE_VALUE1;
345*ff0525f2SOliver-Rainer Wittmann             bMirrored = true;
346*ff0525f2SOliver-Rainer Wittmann             break;
347*ff0525f2SOliver-Rainer Wittmann         case 5:
348*ff0525f2SOliver-Rainer Wittmann             mnPageLeftMargin = mnUserCustomPageLeftMargin;
349*ff0525f2SOliver-Rainer Wittmann             mnPageRightMargin = mnUserCustomPageRightMargin;
350*ff0525f2SOliver-Rainer Wittmann             mnPageTopMargin = mnUserCustomPageTopMargin;
351*ff0525f2SOliver-Rainer Wittmann             mnPageBottomMargin = mnUserCustomPageBottomMargin;
352*ff0525f2SOliver-Rainer Wittmann             bMirrored = mbUserCustomMirrored;
353*ff0525f2SOliver-Rainer Wittmann             break;
354*ff0525f2SOliver-Rainer Wittmann         }
355*ff0525f2SOliver-Rainer Wittmann 
356*ff0525f2SOliver-Rainer Wittmann         mrPagePropPanel.ExecuteMarginLRChange( mnPageLeftMargin, mnPageRightMargin );
357*ff0525f2SOliver-Rainer Wittmann         mrPagePropPanel.ExecuteMarginULChange( mnPageTopMargin, mnPageBottomMargin );
358*ff0525f2SOliver-Rainer Wittmann         if ( mbMirrored != bMirrored )
359*ff0525f2SOliver-Rainer Wittmann         {
360*ff0525f2SOliver-Rainer Wittmann             mbMirrored = bMirrored;
361*ff0525f2SOliver-Rainer Wittmann             mrPagePropPanel.ExecutePageLayoutChange( mbMirrored );
362*ff0525f2SOliver-Rainer Wittmann         }
363*ff0525f2SOliver-Rainer Wittmann 
364*ff0525f2SOliver-Rainer Wittmann         mbCustomValuesUsed = false;
365*ff0525f2SOliver-Rainer Wittmann     }
366*ff0525f2SOliver-Rainer Wittmann 
367*ff0525f2SOliver-Rainer Wittmann     mrPagePropPanel.ClosePageMarginPopup();
368*ff0525f2SOliver-Rainer Wittmann     return 0;
369*ff0525f2SOliver-Rainer Wittmann }
370*ff0525f2SOliver-Rainer Wittmann 
371*ff0525f2SOliver-Rainer Wittmann 
372*ff0525f2SOliver-Rainer Wittmann IMPL_LINK( PageMarginControl, ModifyLRMarginHdl, MetricField *, EMPTYARG )
373*ff0525f2SOliver-Rainer Wittmann {
374*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->SetNoSelection();
375*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->SelectItem(0);
376*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->Format();
377*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->StartSelection();
378*ff0525f2SOliver-Rainer Wittmann 
379*ff0525f2SOliver-Rainer Wittmann     mnPageLeftMargin = GetCoreValue( maLeftMarginEdit, meUnit );
380*ff0525f2SOliver-Rainer Wittmann     mnPageRightMargin = GetCoreValue( maRightMarginEdit, meUnit );
381*ff0525f2SOliver-Rainer Wittmann     mrPagePropPanel.ExecuteMarginLRChange( mnPageLeftMargin, mnPageRightMargin );
382*ff0525f2SOliver-Rainer Wittmann     mbCustomValuesUsed = true;
383*ff0525f2SOliver-Rainer Wittmann     return 0;
384*ff0525f2SOliver-Rainer Wittmann }
385*ff0525f2SOliver-Rainer Wittmann 
386*ff0525f2SOliver-Rainer Wittmann IMPL_LINK( PageMarginControl, ModifyULMarginHdl, MetricField *, EMPTYARG )
387*ff0525f2SOliver-Rainer Wittmann {
388*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->SetNoSelection();
389*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->SelectItem(0);
390*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->Format();
391*ff0525f2SOliver-Rainer Wittmann     mpMarginValueSet->StartSelection();
392*ff0525f2SOliver-Rainer Wittmann 
393*ff0525f2SOliver-Rainer Wittmann     mnPageTopMargin = GetCoreValue( maTopMarginEdit, meUnit );
394*ff0525f2SOliver-Rainer Wittmann     mnPageBottomMargin = GetCoreValue( maBottomMarginEdit, meUnit );
395*ff0525f2SOliver-Rainer Wittmann     mrPagePropPanel.ExecuteMarginULChange( mnPageTopMargin, mnPageBottomMargin );
396*ff0525f2SOliver-Rainer Wittmann     mbCustomValuesUsed = true;
397*ff0525f2SOliver-Rainer Wittmann     return 0;
398*ff0525f2SOliver-Rainer Wittmann }
399*ff0525f2SOliver-Rainer Wittmann 
400*ff0525f2SOliver-Rainer Wittmann 
401*ff0525f2SOliver-Rainer Wittmann bool PageMarginControl::GetUserCustomValues()
402*ff0525f2SOliver-Rainer Wittmann {
403*ff0525f2SOliver-Rainer Wittmann     bool bUserCustomValuesAvailable = false;
404*ff0525f2SOliver-Rainer Wittmann 
405*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt( E_WINDOW, SWPAGE_LEFT_GVALUE );
406*ff0525f2SOliver-Rainer Wittmann     if ( aWinOpt.Exists() )
407*ff0525f2SOliver-Rainer Wittmann     {
408*ff0525f2SOliver-Rainer Wittmann         ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt.GetUserData();
409*ff0525f2SOliver-Rainer Wittmann         ::rtl::OUString aTmp;
410*ff0525f2SOliver-Rainer Wittmann         if ( aSeq.getLength())
411*ff0525f2SOliver-Rainer Wittmann             aSeq[0].Value >>= aTmp;
412*ff0525f2SOliver-Rainer Wittmann         String aWinData( aTmp );
413*ff0525f2SOliver-Rainer Wittmann         mnUserCustomPageLeftMargin = aWinData.ToInt32();
414*ff0525f2SOliver-Rainer Wittmann         bUserCustomValuesAvailable = true;
415*ff0525f2SOliver-Rainer Wittmann     }
416*ff0525f2SOliver-Rainer Wittmann 
417*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt2( E_WINDOW, SWPAGE_RIGHT_GVALUE );
418*ff0525f2SOliver-Rainer Wittmann     if ( aWinOpt2.Exists() )
419*ff0525f2SOliver-Rainer Wittmann     {
420*ff0525f2SOliver-Rainer Wittmann         ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt2.GetUserData();
421*ff0525f2SOliver-Rainer Wittmann         ::rtl::OUString aTmp;
422*ff0525f2SOliver-Rainer Wittmann         if ( aSeq.getLength())
423*ff0525f2SOliver-Rainer Wittmann             aSeq[0].Value >>= aTmp;
424*ff0525f2SOliver-Rainer Wittmann         String aWinData( aTmp );
425*ff0525f2SOliver-Rainer Wittmann         mnUserCustomPageRightMargin = aWinData.ToInt32();
426*ff0525f2SOliver-Rainer Wittmann         bUserCustomValuesAvailable = true;
427*ff0525f2SOliver-Rainer Wittmann     }
428*ff0525f2SOliver-Rainer Wittmann 
429*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt3( E_WINDOW, SWPAGE_TOP_GVALUE );
430*ff0525f2SOliver-Rainer Wittmann     if ( aWinOpt3.Exists() )
431*ff0525f2SOliver-Rainer Wittmann     {
432*ff0525f2SOliver-Rainer Wittmann         ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt3.GetUserData();
433*ff0525f2SOliver-Rainer Wittmann         ::rtl::OUString aTmp;
434*ff0525f2SOliver-Rainer Wittmann         if ( aSeq.getLength())
435*ff0525f2SOliver-Rainer Wittmann             aSeq[0].Value >>= aTmp;
436*ff0525f2SOliver-Rainer Wittmann         String aWinData( aTmp );
437*ff0525f2SOliver-Rainer Wittmann         mnUserCustomPageTopMargin = aWinData.ToInt32();
438*ff0525f2SOliver-Rainer Wittmann         bUserCustomValuesAvailable = true;
439*ff0525f2SOliver-Rainer Wittmann     }
440*ff0525f2SOliver-Rainer Wittmann 
441*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt4( E_WINDOW, SWPAGE_DOWN_GVALUE );
442*ff0525f2SOliver-Rainer Wittmann     if ( aWinOpt4.Exists() )
443*ff0525f2SOliver-Rainer Wittmann     {
444*ff0525f2SOliver-Rainer Wittmann         ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt4.GetUserData();
445*ff0525f2SOliver-Rainer Wittmann         ::rtl::OUString aTmp;
446*ff0525f2SOliver-Rainer Wittmann         if ( aSeq.getLength())
447*ff0525f2SOliver-Rainer Wittmann             aSeq[0].Value >>= aTmp;
448*ff0525f2SOliver-Rainer Wittmann         String aWinData( aTmp );
449*ff0525f2SOliver-Rainer Wittmann         mnUserCustomPageBottomMargin = aWinData.ToInt32();
450*ff0525f2SOliver-Rainer Wittmann         bUserCustomValuesAvailable = true;
451*ff0525f2SOliver-Rainer Wittmann     }
452*ff0525f2SOliver-Rainer Wittmann 
453*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt5( E_WINDOW, SWPAGE_MIRROR_GVALUE );
454*ff0525f2SOliver-Rainer Wittmann     if ( aWinOpt5.Exists() )
455*ff0525f2SOliver-Rainer Wittmann     {
456*ff0525f2SOliver-Rainer Wittmann         ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq = aWinOpt5.GetUserData();
457*ff0525f2SOliver-Rainer Wittmann         ::rtl::OUString aTmp;
458*ff0525f2SOliver-Rainer Wittmann         if ( aSeq.getLength())
459*ff0525f2SOliver-Rainer Wittmann             aSeq[0].Value >>= aTmp;
460*ff0525f2SOliver-Rainer Wittmann         String aWinData( aTmp );
461*ff0525f2SOliver-Rainer Wittmann         mbUserCustomMirrored = aWinData.ToInt32() == 0 ? false : true;
462*ff0525f2SOliver-Rainer Wittmann         bUserCustomValuesAvailable = true;
463*ff0525f2SOliver-Rainer Wittmann     }
464*ff0525f2SOliver-Rainer Wittmann 
465*ff0525f2SOliver-Rainer Wittmann     return bUserCustomValuesAvailable;
466*ff0525f2SOliver-Rainer Wittmann }
467*ff0525f2SOliver-Rainer Wittmann 
468*ff0525f2SOliver-Rainer Wittmann void PageMarginControl::StoreUserCustomValues()
469*ff0525f2SOliver-Rainer Wittmann {
470*ff0525f2SOliver-Rainer Wittmann     if ( !mbCustomValuesUsed )
471*ff0525f2SOliver-Rainer Wittmann     {
472*ff0525f2SOliver-Rainer Wittmann         return;
473*ff0525f2SOliver-Rainer Wittmann     }
474*ff0525f2SOliver-Rainer Wittmann 
475*ff0525f2SOliver-Rainer Wittmann     ::com::sun::star::uno::Sequence < ::com::sun::star::beans::NamedValue > aSeq(1);
476*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt( E_WINDOW, SWPAGE_LEFT_GVALUE );
477*ff0525f2SOliver-Rainer Wittmann 
478*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageLeftMargin") );
479*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageLeftMargin ));
480*ff0525f2SOliver-Rainer Wittmann     aWinOpt.SetUserData( aSeq );
481*ff0525f2SOliver-Rainer Wittmann 
482*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt2( E_WINDOW, SWPAGE_RIGHT_GVALUE );
483*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageRightMargin") );
484*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageRightMargin ));
485*ff0525f2SOliver-Rainer Wittmann     aWinOpt2.SetUserData( aSeq );
486*ff0525f2SOliver-Rainer Wittmann 
487*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt3( E_WINDOW, SWPAGE_TOP_GVALUE );
488*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageTopMargin") );
489*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageTopMargin ));
490*ff0525f2SOliver-Rainer Wittmann     aWinOpt3.SetUserData( aSeq );
491*ff0525f2SOliver-Rainer Wittmann 
492*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt4( E_WINDOW, SWPAGE_DOWN_GVALUE );
493*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mnPageBottomMargin") );
494*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( mnPageBottomMargin ));
495*ff0525f2SOliver-Rainer Wittmann     aWinOpt4.SetUserData( aSeq );
496*ff0525f2SOliver-Rainer Wittmann 
497*ff0525f2SOliver-Rainer Wittmann     SvtViewOptions aWinOpt5( E_WINDOW, SWPAGE_MIRROR_GVALUE );
498*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Name = ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("mbMirrored") );
499*ff0525f2SOliver-Rainer Wittmann     aSeq[0].Value <<= ::rtl::OUString( String::CreateFromInt64( (mbMirrored ? 1 : 0) ));
500*ff0525f2SOliver-Rainer Wittmann     aWinOpt5.SetUserData( aSeq );
501*ff0525f2SOliver-Rainer Wittmann }
502*ff0525f2SOliver-Rainer Wittmann 
503*ff0525f2SOliver-Rainer Wittmann 
504*ff0525f2SOliver-Rainer Wittmann } } // end of namespace sw::sidebar
505*ff0525f2SOliver-Rainer Wittmann 
506