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