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