1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir 28*cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 29*cdf0e10cSrcweir #include "precompiled_sw.hxx" 30*cdf0e10cSrcweir 31*cdf0e10cSrcweir #ifdef SW_DLLIMPLEMENTATION 32*cdf0e10cSrcweir #undef SW_DLLIMPLEMENTATION 33*cdf0e10cSrcweir #endif 34*cdf0e10cSrcweir 35*cdf0e10cSrcweir 36*cdf0e10cSrcweir #include "hintids.hxx" 37*cdf0e10cSrcweir #include <vcl/graph.hxx> 38*cdf0e10cSrcweir #include <svx/htmlmode.hxx> 39*cdf0e10cSrcweir #include <sfx2/objsh.hxx> 40*cdf0e10cSrcweir #include <svl/intitem.hxx> 41*cdf0e10cSrcweir #include <editeng/opaqitem.hxx> 42*cdf0e10cSrcweir #include <editeng/ulspitem.hxx> 43*cdf0e10cSrcweir #include <editeng/lrspitem.hxx> 44*cdf0e10cSrcweir // OD 18.09.2003 #i18732# 45*cdf0e10cSrcweir #include <fmtfollowtextflow.hxx> 46*cdf0e10cSrcweir #include <svx/swframevalidation.hxx> 47*cdf0e10cSrcweir 48*cdf0e10cSrcweir 49*cdf0e10cSrcweir #include "cmdid.h" 50*cdf0e10cSrcweir #include "uitool.hxx" 51*cdf0e10cSrcweir #include "wrtsh.hxx" 52*cdf0e10cSrcweir #include "swmodule.hxx" 53*cdf0e10cSrcweir #include "viewopt.hxx" 54*cdf0e10cSrcweir #include "frmatr.hxx" 55*cdf0e10cSrcweir #include "frmmgr.hxx" 56*cdf0e10cSrcweir #include "globals.hrc" 57*cdf0e10cSrcweir #include "frmui.hrc" 58*cdf0e10cSrcweir #include "wrap.hrc" 59*cdf0e10cSrcweir #include "wrap.hxx" 60*cdf0e10cSrcweir 61*cdf0e10cSrcweir using namespace ::com::sun::star; 62*cdf0e10cSrcweir 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir /*-------------------------------------------------------------------- 65*cdf0e10cSrcweir Beschreibung: 66*cdf0e10cSrcweir --------------------------------------------------------------------*/ 67*cdf0e10cSrcweir 68*cdf0e10cSrcweir static sal_uInt16 __FAR_DATA aWrapPageRg[] = { 69*cdf0e10cSrcweir RES_LR_SPACE, RES_UL_SPACE, 70*cdf0e10cSrcweir RES_PROTECT, RES_SURROUND, 71*cdf0e10cSrcweir RES_PRINT, RES_PRINT, 72*cdf0e10cSrcweir 0 73*cdf0e10cSrcweir }; 74*cdf0e10cSrcweir 75*cdf0e10cSrcweir 76*cdf0e10cSrcweir /*-------------------------------------------------------------------- 77*cdf0e10cSrcweir Beschreibung: 78*cdf0e10cSrcweir --------------------------------------------------------------------*/ 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir 81*cdf0e10cSrcweir 82*cdf0e10cSrcweir SwWrapDlg::SwWrapDlg(Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode) : 83*cdf0e10cSrcweir SfxSingleTabDialog(pParent, rSet, 0), 84*cdf0e10cSrcweir pWrtShell(pSh) 85*cdf0e10cSrcweir 86*cdf0e10cSrcweir { 87*cdf0e10cSrcweir // TabPage erzeugen 88*cdf0e10cSrcweir SwWrapTabPage* pNewPage = (SwWrapTabPage*) SwWrapTabPage::Create(this, rSet); 89*cdf0e10cSrcweir pNewPage->SetFormatUsed(sal_False, bDrawMode); 90*cdf0e10cSrcweir pNewPage->SetShell(pWrtShell); 91*cdf0e10cSrcweir SetTabPage(pNewPage); 92*cdf0e10cSrcweir 93*cdf0e10cSrcweir String sTitle(SW_RES(STR_FRMUI_WRAP)); 94*cdf0e10cSrcweir SetText(sTitle); 95*cdf0e10cSrcweir } 96*cdf0e10cSrcweir 97*cdf0e10cSrcweir 98*cdf0e10cSrcweir 99*cdf0e10cSrcweir SwWrapDlg::~SwWrapDlg() 100*cdf0e10cSrcweir { 101*cdf0e10cSrcweir } 102*cdf0e10cSrcweir 103*cdf0e10cSrcweir /*-------------------------------------------------------------------- 104*cdf0e10cSrcweir Beschreibung: 105*cdf0e10cSrcweir --------------------------------------------------------------------*/ 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir 108*cdf0e10cSrcweir 109*cdf0e10cSrcweir SwWrapTabPage::SwWrapTabPage(Window *pParent, const SfxItemSet &rSet) : 110*cdf0e10cSrcweir SfxTabPage(pParent, SW_RES(TP_FRM_WRAP), rSet), 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir aWrapFLC (this, SW_RES(C_WRAP_FL)), 113*cdf0e10cSrcweir aNoWrapRB (this, SW_RES(RB_NO_WRAP)), 114*cdf0e10cSrcweir aWrapLeftRB (this, SW_RES(RB_WRAP_LEFT)), 115*cdf0e10cSrcweir aWrapRightRB (this, SW_RES(RB_WRAP_RIGHT)), 116*cdf0e10cSrcweir aWrapParallelRB (this, SW_RES(RB_WRAP_PARALLEL)), 117*cdf0e10cSrcweir aWrapThroughRB (this, SW_RES(RB_WRAP_THROUGH)), 118*cdf0e10cSrcweir aIdealWrapRB (this, SW_RES(RB_WRAP_IDEAL)), 119*cdf0e10cSrcweir 120*cdf0e10cSrcweir aMarginFL (this, SW_RES(FL_MARGIN)), 121*cdf0e10cSrcweir aLeftMarginFT (this, SW_RES(FT_LEFT_MARGIN)), 122*cdf0e10cSrcweir aLeftMarginED (this, SW_RES(ED_LEFT_MARGIN)), 123*cdf0e10cSrcweir aRightMarginFT (this, SW_RES(FT_RIGHT_MARGIN)), 124*cdf0e10cSrcweir aRightMarginED (this, SW_RES(ED_RIGHT_MARGIN)), 125*cdf0e10cSrcweir aTopMarginFT (this, SW_RES(FT_TOP_MARGIN)), 126*cdf0e10cSrcweir aTopMarginED (this, SW_RES(ED_TOP_MARGIN)), 127*cdf0e10cSrcweir aBottomMarginFT (this, SW_RES(FT_BOTTOM_MARGIN)), 128*cdf0e10cSrcweir aBottomMarginED (this, SW_RES(ED_BOTTOM_MARGIN)), 129*cdf0e10cSrcweir 130*cdf0e10cSrcweir aOptionsSepFL (this, SW_RES(FL_OPTION_SEP)), 131*cdf0e10cSrcweir aOptionsFL (this, SW_RES(FL_OPTION)), 132*cdf0e10cSrcweir aWrapAnchorOnlyCB (this, SW_RES(CB_ANCHOR_ONLY)), 133*cdf0e10cSrcweir aWrapTransparentCB (this, SW_RES(CB_TRANSPARENT)), 134*cdf0e10cSrcweir aWrapOutlineCB (this, SW_RES(CB_OUTLINE)), 135*cdf0e10cSrcweir aWrapOutsideCB (this, SW_RES(CB_ONLYOUTSIDE)), 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir aWrapIL (SW_RES(IL_WRAP)), 138*cdf0e10cSrcweir aWrapILH (SW_RES(ILH_WRAP)), 139*cdf0e10cSrcweir 140*cdf0e10cSrcweir nAnchorId(FLY_AT_PARA), 141*cdf0e10cSrcweir nHtmlMode(0), 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir pWrtSh(0), 144*cdf0e10cSrcweir 145*cdf0e10cSrcweir bFormat(sal_False), 146*cdf0e10cSrcweir bNew(sal_True), 147*cdf0e10cSrcweir bHtmlMode(sal_False), 148*cdf0e10cSrcweir bContourImage(sal_False) 149*cdf0e10cSrcweir 150*cdf0e10cSrcweir { 151*cdf0e10cSrcweir FreeResource(); 152*cdf0e10cSrcweir SetExchangeSupport(); 153*cdf0e10cSrcweir 154*cdf0e10cSrcweir Link aLk = LINK(this, SwWrapTabPage, RangeModifyHdl); 155*cdf0e10cSrcweir aLeftMarginED.SetUpHdl(aLk); 156*cdf0e10cSrcweir aLeftMarginED.SetDownHdl(aLk); 157*cdf0e10cSrcweir aLeftMarginED.SetFirstHdl(aLk); 158*cdf0e10cSrcweir aLeftMarginED.SetLastHdl(aLk); 159*cdf0e10cSrcweir aLeftMarginED.SetLoseFocusHdl(aLk); 160*cdf0e10cSrcweir 161*cdf0e10cSrcweir aRightMarginED.SetUpHdl(aLk); 162*cdf0e10cSrcweir aRightMarginED.SetDownHdl(aLk); 163*cdf0e10cSrcweir aRightMarginED.SetFirstHdl(aLk); 164*cdf0e10cSrcweir aRightMarginED.SetLastHdl(aLk); 165*cdf0e10cSrcweir aRightMarginED.SetLoseFocusHdl(aLk); 166*cdf0e10cSrcweir 167*cdf0e10cSrcweir aTopMarginED.SetUpHdl(aLk); 168*cdf0e10cSrcweir aTopMarginED.SetDownHdl(aLk); 169*cdf0e10cSrcweir aTopMarginED.SetFirstHdl(aLk); 170*cdf0e10cSrcweir aTopMarginED.SetLastHdl(aLk); 171*cdf0e10cSrcweir aTopMarginED.SetLoseFocusHdl(aLk); 172*cdf0e10cSrcweir 173*cdf0e10cSrcweir aBottomMarginED.SetUpHdl(aLk); 174*cdf0e10cSrcweir aBottomMarginED.SetDownHdl(aLk); 175*cdf0e10cSrcweir aBottomMarginED.SetFirstHdl(aLk); 176*cdf0e10cSrcweir aBottomMarginED.SetLastHdl(aLk); 177*cdf0e10cSrcweir aBottomMarginED.SetLoseFocusHdl(aLk); 178*cdf0e10cSrcweir 179*cdf0e10cSrcweir aLk = LINK(this, SwWrapTabPage, WrapTypeHdl); 180*cdf0e10cSrcweir aNoWrapRB.SetClickHdl(aLk); 181*cdf0e10cSrcweir aWrapLeftRB.SetClickHdl(aLk); 182*cdf0e10cSrcweir aWrapRightRB.SetClickHdl(aLk); 183*cdf0e10cSrcweir aWrapParallelRB.SetClickHdl(aLk); 184*cdf0e10cSrcweir aWrapThroughRB.SetClickHdl(aLk); 185*cdf0e10cSrcweir aIdealWrapRB.SetClickHdl(aLk); 186*cdf0e10cSrcweir ApplyImageList(); 187*cdf0e10cSrcweir aWrapOutlineCB.SetClickHdl(LINK(this, SwWrapTabPage, ContourHdl)); 188*cdf0e10cSrcweir } 189*cdf0e10cSrcweir 190*cdf0e10cSrcweir 191*cdf0e10cSrcweir 192*cdf0e10cSrcweir SwWrapTabPage::~SwWrapTabPage() 193*cdf0e10cSrcweir { 194*cdf0e10cSrcweir } 195*cdf0e10cSrcweir 196*cdf0e10cSrcweir 197*cdf0e10cSrcweir 198*cdf0e10cSrcweir SfxTabPage* SwWrapTabPage::Create(Window *pParent, const SfxItemSet &rSet) 199*cdf0e10cSrcweir { 200*cdf0e10cSrcweir return new SwWrapTabPage(pParent, rSet); 201*cdf0e10cSrcweir } 202*cdf0e10cSrcweir /*-------------------------------------------------------------------- 203*cdf0e10cSrcweir Beschreibung: 204*cdf0e10cSrcweir --------------------------------------------------------------------*/ 205*cdf0e10cSrcweir 206*cdf0e10cSrcweir 207*cdf0e10cSrcweir 208*cdf0e10cSrcweir void SwWrapTabPage::Reset(const SfxItemSet &rSet) 209*cdf0e10cSrcweir { 210*cdf0e10cSrcweir //Contour fuer Draw, Grafik und OLE (Einfuegen/Grafik/Eigenschaften fehlt noch!) 211*cdf0e10cSrcweir if( bDrawMode ) 212*cdf0e10cSrcweir { 213*cdf0e10cSrcweir aWrapOutlineCB.Show(); 214*cdf0e10cSrcweir aWrapOutsideCB.Show(); 215*cdf0e10cSrcweir 216*cdf0e10cSrcweir aWrapTransparentCB.Check( 0 == ((const SfxInt16Item&)rSet.Get( 217*cdf0e10cSrcweir FN_DRAW_WRAP_DLG)).GetValue() ); 218*cdf0e10cSrcweir aWrapTransparentCB.SaveValue(); 219*cdf0e10cSrcweir } 220*cdf0e10cSrcweir else 221*cdf0e10cSrcweir { 222*cdf0e10cSrcweir sal_Bool bShowCB = bFormat; 223*cdf0e10cSrcweir if( !bFormat ) 224*cdf0e10cSrcweir { 225*cdf0e10cSrcweir int nSelType = pWrtSh->GetSelectionType(); 226*cdf0e10cSrcweir if( ( nSelType & nsSelectionType::SEL_GRF ) || 227*cdf0e10cSrcweir ( nSelType & nsSelectionType::SEL_OLE && GRAPHIC_NONE != 228*cdf0e10cSrcweir pWrtSh->GetIMapGraphic().GetType() )) 229*cdf0e10cSrcweir bShowCB = sal_True; 230*cdf0e10cSrcweir } 231*cdf0e10cSrcweir if( bShowCB ) 232*cdf0e10cSrcweir { 233*cdf0e10cSrcweir aWrapOutlineCB.Show(); 234*cdf0e10cSrcweir aWrapOutsideCB.Show(); 235*cdf0e10cSrcweir } 236*cdf0e10cSrcweir } 237*cdf0e10cSrcweir 238*cdf0e10cSrcweir nHtmlMode = ::GetHtmlMode((const SwDocShell*)SfxObjectShell::Current()); 239*cdf0e10cSrcweir bHtmlMode = nHtmlMode & HTMLMODE_ON ? sal_True : sal_False; 240*cdf0e10cSrcweir 241*cdf0e10cSrcweir FieldUnit aMetric = ::GetDfltMetric(bHtmlMode); 242*cdf0e10cSrcweir SetMetric( aLeftMarginED , aMetric ); 243*cdf0e10cSrcweir SetMetric( aRightMarginED , aMetric ); 244*cdf0e10cSrcweir SetMetric( aTopMarginED , aMetric ); 245*cdf0e10cSrcweir SetMetric( aBottomMarginED, aMetric ); 246*cdf0e10cSrcweir 247*cdf0e10cSrcweir const SwFmtSurround& rSurround = (const SwFmtSurround&)rSet.Get(RES_SURROUND); 248*cdf0e10cSrcweir 249*cdf0e10cSrcweir SwSurround nSur = rSurround.GetSurround(); 250*cdf0e10cSrcweir const SwFmtAnchor &rAnch = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR); 251*cdf0e10cSrcweir nAnchorId = rAnch.GetAnchorId(); 252*cdf0e10cSrcweir 253*cdf0e10cSrcweir if (((nAnchorId == FLY_AT_PARA) || (nAnchorId == FLY_AT_CHAR)) 254*cdf0e10cSrcweir && (nSur != SURROUND_NONE)) 255*cdf0e10cSrcweir { 256*cdf0e10cSrcweir aWrapAnchorOnlyCB.Check( rSurround.IsAnchorOnly() ); 257*cdf0e10cSrcweir } 258*cdf0e10cSrcweir else 259*cdf0e10cSrcweir { 260*cdf0e10cSrcweir aWrapAnchorOnlyCB.Enable( sal_False ); 261*cdf0e10cSrcweir } 262*cdf0e10cSrcweir 263*cdf0e10cSrcweir sal_Bool bContour = rSurround.IsContour(); 264*cdf0e10cSrcweir aWrapOutlineCB.Check( bContour ); 265*cdf0e10cSrcweir aWrapOutsideCB.Check( rSurround.IsOutside() ); 266*cdf0e10cSrcweir aWrapThroughRB.Enable(!aWrapOutlineCB.IsChecked()); 267*cdf0e10cSrcweir bContourImage = !bContour; 268*cdf0e10cSrcweir 269*cdf0e10cSrcweir ImageRadioButton* pBtn = NULL; 270*cdf0e10cSrcweir 271*cdf0e10cSrcweir switch (nSur) 272*cdf0e10cSrcweir { 273*cdf0e10cSrcweir case SURROUND_NONE: 274*cdf0e10cSrcweir { 275*cdf0e10cSrcweir pBtn = &aNoWrapRB; 276*cdf0e10cSrcweir break; 277*cdf0e10cSrcweir } 278*cdf0e10cSrcweir 279*cdf0e10cSrcweir case SURROUND_THROUGHT: 280*cdf0e10cSrcweir { 281*cdf0e10cSrcweir // transparent ? 282*cdf0e10cSrcweir pBtn = &aWrapThroughRB; 283*cdf0e10cSrcweir 284*cdf0e10cSrcweir if (!bDrawMode) 285*cdf0e10cSrcweir { 286*cdf0e10cSrcweir const SvxOpaqueItem& rOpaque = (const SvxOpaqueItem&)rSet.Get(RES_OPAQUE); 287*cdf0e10cSrcweir aWrapTransparentCB.Check(!rOpaque.GetValue()); 288*cdf0e10cSrcweir } 289*cdf0e10cSrcweir break; 290*cdf0e10cSrcweir } 291*cdf0e10cSrcweir 292*cdf0e10cSrcweir case SURROUND_PARALLEL: 293*cdf0e10cSrcweir { 294*cdf0e10cSrcweir pBtn = &aWrapParallelRB; 295*cdf0e10cSrcweir break; 296*cdf0e10cSrcweir } 297*cdf0e10cSrcweir 298*cdf0e10cSrcweir case SURROUND_IDEAL: 299*cdf0e10cSrcweir { 300*cdf0e10cSrcweir pBtn = &aIdealWrapRB; 301*cdf0e10cSrcweir break; 302*cdf0e10cSrcweir } 303*cdf0e10cSrcweir 304*cdf0e10cSrcweir default: 305*cdf0e10cSrcweir { 306*cdf0e10cSrcweir if (nSur == SURROUND_LEFT) 307*cdf0e10cSrcweir pBtn = &aWrapLeftRB; 308*cdf0e10cSrcweir else if (nSur == SURROUND_RIGHT) 309*cdf0e10cSrcweir pBtn = &aWrapRightRB; 310*cdf0e10cSrcweir } 311*cdf0e10cSrcweir } 312*cdf0e10cSrcweir if (pBtn) 313*cdf0e10cSrcweir { 314*cdf0e10cSrcweir pBtn->Check(); 315*cdf0e10cSrcweir WrapTypeHdl(pBtn); 316*cdf0e10cSrcweir // Hier wird fuer Zeichenobjekte, die im Moment auf Durchlauf stehen, 317*cdf0e10cSrcweir // schon mal der Default "Kontur an" vorbereitet, falls man spaeter auf 318*cdf0e10cSrcweir // irgendeinen Umlauf umschaltet. 319*cdf0e10cSrcweir if (bDrawMode && !aWrapOutlineCB.IsEnabled()) 320*cdf0e10cSrcweir aWrapOutlineCB.Check(); 321*cdf0e10cSrcweir } 322*cdf0e10cSrcweir aWrapTransparentCB.Enable( pBtn == &aWrapThroughRB && !bHtmlMode ); 323*cdf0e10cSrcweir 324*cdf0e10cSrcweir const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)rSet.Get(RES_UL_SPACE); 325*cdf0e10cSrcweir const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)rSet.Get(RES_LR_SPACE); 326*cdf0e10cSrcweir 327*cdf0e10cSrcweir // Abstand zum Text 328*cdf0e10cSrcweir aLeftMarginED.SetValue(aLeftMarginED.Normalize(rLR.GetLeft()), FUNIT_TWIP); 329*cdf0e10cSrcweir aRightMarginED.SetValue(aRightMarginED.Normalize(rLR.GetRight()), FUNIT_TWIP); 330*cdf0e10cSrcweir aTopMarginED.SetValue(aTopMarginED.Normalize(rUL.GetUpper()), FUNIT_TWIP); 331*cdf0e10cSrcweir aBottomMarginED.SetValue(aBottomMarginED.Normalize(rUL.GetLower()), FUNIT_TWIP); 332*cdf0e10cSrcweir 333*cdf0e10cSrcweir ContourHdl(0); 334*cdf0e10cSrcweir ActivatePage( rSet ); 335*cdf0e10cSrcweir } 336*cdf0e10cSrcweir 337*cdf0e10cSrcweir /*-------------------------------------------------------------------- 338*cdf0e10cSrcweir Beschreibung: Attribute in den Set stopfen bei OK 339*cdf0e10cSrcweir --------------------------------------------------------------------*/ 340*cdf0e10cSrcweir 341*cdf0e10cSrcweir 342*cdf0e10cSrcweir 343*cdf0e10cSrcweir sal_Bool SwWrapTabPage::FillItemSet(SfxItemSet &rSet) 344*cdf0e10cSrcweir { 345*cdf0e10cSrcweir sal_Bool bModified = sal_False; 346*cdf0e10cSrcweir const SfxPoolItem* pOldItem; 347*cdf0e10cSrcweir 348*cdf0e10cSrcweir const SwFmtSurround& rOldSur = (const SwFmtSurround&)GetItemSet().Get(RES_SURROUND); 349*cdf0e10cSrcweir SwFmtSurround aSur( rOldSur ); 350*cdf0e10cSrcweir 351*cdf0e10cSrcweir SvxOpaqueItem aOp( RES_OPAQUE); 352*cdf0e10cSrcweir 353*cdf0e10cSrcweir if (!bDrawMode) 354*cdf0e10cSrcweir { 355*cdf0e10cSrcweir const SvxOpaqueItem& rOpaque = (const SvxOpaqueItem&)GetItemSet().Get(RES_OPAQUE); 356*cdf0e10cSrcweir aOp = rOpaque; 357*cdf0e10cSrcweir aOp.SetValue(sal_True); 358*cdf0e10cSrcweir } 359*cdf0e10cSrcweir 360*cdf0e10cSrcweir if (aNoWrapRB.IsChecked()) 361*cdf0e10cSrcweir aSur.SetSurround(SURROUND_NONE); 362*cdf0e10cSrcweir else if (aWrapLeftRB.IsChecked()) 363*cdf0e10cSrcweir aSur.SetSurround(SURROUND_LEFT); 364*cdf0e10cSrcweir else if (aWrapRightRB.IsChecked()) 365*cdf0e10cSrcweir aSur.SetSurround(SURROUND_RIGHT); 366*cdf0e10cSrcweir else if (aWrapParallelRB.IsChecked()) 367*cdf0e10cSrcweir aSur.SetSurround(SURROUND_PARALLEL); 368*cdf0e10cSrcweir else if (aWrapThroughRB.IsChecked()) 369*cdf0e10cSrcweir { 370*cdf0e10cSrcweir aSur.SetSurround(SURROUND_THROUGHT); 371*cdf0e10cSrcweir if (aWrapTransparentCB.IsChecked() && !bDrawMode) 372*cdf0e10cSrcweir aOp.SetValue(sal_False); 373*cdf0e10cSrcweir } 374*cdf0e10cSrcweir else if (aIdealWrapRB.IsChecked()) 375*cdf0e10cSrcweir aSur.SetSurround(SURROUND_IDEAL); 376*cdf0e10cSrcweir 377*cdf0e10cSrcweir aSur.SetAnchorOnly( aWrapAnchorOnlyCB.IsChecked() ); 378*cdf0e10cSrcweir sal_Bool bContour = aWrapOutlineCB.IsChecked() && aWrapOutlineCB.IsEnabled(); 379*cdf0e10cSrcweir aSur.SetContour( bContour ); 380*cdf0e10cSrcweir 381*cdf0e10cSrcweir if ( bContour ) 382*cdf0e10cSrcweir aSur.SetOutside(aWrapOutsideCB.IsChecked()); 383*cdf0e10cSrcweir 384*cdf0e10cSrcweir if(0 == (pOldItem = GetOldItem( rSet, RES_SURROUND )) || 385*cdf0e10cSrcweir aSur != *pOldItem ) 386*cdf0e10cSrcweir { 387*cdf0e10cSrcweir rSet.Put(aSur); 388*cdf0e10cSrcweir bModified = sal_True; 389*cdf0e10cSrcweir } 390*cdf0e10cSrcweir 391*cdf0e10cSrcweir if (!bDrawMode) 392*cdf0e10cSrcweir { 393*cdf0e10cSrcweir if(0 == (pOldItem = GetOldItem( rSet, FN_OPAQUE )) || 394*cdf0e10cSrcweir aOp != *pOldItem ) 395*cdf0e10cSrcweir { 396*cdf0e10cSrcweir rSet.Put(aOp); 397*cdf0e10cSrcweir bModified = sal_True; 398*cdf0e10cSrcweir } 399*cdf0e10cSrcweir } 400*cdf0e10cSrcweir 401*cdf0e10cSrcweir sal_Bool bTopMod = aTopMarginED.IsValueModified(); 402*cdf0e10cSrcweir sal_Bool bBottomMod = aBottomMarginED.IsValueModified(); 403*cdf0e10cSrcweir 404*cdf0e10cSrcweir SvxULSpaceItem aUL( RES_UL_SPACE ); 405*cdf0e10cSrcweir aUL.SetUpper((sal_uInt16)aTopMarginED.Denormalize(aTopMarginED.GetValue(FUNIT_TWIP))); 406*cdf0e10cSrcweir aUL.SetLower((sal_uInt16)aBottomMarginED.Denormalize(aBottomMarginED.GetValue(FUNIT_TWIP))); 407*cdf0e10cSrcweir 408*cdf0e10cSrcweir if ( bTopMod || bBottomMod ) 409*cdf0e10cSrcweir { 410*cdf0e10cSrcweir if(0 == (pOldItem = GetOldItem(rSet, RES_UL_SPACE)) || 411*cdf0e10cSrcweir aUL != *pOldItem ) 412*cdf0e10cSrcweir { 413*cdf0e10cSrcweir rSet.Put( aUL, RES_UL_SPACE ); 414*cdf0e10cSrcweir bModified = sal_True; 415*cdf0e10cSrcweir } 416*cdf0e10cSrcweir } 417*cdf0e10cSrcweir 418*cdf0e10cSrcweir sal_Bool bLeftMod = aLeftMarginED.IsValueModified(); 419*cdf0e10cSrcweir sal_Bool bRightMod = aRightMarginED.IsValueModified(); 420*cdf0e10cSrcweir 421*cdf0e10cSrcweir SvxLRSpaceItem aLR( RES_LR_SPACE ); 422*cdf0e10cSrcweir aLR.SetLeft((sal_uInt16)aLeftMarginED.Denormalize(aLeftMarginED.GetValue(FUNIT_TWIP))); 423*cdf0e10cSrcweir aLR.SetRight((sal_uInt16)aRightMarginED.Denormalize(aRightMarginED.GetValue(FUNIT_TWIP))); 424*cdf0e10cSrcweir 425*cdf0e10cSrcweir if ( bLeftMod || bRightMod ) 426*cdf0e10cSrcweir { 427*cdf0e10cSrcweir if( 0 == (pOldItem = GetOldItem(rSet, RES_LR_SPACE)) || 428*cdf0e10cSrcweir aLR != *pOldItem ) 429*cdf0e10cSrcweir { 430*cdf0e10cSrcweir rSet.Put(aLR, RES_LR_SPACE); 431*cdf0e10cSrcweir bModified = sal_True; 432*cdf0e10cSrcweir } 433*cdf0e10cSrcweir } 434*cdf0e10cSrcweir 435*cdf0e10cSrcweir if ( bDrawMode ) 436*cdf0e10cSrcweir { 437*cdf0e10cSrcweir sal_Bool bChecked = aWrapTransparentCB.IsChecked() & aWrapTransparentCB.IsEnabled(); 438*cdf0e10cSrcweir if (aWrapTransparentCB.GetSavedValue() != bChecked) 439*cdf0e10cSrcweir bModified |= 0 != rSet.Put(SfxInt16Item(FN_DRAW_WRAP_DLG, bChecked ? 0 : 1)); 440*cdf0e10cSrcweir } 441*cdf0e10cSrcweir 442*cdf0e10cSrcweir return bModified; 443*cdf0e10cSrcweir } 444*cdf0e10cSrcweir 445*cdf0e10cSrcweir /*-------------------------------------------------------------------- 446*cdf0e10cSrcweir Beschreibung: Bsp - Update 447*cdf0e10cSrcweir --------------------------------------------------------------------*/ 448*cdf0e10cSrcweir 449*cdf0e10cSrcweir 450*cdf0e10cSrcweir 451*cdf0e10cSrcweir void SwWrapTabPage::ActivatePage(const SfxItemSet& rSet) 452*cdf0e10cSrcweir { 453*cdf0e10cSrcweir // Anchor 454*cdf0e10cSrcweir const SwFmtAnchor &rAnch = (const SwFmtAnchor&)rSet.Get(RES_ANCHOR); 455*cdf0e10cSrcweir nAnchorId = rAnch.GetAnchorId(); 456*cdf0e10cSrcweir sal_Bool bEnable = (nAnchorId != FLY_AS_CHAR); 457*cdf0e10cSrcweir 458*cdf0e10cSrcweir if (!bDrawMode) 459*cdf0e10cSrcweir { 460*cdf0e10cSrcweir SwWrtShell* pSh = bFormat ? ::GetActiveWrtShell() : pWrtSh; 461*cdf0e10cSrcweir SwFlyFrmAttrMgr aMgr( bNew, pSh, (const SwAttrSet&)GetItemSet() ); 462*cdf0e10cSrcweir SvxSwFrameValidation aVal; 463*cdf0e10cSrcweir 464*cdf0e10cSrcweir // Size 465*cdf0e10cSrcweir const SwFmtFrmSize& rFrmSize = (const SwFmtFrmSize&)rSet.Get(RES_FRM_SIZE); 466*cdf0e10cSrcweir Size aSize = rFrmSize.GetSize(); 467*cdf0e10cSrcweir 468*cdf0e10cSrcweir // Rand 469*cdf0e10cSrcweir const SvxULSpaceItem& rUL = (const SvxULSpaceItem&)rSet.Get(RES_UL_SPACE); 470*cdf0e10cSrcweir const SvxLRSpaceItem& rLR = (const SvxLRSpaceItem&)rSet.Get(RES_LR_SPACE); 471*cdf0e10cSrcweir nOldLeftMargin = static_cast< sal_uInt16 >(rLR.GetLeft()); 472*cdf0e10cSrcweir nOldRightMargin = static_cast< sal_uInt16 >(rLR.GetRight()); 473*cdf0e10cSrcweir nOldUpperMargin = static_cast< sal_uInt16 >(rUL.GetUpper()); 474*cdf0e10cSrcweir nOldLowerMargin = static_cast< sal_uInt16 >(rUL.GetLower()); 475*cdf0e10cSrcweir 476*cdf0e10cSrcweir // Position 477*cdf0e10cSrcweir const SwFmtHoriOrient& rHori = (const SwFmtHoriOrient&)rSet.Get(RES_HORI_ORIENT); 478*cdf0e10cSrcweir const SwFmtVertOrient& rVert = (const SwFmtVertOrient&)rSet.Get(RES_VERT_ORIENT); 479*cdf0e10cSrcweir 480*cdf0e10cSrcweir aVal.nAnchorType = static_cast< sal_Int16 >(nAnchorId); 481*cdf0e10cSrcweir aVal.bAutoHeight = rFrmSize.GetHeightSizeType() == ATT_MIN_SIZE; 482*cdf0e10cSrcweir aVal.bAutoWidth = rFrmSize.GetWidthSizeType() == ATT_MIN_SIZE; 483*cdf0e10cSrcweir aVal.bMirror = rHori.IsPosToggle(); 484*cdf0e10cSrcweir // OD 18.09.2003 #i18732# 485*cdf0e10cSrcweir aVal.bFollowTextFlow = 486*cdf0e10cSrcweir static_cast<const SwFmtFollowTextFlow&>(rSet.Get(RES_FOLLOW_TEXT_FLOW)).GetValue(); 487*cdf0e10cSrcweir 488*cdf0e10cSrcweir aVal.nHoriOrient = (short)rHori.GetHoriOrient(); 489*cdf0e10cSrcweir aVal.nVertOrient = (short)rVert.GetVertOrient(); 490*cdf0e10cSrcweir 491*cdf0e10cSrcweir aVal.nHPos = rHori.GetPos(); 492*cdf0e10cSrcweir aVal.nHRelOrient = rHori.GetRelationOrient(); 493*cdf0e10cSrcweir aVal.nVPos = rVert.GetPos(); 494*cdf0e10cSrcweir aVal.nVRelOrient = rVert.GetRelationOrient(); 495*cdf0e10cSrcweir 496*cdf0e10cSrcweir if (rFrmSize.GetWidthPercent() && rFrmSize.GetWidthPercent() != 0xff) 497*cdf0e10cSrcweir aSize.Width() = aSize.Width() * rFrmSize.GetWidthPercent() / 100; 498*cdf0e10cSrcweir 499*cdf0e10cSrcweir if (rFrmSize.GetHeightPercent() && rFrmSize.GetHeightPercent() != 0xff) 500*cdf0e10cSrcweir aSize.Height() = aSize.Height() * rFrmSize.GetHeightPercent() / 100; 501*cdf0e10cSrcweir 502*cdf0e10cSrcweir aVal.nWidth = aSize.Width(); 503*cdf0e10cSrcweir aVal.nHeight = aSize.Height(); 504*cdf0e10cSrcweir aFrmSize = aSize; 505*cdf0e10cSrcweir 506*cdf0e10cSrcweir aMgr.ValidateMetrics(aVal, 0); 507*cdf0e10cSrcweir 508*cdf0e10cSrcweir SwTwips nLeft; 509*cdf0e10cSrcweir SwTwips nRight; 510*cdf0e10cSrcweir SwTwips nTop; 511*cdf0e10cSrcweir SwTwips nBottom; 512*cdf0e10cSrcweir 513*cdf0e10cSrcweir nLeft = aVal.nHPos - aVal.nMinHPos; 514*cdf0e10cSrcweir nRight = aVal.nMaxWidth - aVal.nWidth; 515*cdf0e10cSrcweir nTop = aVal.nVPos - aVal.nMinVPos; 516*cdf0e10cSrcweir nBottom = aVal.nMaxHeight - aVal.nHeight; 517*cdf0e10cSrcweir 518*cdf0e10cSrcweir if (bHtmlMode && 0 == (nHtmlMode & HTMLMODE_FULL_ABS_POS)) 519*cdf0e10cSrcweir { 520*cdf0e10cSrcweir nLeft = nRight = ( nLeft + nRight ) / 2; 521*cdf0e10cSrcweir nTop = nBottom = ( nTop + nBottom ) / 2; 522*cdf0e10cSrcweir } 523*cdf0e10cSrcweir else 524*cdf0e10cSrcweir { 525*cdf0e10cSrcweir if (aVal.nAnchorType == FLY_AS_CHAR) 526*cdf0e10cSrcweir { 527*cdf0e10cSrcweir nLeft = nRight; 528*cdf0e10cSrcweir 529*cdf0e10cSrcweir if (aVal.nVPos < 0) 530*cdf0e10cSrcweir { 531*cdf0e10cSrcweir if (aVal.nVPos <= aVal.nMaxHeight) 532*cdf0e10cSrcweir nTop = aVal.nMaxVPos - aVal.nHeight; 533*cdf0e10cSrcweir else 534*cdf0e10cSrcweir nTop = nBottom = 0; // Kein Umlauf 535*cdf0e10cSrcweir } 536*cdf0e10cSrcweir else 537*cdf0e10cSrcweir nTop = aVal.nMaxVPos - aVal.nHeight - aVal.nVPos; 538*cdf0e10cSrcweir } 539*cdf0e10cSrcweir else 540*cdf0e10cSrcweir { 541*cdf0e10cSrcweir nLeft += nRight; 542*cdf0e10cSrcweir nTop += nBottom; 543*cdf0e10cSrcweir } 544*cdf0e10cSrcweir 545*cdf0e10cSrcweir nBottom = nTop; 546*cdf0e10cSrcweir nRight = nLeft; 547*cdf0e10cSrcweir } 548*cdf0e10cSrcweir 549*cdf0e10cSrcweir aLeftMarginED.SetMax(aLeftMarginED.Normalize(nLeft), FUNIT_TWIP); 550*cdf0e10cSrcweir aRightMarginED.SetMax(aRightMarginED.Normalize(nRight), FUNIT_TWIP); 551*cdf0e10cSrcweir 552*cdf0e10cSrcweir aTopMarginED.SetMax(aTopMarginED.Normalize(nTop), FUNIT_TWIP); 553*cdf0e10cSrcweir aBottomMarginED.SetMax(aBottomMarginED.Normalize(nBottom), FUNIT_TWIP); 554*cdf0e10cSrcweir 555*cdf0e10cSrcweir RangeModifyHdl(&aLeftMarginED); 556*cdf0e10cSrcweir RangeModifyHdl(&aTopMarginED); 557*cdf0e10cSrcweir } 558*cdf0e10cSrcweir 559*cdf0e10cSrcweir const SwFmtSurround& rSurround = (const SwFmtSurround&)rSet.Get(RES_SURROUND); 560*cdf0e10cSrcweir SwSurround nSur = rSurround.GetSurround(); 561*cdf0e10cSrcweir 562*cdf0e10cSrcweir aWrapTransparentCB.Enable( bEnable && !bHtmlMode && nSur == SURROUND_THROUGHT ); 563*cdf0e10cSrcweir if(bHtmlMode) 564*cdf0e10cSrcweir { 565*cdf0e10cSrcweir sal_Bool bSomeAbsPos = 0 != (nHtmlMode & HTMLMODE_SOME_ABS_POS); 566*cdf0e10cSrcweir const SwFmtHoriOrient& rHori = (const SwFmtHoriOrient&)rSet.Get(RES_HORI_ORIENT); 567*cdf0e10cSrcweir sal_Int16 eHOrient = rHori.GetHoriOrient(); 568*cdf0e10cSrcweir sal_Int16 eHRelOrient = rHori.GetRelationOrient(); 569*cdf0e10cSrcweir aWrapOutlineCB.Hide(); 570*cdf0e10cSrcweir const bool bAllHtmlModes = 571*cdf0e10cSrcweir ((nAnchorId == FLY_AT_PARA) || (nAnchorId == FLY_AT_CHAR)) && 572*cdf0e10cSrcweir (eHOrient == text::HoriOrientation::RIGHT || eHOrient == text::HoriOrientation::LEFT); 573*cdf0e10cSrcweir aWrapAnchorOnlyCB.Enable( bAllHtmlModes && nSur != SURROUND_NONE ); 574*cdf0e10cSrcweir aWrapOutsideCB.Hide(); 575*cdf0e10cSrcweir aIdealWrapRB.Enable( sal_False ); 576*cdf0e10cSrcweir 577*cdf0e10cSrcweir 578*cdf0e10cSrcweir aWrapTransparentCB.Enable( sal_False ); 579*cdf0e10cSrcweir aNoWrapRB.Enable( FLY_AT_PARA == nAnchorId ); 580*cdf0e10cSrcweir aWrapParallelRB.Enable( sal_False ); 581*cdf0e10cSrcweir aWrapLeftRB .Enable 582*cdf0e10cSrcweir ( (FLY_AT_PARA == nAnchorId) 583*cdf0e10cSrcweir || ( (FLY_AT_CHAR == nAnchorId) 584*cdf0e10cSrcweir && (eHOrient == text::HoriOrientation::RIGHT) 585*cdf0e10cSrcweir && (eHRelOrient == text::RelOrientation::PRINT_AREA))); 586*cdf0e10cSrcweir aWrapRightRB .Enable 587*cdf0e10cSrcweir ( (FLY_AT_PARA == nAnchorId) 588*cdf0e10cSrcweir || ( (FLY_AT_CHAR == nAnchorId) 589*cdf0e10cSrcweir && (eHOrient == text::HoriOrientation::LEFT) 590*cdf0e10cSrcweir && (eHRelOrient == text::RelOrientation::PRINT_AREA))); 591*cdf0e10cSrcweir 592*cdf0e10cSrcweir aWrapThroughRB.Enable 593*cdf0e10cSrcweir ( ( (FLY_AT_PAGE == nAnchorId) 594*cdf0e10cSrcweir || ( (FLY_AT_CHAR == nAnchorId) 595*cdf0e10cSrcweir && (eHRelOrient != text::RelOrientation::PRINT_AREA)) 596*cdf0e10cSrcweir || (FLY_AT_PARA == nAnchorId)) 597*cdf0e10cSrcweir && bSomeAbsPos 598*cdf0e10cSrcweir && (eHOrient != text::HoriOrientation::RIGHT)); 599*cdf0e10cSrcweir if(aNoWrapRB.IsChecked() && !aNoWrapRB.IsEnabled()) 600*cdf0e10cSrcweir { 601*cdf0e10cSrcweir if(aWrapThroughRB.IsEnabled()) 602*cdf0e10cSrcweir aWrapThroughRB.Check(sal_True); 603*cdf0e10cSrcweir else if(aWrapLeftRB.IsEnabled()) 604*cdf0e10cSrcweir aWrapLeftRB.Check(); 605*cdf0e10cSrcweir else if(aWrapRightRB.IsEnabled()) 606*cdf0e10cSrcweir aWrapRightRB.Check(); 607*cdf0e10cSrcweir 608*cdf0e10cSrcweir } 609*cdf0e10cSrcweir if(aWrapLeftRB.IsChecked() && !aWrapLeftRB.IsEnabled()) 610*cdf0e10cSrcweir { 611*cdf0e10cSrcweir if(aWrapRightRB.IsEnabled()) 612*cdf0e10cSrcweir aWrapRightRB.Check(); 613*cdf0e10cSrcweir else if(aWrapThroughRB.IsEnabled()) 614*cdf0e10cSrcweir aWrapThroughRB.Check(); 615*cdf0e10cSrcweir } 616*cdf0e10cSrcweir if(aWrapRightRB.IsChecked() && !aWrapRightRB.IsEnabled()) 617*cdf0e10cSrcweir { 618*cdf0e10cSrcweir if(aWrapLeftRB.IsEnabled()) 619*cdf0e10cSrcweir aWrapLeftRB.Check(); 620*cdf0e10cSrcweir else if(aWrapThroughRB.IsEnabled()) 621*cdf0e10cSrcweir aWrapThroughRB.Check(); 622*cdf0e10cSrcweir } 623*cdf0e10cSrcweir if(aWrapThroughRB.IsChecked() && !aWrapThroughRB.IsEnabled()) 624*cdf0e10cSrcweir if(aNoWrapRB.IsEnabled()) 625*cdf0e10cSrcweir aNoWrapRB.Check(); 626*cdf0e10cSrcweir 627*cdf0e10cSrcweir if(aWrapParallelRB.IsChecked() && !aWrapParallelRB.IsEnabled()) 628*cdf0e10cSrcweir aWrapThroughRB.Check(); 629*cdf0e10cSrcweir } 630*cdf0e10cSrcweir else 631*cdf0e10cSrcweir { 632*cdf0e10cSrcweir aNoWrapRB.Enable( bEnable ); 633*cdf0e10cSrcweir aWrapLeftRB.Enable( bEnable ); 634*cdf0e10cSrcweir aWrapRightRB.Enable( bEnable ); 635*cdf0e10cSrcweir aIdealWrapRB.Enable( bEnable ); 636*cdf0e10cSrcweir aWrapThroughRB.Enable( bEnable ); 637*cdf0e10cSrcweir aWrapParallelRB.Enable( bEnable ); 638*cdf0e10cSrcweir aWrapAnchorOnlyCB.Enable( 639*cdf0e10cSrcweir ((nAnchorId == FLY_AT_PARA) || (nAnchorId == FLY_AT_CHAR)) 640*cdf0e10cSrcweir && nSur != SURROUND_NONE ); 641*cdf0e10cSrcweir } 642*cdf0e10cSrcweir ContourHdl(0); 643*cdf0e10cSrcweir } 644*cdf0e10cSrcweir 645*cdf0e10cSrcweir 646*cdf0e10cSrcweir 647*cdf0e10cSrcweir int SwWrapTabPage::DeactivatePage(SfxItemSet* _pSet) 648*cdf0e10cSrcweir { 649*cdf0e10cSrcweir if(_pSet) 650*cdf0e10cSrcweir FillItemSet(*_pSet); 651*cdf0e10cSrcweir 652*cdf0e10cSrcweir return sal_True; 653*cdf0e10cSrcweir } 654*cdf0e10cSrcweir 655*cdf0e10cSrcweir /*-------------------------------------------------------------------- 656*cdf0e10cSrcweir Beschreibung: Bereichspruefung 657*cdf0e10cSrcweir --------------------------------------------------------------------*/ 658*cdf0e10cSrcweir 659*cdf0e10cSrcweir 660*cdf0e10cSrcweir 661*cdf0e10cSrcweir IMPL_LINK( SwWrapTabPage, RangeModifyHdl, MetricField *, pEdit ) 662*cdf0e10cSrcweir { 663*cdf0e10cSrcweir if(bHtmlMode && 0 == (nHtmlMode & HTMLMODE_FULL_ABS_POS)) 664*cdf0e10cSrcweir { 665*cdf0e10cSrcweir sal_Int64 nValue = pEdit->GetValue(); 666*cdf0e10cSrcweir if (pEdit == &aLeftMarginED) 667*cdf0e10cSrcweir aRightMarginED.SetUserValue(nValue, FUNIT_NONE); 668*cdf0e10cSrcweir else if (pEdit == &aRightMarginED) 669*cdf0e10cSrcweir aLeftMarginED.SetUserValue(nValue, FUNIT_NONE); 670*cdf0e10cSrcweir else if (pEdit == &aTopMarginED) 671*cdf0e10cSrcweir aBottomMarginED.SetUserValue(nValue, FUNIT_NONE); 672*cdf0e10cSrcweir else if (pEdit == &aBottomMarginED) 673*cdf0e10cSrcweir aTopMarginED.SetUserValue(nValue, FUNIT_NONE); 674*cdf0e10cSrcweir } 675*cdf0e10cSrcweir else 676*cdf0e10cSrcweir { 677*cdf0e10cSrcweir sal_Int64 nValue = pEdit->GetValue(); 678*cdf0e10cSrcweir MetricField *pOpposite = 0; 679*cdf0e10cSrcweir 680*cdf0e10cSrcweir if (pEdit == &aLeftMarginED) 681*cdf0e10cSrcweir pOpposite = &aRightMarginED; 682*cdf0e10cSrcweir else if (pEdit == &aRightMarginED) 683*cdf0e10cSrcweir pOpposite = &aLeftMarginED; 684*cdf0e10cSrcweir else if (pEdit == &aTopMarginED) 685*cdf0e10cSrcweir pOpposite = &aBottomMarginED; 686*cdf0e10cSrcweir else if (pEdit == &aBottomMarginED) 687*cdf0e10cSrcweir pOpposite = &aTopMarginED; 688*cdf0e10cSrcweir 689*cdf0e10cSrcweir sal_Int64 nOpposite = pOpposite->GetValue(); 690*cdf0e10cSrcweir 691*cdf0e10cSrcweir if (nValue + nOpposite > Max(pEdit->GetMax(), pOpposite->GetMax())) 692*cdf0e10cSrcweir pOpposite->SetValue(pOpposite->GetMax() - nValue); 693*cdf0e10cSrcweir } 694*cdf0e10cSrcweir 695*cdf0e10cSrcweir return 0; 696*cdf0e10cSrcweir } 697*cdf0e10cSrcweir 698*cdf0e10cSrcweir /*-------------------------------------------------------------------- 699*cdf0e10cSrcweir Beschreibung: 700*cdf0e10cSrcweir --------------------------------------------------------------------*/ 701*cdf0e10cSrcweir 702*cdf0e10cSrcweir 703*cdf0e10cSrcweir 704*cdf0e10cSrcweir IMPL_LINK( SwWrapTabPage, WrapTypeHdl, ImageRadioButton *, pBtn ) 705*cdf0e10cSrcweir { 706*cdf0e10cSrcweir sal_Bool bWrapThrough = (pBtn == &aWrapThroughRB); 707*cdf0e10cSrcweir aWrapTransparentCB.Enable( bWrapThrough && !bHtmlMode ); 708*cdf0e10cSrcweir bWrapThrough |= ( nAnchorId == FLY_AS_CHAR ); 709*cdf0e10cSrcweir aWrapOutlineCB.Enable( !bWrapThrough && pBtn != &aNoWrapRB); 710*cdf0e10cSrcweir aWrapOutsideCB.Enable( !bWrapThrough && aWrapOutlineCB.IsChecked() ); 711*cdf0e10cSrcweir aWrapAnchorOnlyCB.Enable( 712*cdf0e10cSrcweir ((nAnchorId == FLY_AT_PARA) || (nAnchorId == FLY_AT_CHAR)) && 713*cdf0e10cSrcweir (pBtn != &aNoWrapRB) ); 714*cdf0e10cSrcweir 715*cdf0e10cSrcweir ContourHdl(0); 716*cdf0e10cSrcweir return 0; 717*cdf0e10cSrcweir } 718*cdf0e10cSrcweir 719*cdf0e10cSrcweir /*-------------------------------------------------------------------- 720*cdf0e10cSrcweir Beschreibung: 721*cdf0e10cSrcweir --------------------------------------------------------------------*/ 722*cdf0e10cSrcweir 723*cdf0e10cSrcweir 724*cdf0e10cSrcweir 725*cdf0e10cSrcweir IMPL_LINK( SwWrapTabPage, ContourHdl, CheckBox *, EMPTYARG ) 726*cdf0e10cSrcweir { 727*cdf0e10cSrcweir sal_Bool bEnable = !(aWrapOutlineCB.IsChecked() && aWrapOutlineCB.IsEnabled()); 728*cdf0e10cSrcweir 729*cdf0e10cSrcweir aWrapOutsideCB.Enable(!bEnable); 730*cdf0e10cSrcweir 731*cdf0e10cSrcweir bEnable = !aWrapOutlineCB.IsChecked(); 732*cdf0e10cSrcweir if (bEnable == bContourImage) // damit es nicht immer flackert 733*cdf0e10cSrcweir { 734*cdf0e10cSrcweir bContourImage = !bEnable; 735*cdf0e10cSrcweir ApplyImageList(); 736*cdf0e10cSrcweir } 737*cdf0e10cSrcweir 738*cdf0e10cSrcweir return 0; 739*cdf0e10cSrcweir } 740*cdf0e10cSrcweir 741*cdf0e10cSrcweir /*-------------------------------------------------------------------- 742*cdf0e10cSrcweir Beschreibung: 743*cdf0e10cSrcweir --------------------------------------------------------------------*/ 744*cdf0e10cSrcweir sal_uInt16* SwWrapTabPage::GetRanges() 745*cdf0e10cSrcweir { 746*cdf0e10cSrcweir return aWrapPageRg; 747*cdf0e10cSrcweir } 748*cdf0e10cSrcweir /* -----------------------------08.05.2002 14:28------------------------------ 749*cdf0e10cSrcweir 750*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 751*cdf0e10cSrcweir void SwWrapTabPage::DataChanged( const DataChangedEvent& rDCEvt ) 752*cdf0e10cSrcweir { 753*cdf0e10cSrcweir if ( (rDCEvt.GetType() == DATACHANGED_SETTINGS) && 754*cdf0e10cSrcweir (rDCEvt.GetFlags() & SETTINGS_STYLE) ) 755*cdf0e10cSrcweir ApplyImageList(); 756*cdf0e10cSrcweir 757*cdf0e10cSrcweir SfxTabPage::DataChanged( rDCEvt ); 758*cdf0e10cSrcweir } 759*cdf0e10cSrcweir /* -----------------------------08.05.2002 14:28------------------------------ 760*cdf0e10cSrcweir 761*cdf0e10cSrcweir ---------------------------------------------------------------------------*/ 762*cdf0e10cSrcweir void SwWrapTabPage::ApplyImageList() 763*cdf0e10cSrcweir { 764*cdf0e10cSrcweir ImageList& rImgLst = GetSettings().GetStyleSettings().GetHighContrastMode() ? 765*cdf0e10cSrcweir aWrapILH : aWrapIL; 766*cdf0e10cSrcweir 767*cdf0e10cSrcweir aWrapThroughRB.SetModeRadioImage(rImgLst.GetImage(IMG_THROUGH)); 768*cdf0e10cSrcweir sal_Bool bWrapOutline = !aWrapOutlineCB.IsChecked(); 769*cdf0e10cSrcweir if(bWrapOutline) 770*cdf0e10cSrcweir { 771*cdf0e10cSrcweir aNoWrapRB.SetModeRadioImage(rImgLst.GetImage(IMG_NONE)); 772*cdf0e10cSrcweir aWrapLeftRB.SetModeRadioImage(rImgLst.GetImage(IMG_LEFT)); 773*cdf0e10cSrcweir aWrapRightRB.SetModeRadioImage(rImgLst.GetImage(IMG_RIGHT)); 774*cdf0e10cSrcweir aWrapParallelRB.SetModeRadioImage(rImgLst.GetImage(IMG_PARALLEL)); 775*cdf0e10cSrcweir aIdealWrapRB.SetModeRadioImage(rImgLst.GetImage(IMG_IDEAL)); 776*cdf0e10cSrcweir } 777*cdf0e10cSrcweir else 778*cdf0e10cSrcweir { 779*cdf0e10cSrcweir aNoWrapRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_NONE )); 780*cdf0e10cSrcweir aWrapLeftRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_LEFT )); 781*cdf0e10cSrcweir aWrapRightRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_RIGHT )); 782*cdf0e10cSrcweir aWrapParallelRB.SetModeRadioImage(rImgLst.GetImage(IMG_KON_PARALLEL )); 783*cdf0e10cSrcweir aIdealWrapRB.SetModeRadioImage(rImgLst.GetImage( IMG_KON_IDEAL )); 784*cdf0e10cSrcweir } 785*cdf0e10cSrcweir } 786