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