1efeef26fSAndrew Rist /**************************************************************
2*5ba3629cSmseidel *
3efeef26fSAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4efeef26fSAndrew Rist * or more contributor license agreements. See the NOTICE file
5efeef26fSAndrew Rist * distributed with this work for additional information
6efeef26fSAndrew Rist * regarding copyright ownership. The ASF licenses this file
7efeef26fSAndrew Rist * to you under the Apache License, Version 2.0 (the
8efeef26fSAndrew Rist * "License"); you may not use this file except in compliance
9efeef26fSAndrew Rist * with the License. You may obtain a copy of the License at
10*5ba3629cSmseidel *
11efeef26fSAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0
12*5ba3629cSmseidel *
13efeef26fSAndrew Rist * Unless required by applicable law or agreed to in writing,
14efeef26fSAndrew Rist * software distributed under the License is distributed on an
15efeef26fSAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16efeef26fSAndrew Rist * KIND, either express or implied. See the License for the
17efeef26fSAndrew Rist * specific language governing permissions and limitations
18efeef26fSAndrew Rist * under the License.
19*5ba3629cSmseidel *
20efeef26fSAndrew Rist *************************************************************/
21efeef26fSAndrew Rist
22efeef26fSAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_sw.hxx"
26cdf0e10cSrcweir
27cdf0e10cSrcweir #ifdef SW_DLLIMPLEMENTATION
28cdf0e10cSrcweir #undef SW_DLLIMPLEMENTATION
29cdf0e10cSrcweir #endif
30cdf0e10cSrcweir
31cdf0e10cSrcweir #ifndef _SVSTDARR_HXX
32cdf0e10cSrcweir #define _SVSTDARR_STRINGSDTOR
33cdf0e10cSrcweir #include <svl/svstdarr.hxx>
34cdf0e10cSrcweir #endif
35cdf0e10cSrcweir
36cdf0e10cSrcweir #include <optpage.hxx>
37cdf0e10cSrcweir #include <doc.hxx>
38cdf0e10cSrcweir #include <hintids.hxx>
39cdf0e10cSrcweir #include <cmdid.h>
40cdf0e10cSrcweir #include <fmtcol.hxx>
41cdf0e10cSrcweir #include <charatr.hxx>
42cdf0e10cSrcweir #include <swtypes.hxx>
43cdf0e10cSrcweir #include <view.hxx>
44cdf0e10cSrcweir #include <docsh.hxx>
45cdf0e10cSrcweir #include <IDocumentDeviceAccess.hxx>
46cdf0e10cSrcweir #include <swmodule.hxx>
47cdf0e10cSrcweir #include <wrtsh.hxx>
48cdf0e10cSrcweir #include <uitool.hxx>
49cdf0e10cSrcweir #include <cfgitems.hxx>
50cdf0e10cSrcweir #include <poolfmt.hxx>
51cdf0e10cSrcweir #include <uiitems.hxx>
52cdf0e10cSrcweir #include <initui.hxx>
53cdf0e10cSrcweir #include <printdata.hxx>
54cdf0e10cSrcweir #include <modcfg.hxx>
55cdf0e10cSrcweir #include <srcview.hxx>
56cdf0e10cSrcweir #include <crstate.hxx>
57cdf0e10cSrcweir #include <viewopt.hxx>
58cdf0e10cSrcweir #include <globals.hrc>
59cdf0e10cSrcweir #include <config.hrc>
60cdf0e10cSrcweir #include <redlopt.hrc>
61cdf0e10cSrcweir #include <optdlg.hrc>
62cdf0e10cSrcweir #include <swwrtshitem.hxx>
63cdf0e10cSrcweir #include <unomid.h>
64cdf0e10cSrcweir
65cdf0e10cSrcweir #include <editeng/fhgtitem.hxx>
66cdf0e10cSrcweir #include <editeng/fontitem.hxx>
67cdf0e10cSrcweir #include <editeng/langitem.hxx>
68cdf0e10cSrcweir #include <sfx2/request.hxx>
69cdf0e10cSrcweir #include <sfx2/printer.hxx>
70cdf0e10cSrcweir #include <sfx2/bindings.hxx>
71cdf0e10cSrcweir #include <svl/slstitm.hxx>
72cdf0e10cSrcweir #include <svl/ctloptions.hxx>
73cdf0e10cSrcweir #include <svl/eitem.hxx>
74cdf0e10cSrcweir #include <svl/cjkoptions.hxx>
75cdf0e10cSrcweir #include <svtools/ctrltool.hxx>
76cdf0e10cSrcweir #include <svx/htmlmode.hxx>
77cdf0e10cSrcweir #include <svx/xtable.hxx>
78cdf0e10cSrcweir #include <svx/dlgutil.hxx>
79cdf0e10cSrcweir #include <svx/strarray.hxx>
80cdf0e10cSrcweir #include <vcl/svapp.hxx>
81cdf0e10cSrcweir
82cdf0e10cSrcweir
83cdf0e10cSrcweir
84cdf0e10cSrcweir using namespace ::com::sun::star;
85cdf0e10cSrcweir
86cdf0e10cSrcweir
87cdf0e10cSrcweir /*******************************************************
88cdf0e10cSrcweir ******************************************************/
89cdf0e10cSrcweir
90cdf0e10cSrcweir /*-----------------31.08.96 10.16-------------------
91cdf0e10cSrcweir TabPage Anzeige/Inhalt
92cdf0e10cSrcweir --------------------------------------------------*/
93cdf0e10cSrcweir
SwContentOptPage(Window * pParent,const SfxItemSet & rCoreSet)94cdf0e10cSrcweir SwContentOptPage::SwContentOptPage( Window* pParent,
95cdf0e10cSrcweir const SfxItemSet& rCoreSet ) :
96cdf0e10cSrcweir SfxTabPage( pParent, SW_RES( TP_CONTENT_OPT ), rCoreSet ),
97cdf0e10cSrcweir aLineFL ( this, SW_RES( FL_LINE ) ),
98cdf0e10cSrcweir aCrossCB ( this, SW_RES( CB_CROSS ) ),
99cdf0e10cSrcweir aBigHandleCB ( this, SW_RES( CB_BIGHANDLE) ),
100cdf0e10cSrcweir
101cdf0e10cSrcweir aWindowFL ( this, SW_RES( FL_WINDOW ) ),
102cdf0e10cSrcweir aHScrollBox ( this, SW_RES( CB_HSCROLL ) ),
103cdf0e10cSrcweir aVScrollBox ( this, SW_RES( CB_VSCROLL ) ),
104cdf0e10cSrcweir aAnyRulerCB ( this, SW_RES( CB_ANY_RULER ) ),
105cdf0e10cSrcweir aHRulerCBox ( this, SW_RES( CB_HRULER ) ),
106cdf0e10cSrcweir aHMetric ( this, SW_RES( LB_HMETRIC ) ),
107cdf0e10cSrcweir aVRulerCBox ( this, SW_RES( CB_VRULER ) ),
108cdf0e10cSrcweir aVRulerRightCBox( this, SW_RES( CB_VRULER_RIGHT ) ),
109cdf0e10cSrcweir aVMetric ( this, SW_RES( LB_VMETRIC ) ),
110cdf0e10cSrcweir aSmoothCBox ( this, SW_RES( CB_SMOOTH_SCROLL ) ),
111cdf0e10cSrcweir
112cdf0e10cSrcweir aDispFL ( this, SW_RES( FL_DISP ) ),
113cdf0e10cSrcweir aGrfCB ( this, SW_RES( CB_GRF ) ),
114cdf0e10cSrcweir aTblCB ( this, SW_RES( CB_TBL ) ),
115cdf0e10cSrcweir aDrwCB ( this, SW_RES( CB_DRWFAST ) ),
116cdf0e10cSrcweir aFldNameCB ( this, SW_RES( CB_FIELD ) ),
117cdf0e10cSrcweir aPostItCB ( this, SW_RES( CB_POSTIT ) ),
118cdf0e10cSrcweir
119cdf0e10cSrcweir aSettingsFL ( this, SW_RES( FL_SETTINGS ) ),
120cdf0e10cSrcweir aMetricFT ( this, SW_RES( FT_METRIC ) ),
121cdf0e10cSrcweir aMetricLB ( this, SW_RES( LB_METRIC ) )
122cdf0e10cSrcweir {
123cdf0e10cSrcweir FreeResource();
124cdf0e10cSrcweir const SfxPoolItem* pItem;
125cdf0e10cSrcweir if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_HTML_MODE, sal_False, &pItem )
126cdf0e10cSrcweir && ((SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON)
127cdf0e10cSrcweir {
128cdf0e10cSrcweir aMetricLB.Show();
129cdf0e10cSrcweir aSettingsFL.Show();
130cdf0e10cSrcweir aMetricFT.Show();
131cdf0e10cSrcweir }
132cdf0e10cSrcweir SvtCJKOptions aCJKOptions;
133cdf0e10cSrcweir if(aCJKOptions.IsVerticalTextEnabled() )
134cdf0e10cSrcweir {
135cdf0e10cSrcweir Point aSmoothPos(aSmoothCBox.GetPosPixel());
136cdf0e10cSrcweir aSmoothPos.Y() += aSmoothPos.Y() - aVRulerCBox.GetPosPixel().Y();
137cdf0e10cSrcweir aSmoothCBox.SetPosPixel(aSmoothPos);
138cdf0e10cSrcweir }
139cdf0e10cSrcweir else
140cdf0e10cSrcweir aVRulerRightCBox.Hide();
141cdf0e10cSrcweir aVRulerCBox.SetClickHdl(LINK(this, SwContentOptPage, VertRulerHdl ));
142cdf0e10cSrcweir aAnyRulerCB.SetClickHdl(LINK(this, SwContentOptPage, AnyRulerHdl));
143cdf0e10cSrcweir
144cdf0e10cSrcweir SvxStringArray aMetricArr( SW_RES( STR_ARR_METRIC ) );
145cdf0e10cSrcweir for ( sal_uInt16 i = 0; i < aMetricArr.Count(); ++i )
146cdf0e10cSrcweir {
147cdf0e10cSrcweir String sMetric = aMetricArr.GetStringByPos( i );
148cdf0e10cSrcweir FieldUnit eFUnit = (FieldUnit)aMetricArr.GetValue( i );
149cdf0e10cSrcweir
150cdf0e10cSrcweir switch ( eFUnit )
151cdf0e10cSrcweir {
152cdf0e10cSrcweir case FUNIT_MM:
153cdf0e10cSrcweir case FUNIT_CM:
154cdf0e10cSrcweir case FUNIT_POINT:
155cdf0e10cSrcweir case FUNIT_PICA:
156cdf0e10cSrcweir case FUNIT_INCH:
157cdf0e10cSrcweir {
158cdf0e10cSrcweir // nur diese Metriken benutzen
159cdf0e10cSrcweir sal_uInt16 nPos = aMetricLB.InsertEntry( sMetric );
160cdf0e10cSrcweir aMetricLB.SetEntryData( nPos, (void*)(long)eFUnit );
161cdf0e10cSrcweir aVMetric.InsertEntry( sMetric );
162cdf0e10cSrcweir aVMetric.SetEntryData( nPos, (void*)(long)eFUnit );
163cdf0e10cSrcweir aHMetric.InsertEntry( sMetric );
164cdf0e10cSrcweir aHMetric.SetEntryData( nPos, (void*)(long)eFUnit );
165cdf0e10cSrcweir }
166cdf0e10cSrcweir default:;//prevent warning
167cdf0e10cSrcweir }
168cdf0e10cSrcweir }
169cdf0e10cSrcweir }
170cdf0e10cSrcweir
171cdf0e10cSrcweir /*-----------------31.08.96 13.58-------------------
172cdf0e10cSrcweir
173cdf0e10cSrcweir --------------------------------------------------*/
~SwContentOptPage()174cdf0e10cSrcweir SwContentOptPage::~SwContentOptPage()
175cdf0e10cSrcweir {
176cdf0e10cSrcweir }
177cdf0e10cSrcweir
178cdf0e10cSrcweir /*-----------------31.08.96 13.58-------------------
179cdf0e10cSrcweir
180cdf0e10cSrcweir --------------------------------------------------*/
Create(Window * pParent,const SfxItemSet & rAttrSet)181cdf0e10cSrcweir SfxTabPage* SwContentOptPage::Create( Window* pParent,
182cdf0e10cSrcweir const SfxItemSet& rAttrSet)
183cdf0e10cSrcweir {
184cdf0e10cSrcweir return new SwContentOptPage(pParent, rAttrSet);
185cdf0e10cSrcweir }
186cdf0e10cSrcweir /* -----------------------------07.04.01 16:57--------------------------------
187cdf0e10cSrcweir
188cdf0e10cSrcweir ---------------------------------------------------------------------------*/
lcl_SelectMetricLB(ListBox & rMetric,sal_uInt16 nSID,const SfxItemSet & rSet)189cdf0e10cSrcweir static void lcl_SelectMetricLB(ListBox& rMetric, sal_uInt16 nSID, const SfxItemSet& rSet)
190cdf0e10cSrcweir {
191cdf0e10cSrcweir const SfxPoolItem* pItem;
192cdf0e10cSrcweir if( rSet.GetItemState( nSID, sal_False, &pItem ) >= SFX_ITEM_AVAILABLE )
193cdf0e10cSrcweir {
194cdf0e10cSrcweir FieldUnit eFieldUnit = (FieldUnit)((SfxUInt16Item*)pItem)->GetValue();
195cdf0e10cSrcweir for ( sal_uInt16 i = 0; i < rMetric.GetEntryCount(); ++i )
196cdf0e10cSrcweir {
197cdf0e10cSrcweir if ( (int)(sal_IntPtr)rMetric.GetEntryData( i ) == (int)eFieldUnit )
198cdf0e10cSrcweir {
199cdf0e10cSrcweir rMetric.SelectEntryPos( i );
200cdf0e10cSrcweir break;
201cdf0e10cSrcweir }
202cdf0e10cSrcweir }
203cdf0e10cSrcweir }
204cdf0e10cSrcweir rMetric.SaveValue();
205cdf0e10cSrcweir }
206cdf0e10cSrcweir /*-----------------31.08.96 13.58-------------------
207cdf0e10cSrcweir
208cdf0e10cSrcweir --------------------------------------------------*/
Reset(const SfxItemSet & rSet)209cdf0e10cSrcweir void SwContentOptPage::Reset(const SfxItemSet& rSet)
210cdf0e10cSrcweir {
211cdf0e10cSrcweir const SwElemItem* pElemAttr = 0;
212cdf0e10cSrcweir
213cdf0e10cSrcweir rSet.GetItemState( FN_PARAM_ELEM , sal_False,
214cdf0e10cSrcweir (const SfxPoolItem**)&pElemAttr );
215cdf0e10cSrcweir if(pElemAttr)
216cdf0e10cSrcweir {
217cdf0e10cSrcweir aTblCB .Check (pElemAttr->bTable );
218cdf0e10cSrcweir aGrfCB .Check (pElemAttr->bGraphic );
219cdf0e10cSrcweir aDrwCB .Check (pElemAttr->bDrawing );
220cdf0e10cSrcweir aFldNameCB .Check (pElemAttr->bFieldName );
221cdf0e10cSrcweir aPostItCB .Check (pElemAttr->bNotes );
222cdf0e10cSrcweir aCrossCB .Check( pElemAttr->bCrosshair );
223cdf0e10cSrcweir aBigHandleCB.Check(pElemAttr->bBigHandles );
224cdf0e10cSrcweir aHScrollBox.Check( pElemAttr->bHorzScrollbar );
225cdf0e10cSrcweir aVScrollBox.Check( pElemAttr->bVertScrollbar );
226cdf0e10cSrcweir aAnyRulerCB.Check( pElemAttr->bAnyRuler );
227cdf0e10cSrcweir aHRulerCBox.Check( pElemAttr->bHorzRuler );
228cdf0e10cSrcweir aVRulerCBox.Check( pElemAttr->bVertRuler );
229cdf0e10cSrcweir aVRulerRightCBox.Check(pElemAttr->bVertRulerRight);
230cdf0e10cSrcweir aSmoothCBox.Check( pElemAttr->bSmoothScroll );
231cdf0e10cSrcweir }
232cdf0e10cSrcweir aMetricLB.SetNoSelection();
233cdf0e10cSrcweir lcl_SelectMetricLB(aMetricLB, SID_ATTR_METRIC, rSet);
234cdf0e10cSrcweir lcl_SelectMetricLB(aHMetric, FN_HSCROLL_METRIC, rSet);
235cdf0e10cSrcweir lcl_SelectMetricLB(aVMetric, FN_VSCROLL_METRIC, rSet);
236cdf0e10cSrcweir AnyRulerHdl(&aAnyRulerCB);
237cdf0e10cSrcweir }
238cdf0e10cSrcweir
239cdf0e10cSrcweir /*-----------------31.08.96 13.58-------------------
240cdf0e10cSrcweir
241cdf0e10cSrcweir --------------------------------------------------*/
FillItemSet(SfxItemSet & rSet)242cdf0e10cSrcweir sal_Bool SwContentOptPage::FillItemSet(SfxItemSet& rSet)
243cdf0e10cSrcweir {
244cdf0e10cSrcweir const SwElemItem* pOldAttr = (const SwElemItem*)
245cdf0e10cSrcweir GetOldItem(GetItemSet(), FN_PARAM_ELEM);
246cdf0e10cSrcweir
247cdf0e10cSrcweir SwElemItem aElem;
248cdf0e10cSrcweir if(pOldAttr)
249cdf0e10cSrcweir aElem = *pOldAttr;
250cdf0e10cSrcweir aElem.bTable = aTblCB .IsChecked();
251cdf0e10cSrcweir aElem.bGraphic = aGrfCB .IsChecked();
252cdf0e10cSrcweir aElem.bDrawing = aDrwCB .IsChecked();
253cdf0e10cSrcweir aElem.bFieldName = aFldNameCB .IsChecked();
254cdf0e10cSrcweir aElem.bNotes = aPostItCB .IsChecked();
255cdf0e10cSrcweir aElem.bCrosshair = aCrossCB .IsChecked();
256cdf0e10cSrcweir aElem.bBigHandles = aBigHandleCB.IsChecked();
257cdf0e10cSrcweir aElem.bHorzScrollbar = aHScrollBox.IsChecked();
258cdf0e10cSrcweir aElem.bVertScrollbar = aVScrollBox.IsChecked();
259cdf0e10cSrcweir aElem.bAnyRuler = aAnyRulerCB.IsChecked();
260cdf0e10cSrcweir aElem.bHorzRuler = aHRulerCBox.IsChecked();
261cdf0e10cSrcweir aElem.bVertRuler = aVRulerCBox.IsChecked();
262cdf0e10cSrcweir aElem.bVertRulerRight= aVRulerRightCBox.IsChecked();
263cdf0e10cSrcweir aElem.bSmoothScroll = aSmoothCBox.IsChecked();
264cdf0e10cSrcweir
265cdf0e10cSrcweir
266cdf0e10cSrcweir sal_Bool bRet = !pOldAttr || aElem != *pOldAttr;
267cdf0e10cSrcweir if(bRet)
268cdf0e10cSrcweir bRet = 0 != rSet.Put(aElem);
269cdf0e10cSrcweir sal_uInt16 nMPos = aMetricLB.GetSelectEntryPos();
270cdf0e10cSrcweir sal_uInt16 nGlobalMetricPos = nMPos;
271cdf0e10cSrcweir if ( nMPos != aMetricLB.GetSavedValue() )
272cdf0e10cSrcweir {
273cdf0e10cSrcweir // Doppel-Cast fuer VA3.0
274cdf0e10cSrcweir sal_uInt16 nFieldUnit = (sal_uInt16)(long)aMetricLB.GetEntryData( nMPos );
275cdf0e10cSrcweir rSet.Put( SfxUInt16Item( SID_ATTR_METRIC, (sal_uInt16)nFieldUnit ) );
276cdf0e10cSrcweir bRet = sal_True;
277cdf0e10cSrcweir }
278cdf0e10cSrcweir
279cdf0e10cSrcweir nMPos = aHMetric.GetSelectEntryPos();
280cdf0e10cSrcweir if ( nMPos != aHMetric.GetSavedValue() || nMPos != nGlobalMetricPos )
281cdf0e10cSrcweir {
282cdf0e10cSrcweir // Doppel-Cast fuer VA3.0
283cdf0e10cSrcweir sal_uInt16 nFieldUnit = (sal_uInt16)(long)aHMetric.GetEntryData( nMPos );
284cdf0e10cSrcweir rSet.Put( SfxUInt16Item( FN_HSCROLL_METRIC, (sal_uInt16)nFieldUnit ) );
285cdf0e10cSrcweir bRet = sal_True;
286cdf0e10cSrcweir }
287cdf0e10cSrcweir nMPos = aVMetric.GetSelectEntryPos();
288cdf0e10cSrcweir if ( nMPos != aVMetric.GetSavedValue() || nMPos != nGlobalMetricPos )
289cdf0e10cSrcweir {
290cdf0e10cSrcweir // Doppel-Cast fuer VA3.0
291cdf0e10cSrcweir sal_uInt16 nFieldUnit = (sal_uInt16)(long)aVMetric.GetEntryData( nMPos );
292cdf0e10cSrcweir rSet.Put( SfxUInt16Item( FN_VSCROLL_METRIC, (sal_uInt16)nFieldUnit ) );
293cdf0e10cSrcweir bRet = sal_True;
294cdf0e10cSrcweir }
295cdf0e10cSrcweir return bRet;
296cdf0e10cSrcweir }
297cdf0e10cSrcweir /* -----------------------------05.03.2002 15:07------------------------------
298cdf0e10cSrcweir
299cdf0e10cSrcweir ---------------------------------------------------------------------------*/
IMPL_LINK(SwContentOptPage,VertRulerHdl,CheckBox *,pBox)300cdf0e10cSrcweir IMPL_LINK(SwContentOptPage, VertRulerHdl, CheckBox*, pBox)
301cdf0e10cSrcweir {
302cdf0e10cSrcweir aVRulerRightCBox.Enable(pBox->IsEnabled() && pBox->IsChecked());
303cdf0e10cSrcweir return 0;
304cdf0e10cSrcweir }
305cdf0e10cSrcweir /* -----------------20.09.2002 11:30-----------------
306cdf0e10cSrcweir *
307cdf0e10cSrcweir * --------------------------------------------------*/
IMPL_LINK(SwContentOptPage,AnyRulerHdl,CheckBox *,pBox)308cdf0e10cSrcweir IMPL_LINK( SwContentOptPage, AnyRulerHdl, CheckBox*, pBox)
309cdf0e10cSrcweir {
310cdf0e10cSrcweir sal_Bool bChecked = pBox->IsChecked();
311cdf0e10cSrcweir aHRulerCBox .Enable(bChecked);
312cdf0e10cSrcweir aHMetric .Enable(bChecked);
313cdf0e10cSrcweir aVRulerCBox .Enable(bChecked);
314cdf0e10cSrcweir aVMetric .Enable(bChecked);
315cdf0e10cSrcweir VertRulerHdl(&aVRulerCBox);
316cdf0e10cSrcweir return 0;
317cdf0e10cSrcweir }
318cdf0e10cSrcweir /*----------------- OS 27.01.95 -----------------------
319cdf0e10cSrcweir TabPage Drucker Zusatzeinstellungen
320cdf0e10cSrcweir -------------------------------------------------------*/
SwAddPrinterTabPage(Window * pParent,const SfxItemSet & rCoreSet)321cdf0e10cSrcweir SwAddPrinterTabPage::SwAddPrinterTabPage( Window* pParent,
322cdf0e10cSrcweir const SfxItemSet& rCoreSet) :
323cdf0e10cSrcweir SfxTabPage( pParent, SW_RES( TP_OPTPRINT_PAGE ), rCoreSet),
324cdf0e10cSrcweir aFL1 (this, SW_RES(FL_1)),
325cdf0e10cSrcweir aGrfCB (this, SW_RES(CB_PGRF)),
326cdf0e10cSrcweir // aTabCB (this, SW_RES(CB_PTAB)),
327cdf0e10cSrcweir // aDrawCB (this, SW_RES(CB_PDRAW)),
328cdf0e10cSrcweir aCtrlFldCB (this, SW_RES(CB_CTRLFLD)),
329cdf0e10cSrcweir aBackgroundCB (this, SW_RES(CB_BACKGROUND)),
330cdf0e10cSrcweir aBlackFontCB (this, SW_RES(CB_BLACK_FONT)),
331cdf0e10cSrcweir aPrintHiddenTextCB(this, SW_RES(CB_HIDDEN_TEXT)),
332cdf0e10cSrcweir aPrintTextPlaceholderCB(this, SW_RES(CB_TEXT_PLACEHOLDER)),
333cdf0e10cSrcweir aSeparatorLFL (this, SW_RES(FL_SEP_PRT_LEFT )),
334cdf0e10cSrcweir aFL2 (this, SW_RES(FL_2)),
335cdf0e10cSrcweir aLeftPageCB (this, SW_RES(CB_LEFTP)),
336cdf0e10cSrcweir aRightPageCB (this, SW_RES(CB_RIGHTP)),
337cdf0e10cSrcweir // aReverseCB (this, SW_RES(CB_REVERSE)),
338cdf0e10cSrcweir aProspectCB (this, SW_RES(CB_PROSPECT)),
339cdf0e10cSrcweir aProspectCB_RTL (this, SW_RES(CB_PROSPECT_RTL)),
340cdf0e10cSrcweir aSeparatorRFL (this, SW_RES(FL_SEP_PRT_RIGHT)),
341cdf0e10cSrcweir aFL3 (this, SW_RES(FL_3)),
342cdf0e10cSrcweir aNoRB (this, SW_RES(RB_NO)),
343cdf0e10cSrcweir aOnlyRB (this, SW_RES(RB_ONLY)),
344cdf0e10cSrcweir aEndRB (this, SW_RES(RB_END)),
345cdf0e10cSrcweir aEndPageRB (this, SW_RES(RB_PAGEEND)),
346cdf0e10cSrcweir aFL4 (this, SW_RES(FL_4)),
347cdf0e10cSrcweir aPrintEmptyPagesCB(this, SW_RES(CB_PRINTEMPTYPAGES)),
348cdf0e10cSrcweir // aSingleJobsCB (this, SW_RES(CB_SINGLEJOBS)),
349cdf0e10cSrcweir aPaperFromSetupCB(this, SW_RES(CB_PAPERFROMSETUP)),
350cdf0e10cSrcweir aFaxFT (this, SW_RES(FT_FAX)),
351cdf0e10cSrcweir aFaxLB (this, SW_RES(LB_FAX)),
352cdf0e10cSrcweir sNone(SW_RES(ST_NONE)),
353cdf0e10cSrcweir bAttrModified( sal_False ),
354cdf0e10cSrcweir bPreview ( sal_False )
355cdf0e10cSrcweir {
356cdf0e10cSrcweir Init();
357cdf0e10cSrcweir FreeResource();
358cdf0e10cSrcweir Link aLk = LINK( this, SwAddPrinterTabPage, AutoClickHdl);
359cdf0e10cSrcweir aGrfCB.SetClickHdl( aLk );
360cdf0e10cSrcweir aRightPageCB.SetClickHdl( aLk );
361cdf0e10cSrcweir aLeftPageCB.SetClickHdl( aLk );
362cdf0e10cSrcweir // aTabCB.SetClickHdl( aLk );
363cdf0e10cSrcweir // aDrawCB.SetClickHdl( aLk );
364cdf0e10cSrcweir aCtrlFldCB.SetClickHdl( aLk );
365cdf0e10cSrcweir aBackgroundCB.SetClickHdl( aLk );
366cdf0e10cSrcweir aBlackFontCB.SetClickHdl( aLk );
367cdf0e10cSrcweir aPrintHiddenTextCB.SetClickHdl( aLk );
368cdf0e10cSrcweir aPrintTextPlaceholderCB.SetClickHdl( aLk );
369cdf0e10cSrcweir // aReverseCB.SetClickHdl( aLk );
370cdf0e10cSrcweir aProspectCB.SetClickHdl( aLk );
371cdf0e10cSrcweir aProspectCB_RTL.SetClickHdl( aLk );
372cdf0e10cSrcweir aPaperFromSetupCB.SetClickHdl( aLk );
373cdf0e10cSrcweir aPrintEmptyPagesCB.SetClickHdl( aLk );
374cdf0e10cSrcweir aEndPageRB.SetClickHdl( aLk );
375cdf0e10cSrcweir aEndRB.SetClickHdl( aLk );
376cdf0e10cSrcweir aOnlyRB.SetClickHdl( aLk );
377cdf0e10cSrcweir aNoRB.SetClickHdl( aLk );
378cdf0e10cSrcweir // aSingleJobsCB.SetClickHdl( aLk );
379cdf0e10cSrcweir aFaxLB.SetSelectHdl( LINK( this, SwAddPrinterTabPage, SelectHdl ) );
380cdf0e10cSrcweir
381cdf0e10cSrcweir const SfxPoolItem* pItem;
382cdf0e10cSrcweir if(SFX_ITEM_SET == rCoreSet.GetItemState(SID_HTML_MODE, sal_False, &pItem )
383cdf0e10cSrcweir && ((SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON)
384cdf0e10cSrcweir {
385cdf0e10cSrcweir // aDrawCB .Hide();
386cdf0e10cSrcweir aLeftPageCB .Hide();
387cdf0e10cSrcweir aRightPageCB .Hide();
388cdf0e10cSrcweir aPrintHiddenTextCB.Hide();
389cdf0e10cSrcweir aPrintTextPlaceholderCB.Hide();
390cdf0e10cSrcweir // aReverseCB.SetPosPixel(aLeftPageCB.GetPosPixel());
391cdf0e10cSrcweir aProspectCB.SetPosPixel(aLeftPageCB.GetPosPixel());
392cdf0e10cSrcweir Point aPt( aRightPageCB.GetPosPixel() );
393cdf0e10cSrcweir aPt.setX(aPt.getX() + 15); // indent
394cdf0e10cSrcweir aProspectCB_RTL.SetPosPixel(aPt);
395cdf0e10cSrcweir // aBlackFontCB.SetPosPixel(aBackgroundCB.GetPosPixel());
396cdf0e10cSrcweir // aPrintHiddenTextCB.SetPosPixel(aBlackFontCB.GetPosPixel());
397cdf0e10cSrcweir // aBackgroundCB.SetPosPixel(aCtrlFldCB.GetPosPixel());
398cdf0e10cSrcweir // aCtrlFldCB.SetPosPixel(aDrawCB.GetPosPixel());
399*5ba3629cSmseidel
400cdf0e10cSrcweir // hide aPrintEmptyPagesCB and move everything below up accordingly
401cdf0e10cSrcweir long nDeltaY = aPaperFromSetupCB.GetPosPixel().getY() - aPrintEmptyPagesCB.GetPosPixel().getY();
402cdf0e10cSrcweir aPrintEmptyPagesCB.Hide();
403cdf0e10cSrcweir aPt = aPaperFromSetupCB.GetPosPixel();
404cdf0e10cSrcweir aPt.setY( aPt.getY() - nDeltaY );
405cdf0e10cSrcweir aPaperFromSetupCB.SetPosPixel( aPt );
406cdf0e10cSrcweir aPt = aFaxFT.GetPosPixel();
407cdf0e10cSrcweir aPt.setY( aPt.getY() - nDeltaY );
408cdf0e10cSrcweir aFaxFT.SetPosPixel( aPt );
409cdf0e10cSrcweir aPt = aFaxLB.GetPosPixel();
410cdf0e10cSrcweir aPt.setY( aPt.getY() - nDeltaY );
411cdf0e10cSrcweir aFaxLB.SetPosPixel( aPt );
412cdf0e10cSrcweir }
413cdf0e10cSrcweir aProspectCB_RTL.Disable();
414cdf0e10cSrcweir SvtCTLOptions aCTLOptions;
415cdf0e10cSrcweir aProspectCB_RTL.Show(aCTLOptions.IsCTLFontEnabled());
416cdf0e10cSrcweir }
417cdf0e10cSrcweir
418cdf0e10cSrcweir //------------------------------------------------------------------------
419cdf0e10cSrcweir
SetPreview(sal_Bool bPrev)420cdf0e10cSrcweir void SwAddPrinterTabPage::SetPreview(sal_Bool bPrev)
421cdf0e10cSrcweir {
422cdf0e10cSrcweir bPreview = bPrev;
423cdf0e10cSrcweir
424cdf0e10cSrcweir if (bPreview)
425cdf0e10cSrcweir {
426cdf0e10cSrcweir aLeftPageCB.Disable();
427cdf0e10cSrcweir aRightPageCB.Disable();
428cdf0e10cSrcweir aProspectCB.Disable();
429cdf0e10cSrcweir aProspectCB_RTL.Disable();
430cdf0e10cSrcweir aFL3.Disable();
431cdf0e10cSrcweir aNoRB.Disable();
432cdf0e10cSrcweir aOnlyRB.Disable();
433cdf0e10cSrcweir aEndRB.Disable();
434cdf0e10cSrcweir aEndPageRB.Disable();
435cdf0e10cSrcweir }
436cdf0e10cSrcweir }
437cdf0e10cSrcweir
438cdf0e10cSrcweir //------------------------------------------------------------------------
439cdf0e10cSrcweir
Create(Window * pParent,const SfxItemSet & rAttrSet)440cdf0e10cSrcweir SfxTabPage* SwAddPrinterTabPage::Create( Window* pParent,
441cdf0e10cSrcweir const SfxItemSet& rAttrSet )
442cdf0e10cSrcweir {
443cdf0e10cSrcweir return ( new SwAddPrinterTabPage( pParent, rAttrSet ) );
444cdf0e10cSrcweir }
445cdf0e10cSrcweir //------------------------------------------------------------------------
446cdf0e10cSrcweir
447cdf0e10cSrcweir
FillItemSet(SfxItemSet & rCoreSet)448cdf0e10cSrcweir sal_Bool SwAddPrinterTabPage::FillItemSet( SfxItemSet& rCoreSet )
449cdf0e10cSrcweir {
450cdf0e10cSrcweir if ( bAttrModified )
451cdf0e10cSrcweir {
452cdf0e10cSrcweir SwAddPrinterItem aAddPrinterAttr (FN_PARAM_ADDPRINTER);
453cdf0e10cSrcweir aAddPrinterAttr.bPrintGraphic = aGrfCB.IsChecked();
454cdf0e10cSrcweir aAddPrinterAttr.bPrintTable = sal_True; // always enabled since CWS printerpullgpages /*aTabCB.IsChecked();*/
455cdf0e10cSrcweir aAddPrinterAttr.bPrintDraw = aGrfCB.IsChecked(); // UI merged with aGrfCB in CWS printerpullgpages /*aDrawCB.IsChecked()*/;
456cdf0e10cSrcweir aAddPrinterAttr.bPrintControl = aCtrlFldCB.IsChecked();
457cdf0e10cSrcweir aAddPrinterAttr.bPrintPageBackground = aBackgroundCB.IsChecked();
458cdf0e10cSrcweir aAddPrinterAttr.bPrintBlackFont = aBlackFontCB.IsChecked();
459cdf0e10cSrcweir aAddPrinterAttr.bPrintHiddenText = aPrintHiddenTextCB.IsChecked();
460cdf0e10cSrcweir aAddPrinterAttr.bPrintTextPlaceholder = aPrintTextPlaceholderCB.IsChecked();
461cdf0e10cSrcweir
462cdf0e10cSrcweir aAddPrinterAttr.bPrintLeftPages = aLeftPageCB.IsChecked();
463cdf0e10cSrcweir aAddPrinterAttr.bPrintRightPages = aRightPageCB.IsChecked();
464cdf0e10cSrcweir aAddPrinterAttr.bPrintReverse = sal_False; // handled by vcl itself since CWS printerpullpages /*aReverseCB.IsChecked()*/;
465cdf0e10cSrcweir aAddPrinterAttr.bPrintProspect = aProspectCB.IsChecked();
466cdf0e10cSrcweir aAddPrinterAttr.bPrintProspectRTL = aProspectCB_RTL.IsChecked();
467cdf0e10cSrcweir aAddPrinterAttr.bPaperFromSetup = aPaperFromSetupCB.IsChecked();
468cdf0e10cSrcweir aAddPrinterAttr.bPrintEmptyPages = aPrintEmptyPagesCB.IsChecked();
469cdf0e10cSrcweir aAddPrinterAttr.bPrintSingleJobs = sal_True; // handled by vcl in new print dialog since CWS printerpullpages /*aSingleJobsCB.IsChecked()*/;
470cdf0e10cSrcweir
471cdf0e10cSrcweir if (aNoRB.IsChecked()) aAddPrinterAttr.nPrintPostIts =
472cdf0e10cSrcweir POSTITS_NONE;
473cdf0e10cSrcweir if (aOnlyRB.IsChecked()) aAddPrinterAttr.nPrintPostIts =
474cdf0e10cSrcweir POSTITS_ONLY;
475cdf0e10cSrcweir if (aEndRB.IsChecked()) aAddPrinterAttr.nPrintPostIts =
476cdf0e10cSrcweir POSTITS_ENDDOC;
477cdf0e10cSrcweir if (aEndPageRB.IsChecked()) aAddPrinterAttr.nPrintPostIts =
478cdf0e10cSrcweir POSTITS_ENDPAGE;
479cdf0e10cSrcweir
480cdf0e10cSrcweir String sFax = aFaxLB.GetSelectEntry();
481cdf0e10cSrcweir aAddPrinterAttr.sFaxName = sNone == sFax ? aEmptyStr : sFax;
482cdf0e10cSrcweir rCoreSet.Put(aAddPrinterAttr);
483cdf0e10cSrcweir }
484cdf0e10cSrcweir return bAttrModified;
485cdf0e10cSrcweir }
486cdf0e10cSrcweir //------------------------------------------------------------------------
487cdf0e10cSrcweir
488cdf0e10cSrcweir
Reset(const SfxItemSet &)489cdf0e10cSrcweir void SwAddPrinterTabPage::Reset( const SfxItemSet& )
490cdf0e10cSrcweir {
491cdf0e10cSrcweir const SfxItemSet& rSet = GetItemSet();
492cdf0e10cSrcweir const SwAddPrinterItem* pAddPrinterAttr = 0;
493cdf0e10cSrcweir
494cdf0e10cSrcweir if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_ADDPRINTER , sal_False,
495cdf0e10cSrcweir (const SfxPoolItem**)&pAddPrinterAttr ))
496cdf0e10cSrcweir {
497cdf0e10cSrcweir aGrfCB.Check( pAddPrinterAttr->bPrintGraphic || pAddPrinterAttr->bPrintDraw );
498cdf0e10cSrcweir // aTabCB.Check( pAddPrinterAttr->bPrintTable);
499cdf0e10cSrcweir // aDrawCB.Check( pAddPrinterAttr->bPrintDraw);
500cdf0e10cSrcweir aCtrlFldCB.Check( pAddPrinterAttr->bPrintControl);
501cdf0e10cSrcweir aBackgroundCB.Check( pAddPrinterAttr->bPrintPageBackground);
502cdf0e10cSrcweir aBlackFontCB.Check( pAddPrinterAttr->bPrintBlackFont);
503cdf0e10cSrcweir aPrintHiddenTextCB.Check( pAddPrinterAttr->bPrintHiddenText);
504cdf0e10cSrcweir aPrintTextPlaceholderCB.Check(pAddPrinterAttr->bPrintTextPlaceholder);
505cdf0e10cSrcweir aLeftPageCB.Check( pAddPrinterAttr->bPrintLeftPages);
506cdf0e10cSrcweir aRightPageCB.Check( pAddPrinterAttr->bPrintRightPages);
507cdf0e10cSrcweir // aReverseCB.Check( pAddPrinterAttr->bPrintReverse);
508cdf0e10cSrcweir aPaperFromSetupCB.Check(pAddPrinterAttr->bPaperFromSetup);
509cdf0e10cSrcweir aPrintEmptyPagesCB.Check(pAddPrinterAttr->bPrintEmptyPages);
510cdf0e10cSrcweir aProspectCB.Check( pAddPrinterAttr->bPrintProspect);
511cdf0e10cSrcweir aProspectCB_RTL.Check( pAddPrinterAttr->bPrintProspectRTL);
512cdf0e10cSrcweir // aSingleJobsCB.Check( pAddPrinterAttr->bPrintSingleJobs);
513cdf0e10cSrcweir
514cdf0e10cSrcweir aNoRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_NONE ) ;
515cdf0e10cSrcweir aOnlyRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_ONLY ) ;
516cdf0e10cSrcweir aEndRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_ENDDOC ) ;
517cdf0e10cSrcweir aEndPageRB.Check (pAddPrinterAttr->nPrintPostIts== POSTITS_ENDPAGE ) ;
518cdf0e10cSrcweir aFaxLB.SelectEntry( pAddPrinterAttr->sFaxName );
519cdf0e10cSrcweir }
520cdf0e10cSrcweir if (aProspectCB.IsChecked())
521cdf0e10cSrcweir {
522cdf0e10cSrcweir aProspectCB_RTL.Enable(sal_True);
523cdf0e10cSrcweir aNoRB.Enable( sal_False );
524cdf0e10cSrcweir aOnlyRB.Enable( sal_False );
525cdf0e10cSrcweir aEndRB.Enable( sal_False );
526cdf0e10cSrcweir aEndPageRB.Enable( sal_False );
527cdf0e10cSrcweir }
528cdf0e10cSrcweir else
529cdf0e10cSrcweir aProspectCB_RTL.Enable( sal_False );
530cdf0e10cSrcweir }
531cdf0e10cSrcweir //-----------------------------------------------------------------------
532cdf0e10cSrcweir
533cdf0e10cSrcweir
Init()534cdf0e10cSrcweir void SwAddPrinterTabPage::Init()
535cdf0e10cSrcweir {
536cdf0e10cSrcweir
537cdf0e10cSrcweir }
538cdf0e10cSrcweir //------------------------------------------------------------------------
539cdf0e10cSrcweir
540cdf0e10cSrcweir
IMPL_LINK_INLINE_START(SwAddPrinterTabPage,AutoClickHdl,CheckBox *,EMPTYARG)541cdf0e10cSrcweir IMPL_LINK_INLINE_START( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
542cdf0e10cSrcweir {
543cdf0e10cSrcweir bAttrModified = sal_True;
544cdf0e10cSrcweir bool bIsProspect = aProspectCB.IsChecked();
545cdf0e10cSrcweir if (!bIsProspect)
546cdf0e10cSrcweir aProspectCB_RTL.Check( sal_False );
547cdf0e10cSrcweir aProspectCB_RTL.Enable( bIsProspect );
548cdf0e10cSrcweir aNoRB.Enable( !bIsProspect );
549cdf0e10cSrcweir aOnlyRB.Enable( !bIsProspect );
550cdf0e10cSrcweir aEndRB.Enable( !bIsProspect );
551cdf0e10cSrcweir aEndPageRB.Enable( !bIsProspect );
552cdf0e10cSrcweir return 0;
553cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(SwAddPrinterTabPage,AutoClickHdl,CheckBox *,EMPTYARG)554cdf0e10cSrcweir IMPL_LINK_INLINE_END( SwAddPrinterTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
555cdf0e10cSrcweir
556cdf0e10cSrcweir //------------------------------------------------------------------------
557cdf0e10cSrcweir
558cdf0e10cSrcweir
559cdf0e10cSrcweir void SwAddPrinterTabPage::SetFax( const SvStringsDtor& rFaxLst )
560cdf0e10cSrcweir {
561cdf0e10cSrcweir aFaxLB.InsertEntry(sNone);
562cdf0e10cSrcweir for ( sal_uInt16 i = 0; i < rFaxLst.Count(); ++i )
563cdf0e10cSrcweir aFaxLB.InsertEntry( *rFaxLst.GetObject(i) );
564cdf0e10cSrcweir aFaxLB.SelectEntryPos(0);
565cdf0e10cSrcweir }
566cdf0e10cSrcweir
567cdf0e10cSrcweir //------------------------------------------------------------------------
568cdf0e10cSrcweir
569cdf0e10cSrcweir
IMPL_LINK_INLINE_START(SwAddPrinterTabPage,SelectHdl,ListBox *,EMPTYARG)570cdf0e10cSrcweir IMPL_LINK_INLINE_START( SwAddPrinterTabPage, SelectHdl, ListBox *, EMPTYARG )
571cdf0e10cSrcweir {
572cdf0e10cSrcweir bAttrModified=sal_True;
573cdf0e10cSrcweir return 0;
574cdf0e10cSrcweir }
IMPL_LINK_INLINE_END(SwAddPrinterTabPage,SelectHdl,ListBox *,EMPTYARG)575cdf0e10cSrcweir IMPL_LINK_INLINE_END( SwAddPrinterTabPage, SelectHdl, ListBox *, EMPTYARG )
576cdf0e10cSrcweir
577cdf0e10cSrcweir void SwAddPrinterTabPage::PageCreated (SfxAllItemSet aSet)
578cdf0e10cSrcweir {
579cdf0e10cSrcweir //SFX_ITEMSET_ARG (&aSet,pListItem,SfxStringListItem,SID_FAX_LIST,sal_False);
580cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pListItem,SfxBoolItem,SID_FAX_LIST,sal_False);
581cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pPreviewItem,SfxBoolItem,SID_PREVIEWFLAG_TYPE,sal_False);
582cdf0e10cSrcweir if (pPreviewItem)
583cdf0e10cSrcweir {
584cdf0e10cSrcweir SetPreview(pPreviewItem->GetValue());
585cdf0e10cSrcweir Reset(aSet);
586cdf0e10cSrcweir }
587cdf0e10cSrcweir if (pListItem && pListItem->GetValue())
588cdf0e10cSrcweir {
589cdf0e10cSrcweir SvStringsDtor aFaxList;
590cdf0e10cSrcweir const std::vector<rtl::OUString>& rPrinters = Printer::GetPrinterQueues();
591cdf0e10cSrcweir for (unsigned int i = 0; i < rPrinters.size(); ++i)
592cdf0e10cSrcweir {
593cdf0e10cSrcweir String* pString = new String( rPrinters[i] );
594cdf0e10cSrcweir String* &rpString = pString;
595cdf0e10cSrcweir aFaxList.Insert(rpString, 0);
596cdf0e10cSrcweir }
597cdf0e10cSrcweir SetFax( aFaxList );
598cdf0e10cSrcweir /* SvStringsDtor aFaxList;
599cdf0e10cSrcweir const List *pList = (pListItem)->GetList();
600cdf0e10cSrcweir sal_uInt32 nCount = pList->Count();
601cdf0e10cSrcweir for(sal_uInt32 i = 0; i < nCount ; i++)
602cdf0e10cSrcweir {
603cdf0e10cSrcweir String* pString = (String*)(pList->GetObject(i));
604cdf0e10cSrcweir String* &rpString = pString;
605cdf0e10cSrcweir aFaxList.Insert(rpString, 0 );
606cdf0e10cSrcweir }
607cdf0e10cSrcweir SetFax(aFaxList);
608cdf0e10cSrcweir */
609cdf0e10cSrcweir }
610cdf0e10cSrcweir }
611cdf0e10cSrcweir /*-----------------03.09.96 11.53-------------------
612cdf0e10cSrcweir Tabpage Standardfonts
613cdf0e10cSrcweir --------------------------------------------------*/
614cdf0e10cSrcweir
615cdf0e10cSrcweir
SwStdFontTabPage(Window * pParent,const SfxItemSet & rSet)616cdf0e10cSrcweir SwStdFontTabPage::SwStdFontTabPage( Window* pParent,
617cdf0e10cSrcweir const SfxItemSet& rSet ) :
618cdf0e10cSrcweir SfxTabPage( pParent, SW_RES( TP_STD_FONT ), rSet),
619cdf0e10cSrcweir aStdChrFL (this, SW_RES(FL_STDCHR )),
620cdf0e10cSrcweir aTypeFT( this, SW_RES( FT_TYPE )),
621cdf0e10cSrcweir
622cdf0e10cSrcweir aStandardLbl(this, SW_RES(FT_STANDARD)),
623cdf0e10cSrcweir aStandardBox(this, SW_RES(LB_STANDARD)),
624cdf0e10cSrcweir
625cdf0e10cSrcweir aHeightFT( this, SW_RES( FT_SIZE )),
626cdf0e10cSrcweir aStandardHeightLB(this, SW_RES( LB_STANDARD_SIZE )),
627cdf0e10cSrcweir
628cdf0e10cSrcweir aTitleLbl (this, SW_RES(FT_TITLE )),
629cdf0e10cSrcweir aTitleBox (this, SW_RES(LB_TITLE )),
630cdf0e10cSrcweir aTitleHeightLB( this, SW_RES( LB_TITLE_SIZE )),
631cdf0e10cSrcweir
632cdf0e10cSrcweir aListLbl (this, SW_RES(FT_LIST )),
633cdf0e10cSrcweir aListBox (this, SW_RES(LB_LIST )),
634cdf0e10cSrcweir aListHeightLB( this, SW_RES( LB_LIST_SIZE )),
635cdf0e10cSrcweir
636cdf0e10cSrcweir aLabelLbl (this, SW_RES(FT_LABEL )),
637cdf0e10cSrcweir aLabelBox (this, SW_RES(LB_LABEL )),
638cdf0e10cSrcweir aLabelHeightLB( this, SW_RES( LB_LABEL_SIZE )),
639cdf0e10cSrcweir
640cdf0e10cSrcweir aIdxLbl (this, SW_RES(FT_IDX )),
641cdf0e10cSrcweir aIdxBox (this, SW_RES(LB_IDX )),
642cdf0e10cSrcweir aIndexHeightLB( this, SW_RES( LB_INDEX_SIZE )),
643cdf0e10cSrcweir
644cdf0e10cSrcweir aDocOnlyCB (this, SW_RES(CB_DOCONLY )),
645cdf0e10cSrcweir aStandardPB (this, SW_RES(PB_STANDARD)),
646cdf0e10cSrcweir pPrt(0),
647cdf0e10cSrcweir pFontList(0),
648cdf0e10cSrcweir pFontConfig(0),
649cdf0e10cSrcweir pWrtShell(0),
650cdf0e10cSrcweir eLanguage( GetAppLanguage() ),
651cdf0e10cSrcweir
652cdf0e10cSrcweir bListDefault(sal_False),
653cdf0e10cSrcweir bSetListDefault(sal_True),
654cdf0e10cSrcweir bLabelDefault(sal_False),
655cdf0e10cSrcweir bSetLabelDefault(sal_True),
656cdf0e10cSrcweir bIdxDefault(sal_False),
657cdf0e10cSrcweir bSetIdxDefault(sal_True),
658cdf0e10cSrcweir bDeletePrinter(sal_False),
659cdf0e10cSrcweir
660cdf0e10cSrcweir bListHeightDefault (sal_False),
661cdf0e10cSrcweir bSetListHeightDefault (sal_False),
662cdf0e10cSrcweir bLabelHeightDefault (sal_False),
663cdf0e10cSrcweir bSetLabelHeightDefault(sal_False),
664cdf0e10cSrcweir bIndexHeightDefault (sal_False),
665cdf0e10cSrcweir bSetIndexHeightDefault (sal_False),
666cdf0e10cSrcweir
667cdf0e10cSrcweir nFontGroup(FONT_GROUP_DEFAULT),
668cdf0e10cSrcweir
669cdf0e10cSrcweir sScriptWestern(SW_RES(ST_SCRIPT_WESTERN)),
670cdf0e10cSrcweir sScriptAsian(SW_RES(ST_SCRIPT_ASIAN)),
671cdf0e10cSrcweir sScriptComplex(SW_RES(ST_SCRIPT_CTL))
672cdf0e10cSrcweir {
673cdf0e10cSrcweir FreeResource();
674cdf0e10cSrcweir aStandardPB.SetClickHdl(LINK(this, SwStdFontTabPage, StandardHdl));
675cdf0e10cSrcweir aStandardBox.SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
676cdf0e10cSrcweir aListBox .SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
677cdf0e10cSrcweir aLabelBox .SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
678cdf0e10cSrcweir aIdxBox .SetModifyHdl( LINK(this, SwStdFontTabPage, ModifyHdl));
679cdf0e10cSrcweir Link aFocusLink = LINK( this, SwStdFontTabPage, LoseFocusHdl);
680cdf0e10cSrcweir aStandardBox.SetLoseFocusHdl( aFocusLink );
681cdf0e10cSrcweir aTitleBox .SetLoseFocusHdl( aFocusLink );
682cdf0e10cSrcweir aListBox .SetLoseFocusHdl( aFocusLink );
683cdf0e10cSrcweir aLabelBox .SetLoseFocusHdl( aFocusLink );
684cdf0e10cSrcweir aIdxBox .SetLoseFocusHdl( aFocusLink );
685cdf0e10cSrcweir
686cdf0e10cSrcweir Link aModifyHeightLink( LINK( this, SwStdFontTabPage, ModifyHeightHdl));
687cdf0e10cSrcweir aStandardHeightLB.SetModifyHdl( aModifyHeightLink );
688cdf0e10cSrcweir aTitleHeightLB. SetModifyHdl( aModifyHeightLink );
689cdf0e10cSrcweir aListHeightLB. SetModifyHdl( aModifyHeightLink );
690cdf0e10cSrcweir aLabelHeightLB. SetModifyHdl( aModifyHeightLink );
691cdf0e10cSrcweir aIndexHeightLB. SetModifyHdl( aModifyHeightLink );
692cdf0e10cSrcweir
693cdf0e10cSrcweir aDocOnlyCB.Check(SW_MOD()->GetModuleConfig()->IsDefaultFontInCurrDocOnly());
694cdf0e10cSrcweir }
695cdf0e10cSrcweir
696cdf0e10cSrcweir /*-----------------03.09.96 11.53-------------------
697cdf0e10cSrcweir
698cdf0e10cSrcweir --------------------------------------------------*/
699cdf0e10cSrcweir
~SwStdFontTabPage()700cdf0e10cSrcweir SwStdFontTabPage::~SwStdFontTabPage()
701cdf0e10cSrcweir {
702cdf0e10cSrcweir if(bDeletePrinter)
703cdf0e10cSrcweir delete pPrt;
704cdf0e10cSrcweir }
705cdf0e10cSrcweir
706cdf0e10cSrcweir /*-----------------03.09.96 11.53-------------------
707cdf0e10cSrcweir
708cdf0e10cSrcweir --------------------------------------------------*/
Create(Window * pParent,const SfxItemSet & rAttrSet)709cdf0e10cSrcweir SfxTabPage* SwStdFontTabPage::Create( Window* pParent,
710cdf0e10cSrcweir const SfxItemSet& rAttrSet )
711cdf0e10cSrcweir {
712cdf0e10cSrcweir return new SwStdFontTabPage(pParent, rAttrSet);
713cdf0e10cSrcweir }
714cdf0e10cSrcweir
715cdf0e10cSrcweir /*-----------------03.09.96 11.53-------------------
716cdf0e10cSrcweir
717cdf0e10cSrcweir --------------------------------------------------*/
lcl_SetColl(SwWrtShell * pWrtShell,sal_uInt16 nType,SfxPrinter * pPrt,const String & rStyle,sal_uInt16 nFontWhich)718cdf0e10cSrcweir void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
719cdf0e10cSrcweir SfxPrinter* pPrt, const String& rStyle,
720cdf0e10cSrcweir sal_uInt16 nFontWhich)
721cdf0e10cSrcweir {
722cdf0e10cSrcweir Font aFont( rStyle, Size( 0, 10 ) );
723cdf0e10cSrcweir if( pPrt )
724cdf0e10cSrcweir aFont = pPrt->GetFontMetric( aFont );
725cdf0e10cSrcweir SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType);
726cdf0e10cSrcweir pColl->SetFmtAttr(SvxFontItem(aFont.GetFamily(), aFont.GetName(),
727cdf0e10cSrcweir aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
728cdf0e10cSrcweir }
729cdf0e10cSrcweir /*-- 11.10.2005 15:47:52---------------------------------------------------
730cdf0e10cSrcweir
731cdf0e10cSrcweir -----------------------------------------------------------------------*/
lcl_SetColl(SwWrtShell * pWrtShell,sal_uInt16 nType,sal_Int32 nHeight,sal_uInt16 nFontHeightWhich)732cdf0e10cSrcweir void lcl_SetColl(SwWrtShell* pWrtShell, sal_uInt16 nType,
733cdf0e10cSrcweir sal_Int32 nHeight, sal_uInt16 nFontHeightWhich)
734cdf0e10cSrcweir {
735cdf0e10cSrcweir float fSize = (float)nHeight / 10;
736cdf0e10cSrcweir nHeight = CalcToUnit( fSize, SFX_MAPUNIT_TWIP );
737cdf0e10cSrcweir SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(nType);
738cdf0e10cSrcweir pColl->SetFmtAttr(SvxFontHeightItem(nHeight, 100, nFontHeightWhich));
739cdf0e10cSrcweir }
740cdf0e10cSrcweir /*-----------------03.09.96 11.53-------------------
741cdf0e10cSrcweir
742cdf0e10cSrcweir --------------------------------------------------*/
FillItemSet(SfxItemSet &)743cdf0e10cSrcweir sal_Bool SwStdFontTabPage::FillItemSet( SfxItemSet& )
744cdf0e10cSrcweir {
745cdf0e10cSrcweir sal_Bool bNotDocOnly = !aDocOnlyCB.IsChecked();
746cdf0e10cSrcweir SW_MOD()->GetModuleConfig()->SetDefaultFontInCurrDocOnly(!bNotDocOnly);
747cdf0e10cSrcweir
748cdf0e10cSrcweir String sStandard = aStandardBox.GetText();
749cdf0e10cSrcweir String sTitle = aTitleBox .GetText();
750cdf0e10cSrcweir String sList = aListBox .GetText();
751cdf0e10cSrcweir String sLabel = aLabelBox .GetText();
752cdf0e10cSrcweir String sIdx = aIdxBox .GetText();
753cdf0e10cSrcweir String sStandardBak = aStandardBox.GetSavedValue();
754cdf0e10cSrcweir String sTitleBak = aTitleBox .GetSavedValue();
755cdf0e10cSrcweir String sListBak = aListBox .GetSavedValue();
756cdf0e10cSrcweir String sLabelBak = aLabelBox .GetSavedValue();
757cdf0e10cSrcweir String sIdxBak = aIdxBox .GetSavedValue();
758cdf0e10cSrcweir
759cdf0e10cSrcweir bool bStandardHeightChanged = aStandardHeightLB.GetSavedValue() != aStandardHeightLB.GetText();
760cdf0e10cSrcweir bool bTitleHeightChanged = aTitleHeightLB.GetSavedValue() != aTitleHeightLB.GetText();
761cdf0e10cSrcweir bool bListHeightChanged = aListHeightLB.GetSavedValue() != aListHeightLB.GetText() && (!bListHeightDefault || !bSetListHeightDefault );
762cdf0e10cSrcweir bool bLabelHeightChanged = aLabelHeightLB.GetSavedValue() != aLabelHeightLB.GetText() && (!bLabelHeightDefault || !bSetLabelHeightDefault );
763cdf0e10cSrcweir bool bIndexHeightChanged = aIndexHeightLB.GetSavedValue() != aIndexHeightLB.GetText() && (!bIndexHeightDefault || !bSetIndexHeightDefault );
764cdf0e10cSrcweir if(bNotDocOnly)
765cdf0e10cSrcweir {
766cdf0e10cSrcweir pFontConfig->SetFontStandard(sStandard, nFontGroup);
767cdf0e10cSrcweir pFontConfig->SetFontOutline(sTitle, nFontGroup);
768cdf0e10cSrcweir pFontConfig->SetFontList(sList, nFontGroup);
769cdf0e10cSrcweir pFontConfig->SetFontCaption(sLabel, nFontGroup);
770cdf0e10cSrcweir pFontConfig->SetFontIndex(sIdx, nFontGroup);
771cdf0e10cSrcweir if(bStandardHeightChanged)
772cdf0e10cSrcweir {
773cdf0e10cSrcweir float fSize = (float)aStandardHeightLB.GetValue() / 10;
774cdf0e10cSrcweir pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_STANDARD, nFontGroup );
775cdf0e10cSrcweir }
776cdf0e10cSrcweir if(bTitleHeightChanged)
777cdf0e10cSrcweir {
778cdf0e10cSrcweir float fSize = (float)aTitleHeightLB.GetValue() / 10;
779cdf0e10cSrcweir pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_OUTLINE, nFontGroup );
780cdf0e10cSrcweir }
781cdf0e10cSrcweir if(bListHeightChanged)
782cdf0e10cSrcweir {
783cdf0e10cSrcweir float fSize = (float)aListHeightLB.GetValue() / 10;
784cdf0e10cSrcweir pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_LIST, nFontGroup );
785cdf0e10cSrcweir }
786cdf0e10cSrcweir if(bLabelHeightChanged)
787cdf0e10cSrcweir {
788cdf0e10cSrcweir float fSize = (float)aLabelHeightLB.GetValue() / 10;
789cdf0e10cSrcweir pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_CAPTION, nFontGroup );
790cdf0e10cSrcweir }
791cdf0e10cSrcweir if(bIndexHeightChanged)
792cdf0e10cSrcweir {
793cdf0e10cSrcweir float fSize = (float)aIndexHeightLB.GetValue() / 10;
794cdf0e10cSrcweir pFontConfig->SetFontHeight( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), FONT_INDEX, nFontGroup );
795cdf0e10cSrcweir }
796cdf0e10cSrcweir }
797cdf0e10cSrcweir if(pWrtShell)
798cdf0e10cSrcweir {
799cdf0e10cSrcweir pWrtShell->StartAllAction();
800cdf0e10cSrcweir SfxPrinter* pPrinter = pWrtShell->getIDocumentDeviceAccess()->getPrinter( false );
801cdf0e10cSrcweir sal_Bool bMod = sal_False;
802cdf0e10cSrcweir sal_uInt16 nFontWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >(
803cdf0e10cSrcweir nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONT :
804cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONT : RES_CHRATR_CTL_FONT);
805cdf0e10cSrcweir sal_uInt16 nFontHeightWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >(
806cdf0e10cSrcweir nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONTSIZE :
807cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE);
808cdf0e10cSrcweir if(sStandard != sShellStd)
809cdf0e10cSrcweir {
810cdf0e10cSrcweir Font aFont( sStandard, Size( 0, 10 ) );
811cdf0e10cSrcweir if( pPrinter )
812cdf0e10cSrcweir aFont = pPrinter->GetFontMetric( aFont );
813cdf0e10cSrcweir pWrtShell->SetDefault(SvxFontItem(aFont.GetFamily(), aFont.GetName(),
814cdf0e10cSrcweir aEmptyStr, aFont.GetPitch(), aFont.GetCharSet(), nFontWhich));
815cdf0e10cSrcweir SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
816cdf0e10cSrcweir pColl->ResetFmtAttr(nFontWhich);
817cdf0e10cSrcweir // lcl_SetColl(pWrtShell, RES_POOLCOLL_STANDARD, pPrinter, sStandard);
818cdf0e10cSrcweir bMod = sal_True;
819cdf0e10cSrcweir }
820cdf0e10cSrcweir if(bStandardHeightChanged)
821cdf0e10cSrcweir {
822cdf0e10cSrcweir float fSize = (float)aStandardHeightLB.GetValue() / 10;
823cdf0e10cSrcweir pWrtShell->SetDefault(SvxFontHeightItem( CalcToUnit( fSize, SFX_MAPUNIT_TWIP ), 100, nFontHeightWhich ) );
824cdf0e10cSrcweir SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
825cdf0e10cSrcweir pColl->ResetFmtAttr(nFontHeightWhich);
826cdf0e10cSrcweir bMod = sal_True;
827cdf0e10cSrcweir }
828cdf0e10cSrcweir
829cdf0e10cSrcweir if(sTitle != sShellTitle )
830cdf0e10cSrcweir {
831cdf0e10cSrcweir lcl_SetColl(pWrtShell, RES_POOLCOLL_HEADLINE_BASE, pPrinter, sTitle, nFontWhich);
832cdf0e10cSrcweir bMod = sal_True;
833cdf0e10cSrcweir }
834cdf0e10cSrcweir if(bTitleHeightChanged)
835cdf0e10cSrcweir {
836cdf0e10cSrcweir lcl_SetColl(pWrtShell, RES_POOLCOLL_HEADLINE_BASE,
837cdf0e10cSrcweir sal::static_int_cast< sal_uInt16, sal_Int64 >(aTitleHeightLB.GetValue()), nFontHeightWhich);
838cdf0e10cSrcweir bMod = sal_True;
839cdf0e10cSrcweir }
840cdf0e10cSrcweir if(sList != sShellList && (!bListDefault || !bSetListDefault ))
841cdf0e10cSrcweir {
842cdf0e10cSrcweir lcl_SetColl(pWrtShell, RES_POOLCOLL_NUMBUL_BASE, pPrinter, sList, nFontWhich);
843cdf0e10cSrcweir bMod = sal_True;
844cdf0e10cSrcweir }
845cdf0e10cSrcweir if(bListHeightChanged)
846cdf0e10cSrcweir {
847cdf0e10cSrcweir lcl_SetColl(pWrtShell, RES_POOLCOLL_NUMBUL_BASE,
848cdf0e10cSrcweir sal::static_int_cast< sal_uInt16, sal_Int64 >(aListHeightLB.GetValue()), nFontHeightWhich);
849cdf0e10cSrcweir bMod = sal_True;
850cdf0e10cSrcweir }
851cdf0e10cSrcweir if(sLabel != sShellLabel && (!bLabelDefault || !bSetLabelDefault))
852cdf0e10cSrcweir {
853cdf0e10cSrcweir lcl_SetColl(pWrtShell, RES_POOLCOLL_LABEL, pPrinter, sLabel, nFontWhich);
854cdf0e10cSrcweir bMod = sal_True;
855cdf0e10cSrcweir }
856cdf0e10cSrcweir if(bLabelHeightChanged)
857cdf0e10cSrcweir {
858cdf0e10cSrcweir lcl_SetColl(pWrtShell, RES_POOLCOLL_LABEL,
859cdf0e10cSrcweir sal::static_int_cast< sal_uInt16, sal_Int64 >(aLabelHeightLB.GetValue()), nFontHeightWhich);
860cdf0e10cSrcweir bMod = sal_True;
861cdf0e10cSrcweir }
862cdf0e10cSrcweir if(sIdx != sShellIndex && (!bIdxDefault || !bSetIdxDefault))
863cdf0e10cSrcweir {
864cdf0e10cSrcweir lcl_SetColl(pWrtShell, RES_POOLCOLL_REGISTER_BASE, pPrinter, sIdx, nFontWhich);
865cdf0e10cSrcweir bMod = sal_True;
866cdf0e10cSrcweir }
867cdf0e10cSrcweir if(bIndexHeightChanged)
868cdf0e10cSrcweir {
869cdf0e10cSrcweir lcl_SetColl(pWrtShell, RES_POOLCOLL_REGISTER_BASE,
870cdf0e10cSrcweir sal::static_int_cast< sal_uInt16, sal_Int64 >(aIndexHeightLB.GetValue()), nFontHeightWhich);
871cdf0e10cSrcweir bMod = sal_True;
872cdf0e10cSrcweir }
873cdf0e10cSrcweir if ( bMod )
874cdf0e10cSrcweir pWrtShell->SetModified();
875cdf0e10cSrcweir pWrtShell->EndAllAction();
876cdf0e10cSrcweir }
877cdf0e10cSrcweir
878cdf0e10cSrcweir return sal_False;
879cdf0e10cSrcweir }
880cdf0e10cSrcweir
881cdf0e10cSrcweir /*-----------------03.09.96 11.53-------------------
882cdf0e10cSrcweir
883cdf0e10cSrcweir --------------------------------------------------*/
Reset(const SfxItemSet & rSet)884cdf0e10cSrcweir void SwStdFontTabPage::Reset( const SfxItemSet& rSet)
885cdf0e10cSrcweir {
886cdf0e10cSrcweir const SfxPoolItem* pLang;
887cdf0e10cSrcweir sal_uInt16 nLangSlot = nFontGroup == FONT_GROUP_DEFAULT ? SID_ATTR_LANGUAGE :
888cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? SID_ATTR_CHAR_CJK_LANGUAGE : SID_ATTR_CHAR_CTL_LANGUAGE;
889cdf0e10cSrcweir
890cdf0e10cSrcweir
891cdf0e10cSrcweir if( SFX_ITEM_SET == rSet.GetItemState(nLangSlot, sal_False, &pLang))
892cdf0e10cSrcweir eLanguage = ((const SvxLanguageItem*)pLang)->GetValue();
893cdf0e10cSrcweir
894cdf0e10cSrcweir String sTmp(aStdChrFL.GetText());
895cdf0e10cSrcweir String sToReplace = sScriptWestern;
896cdf0e10cSrcweir if(FONT_GROUP_CJK == nFontGroup )
897cdf0e10cSrcweir sToReplace = sScriptAsian;
898cdf0e10cSrcweir else if(FONT_GROUP_CTL == nFontGroup )
899cdf0e10cSrcweir sToReplace = sScriptComplex;
900cdf0e10cSrcweir
901cdf0e10cSrcweir sTmp.SearchAndReplaceAscii("%1", sToReplace);
902cdf0e10cSrcweir aStdChrFL.SetText(sTmp);
903cdf0e10cSrcweir const SfxPoolItem* pItem;
904cdf0e10cSrcweir
905cdf0e10cSrcweir if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_PRINTER, sal_False, &pItem))
906cdf0e10cSrcweir {
907cdf0e10cSrcweir pPrt = (SfxPrinter*)((const SwPtrItem*)pItem)->GetValue();
908cdf0e10cSrcweir }
909cdf0e10cSrcweir else
910cdf0e10cSrcweir {
911cdf0e10cSrcweir SfxItemSet* pPrinterSet = new SfxItemSet( *rSet.GetPool(),
912cdf0e10cSrcweir SID_PRINTER_NOTFOUND_WARN, SID_PRINTER_NOTFOUND_WARN,
913cdf0e10cSrcweir SID_PRINTER_CHANGESTODOC, SID_PRINTER_CHANGESTODOC,
914cdf0e10cSrcweir 0 );
915cdf0e10cSrcweir pPrt = new SfxPrinter(pPrinterSet);
916cdf0e10cSrcweir bDeletePrinter = sal_True;
917cdf0e10cSrcweir }
918cdf0e10cSrcweir pFontList = new FontList( pPrt );
919cdf0e10cSrcweir // #i94536# prevent duplication of font entries when 'reset' button is pressed
920cdf0e10cSrcweir if( !aStandardBox.GetEntryCount() )
921cdf0e10cSrcweir {
922cdf0e10cSrcweir // get the set of disctinct available family names
923cdf0e10cSrcweir std::set< String > aFontNames;
924cdf0e10cSrcweir int nFontNames = pPrt->GetDevFontCount();
925cdf0e10cSrcweir for( int i = 0; i < nFontNames; i++ )
926cdf0e10cSrcweir {
927cdf0e10cSrcweir FontInfo aInf( pPrt->GetDevFont( i ) );
928cdf0e10cSrcweir aFontNames.insert( aInf.GetName() );
929cdf0e10cSrcweir }
930*5ba3629cSmseidel
931cdf0e10cSrcweir // insert to listboxes
932cdf0e10cSrcweir for( std::set< String >::const_iterator it = aFontNames.begin();
933cdf0e10cSrcweir it != aFontNames.end(); ++it )
934cdf0e10cSrcweir {
935cdf0e10cSrcweir aStandardBox.InsertEntry( *it );
936cdf0e10cSrcweir aTitleBox .InsertEntry( *it );
937cdf0e10cSrcweir aListBox .InsertEntry( *it );
938cdf0e10cSrcweir aLabelBox .InsertEntry( *it );
939cdf0e10cSrcweir aIdxBox .InsertEntry( *it );
940cdf0e10cSrcweir }
941cdf0e10cSrcweir }
942cdf0e10cSrcweir if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_STDFONTS, sal_False, &pItem))
943cdf0e10cSrcweir {
944cdf0e10cSrcweir pFontConfig = (SwStdFontConfig*)((const SwPtrItem*)pItem)->GetValue();
945cdf0e10cSrcweir }
946cdf0e10cSrcweir
947cdf0e10cSrcweir if(SFX_ITEM_SET == rSet.GetItemState(FN_PARAM_WRTSHELL, sal_False, &pItem))
948cdf0e10cSrcweir {
949cdf0e10cSrcweir pWrtShell = (SwWrtShell*)((const SwPtrItem*)pItem)->GetValue();
950cdf0e10cSrcweir }
951cdf0e10cSrcweir String sStdBackup;
952cdf0e10cSrcweir String sOutBackup;
953cdf0e10cSrcweir String sListBackup;
954cdf0e10cSrcweir String sCapBackup;
955cdf0e10cSrcweir String sIdxBackup;
956cdf0e10cSrcweir sal_Int32 nStandardHeight = -1;
957cdf0e10cSrcweir sal_Int32 nTitleHeight = -1;
958cdf0e10cSrcweir sal_Int32 nListHeight = -1;
959cdf0e10cSrcweir sal_Int32 nLabelHeight = -1;
960cdf0e10cSrcweir sal_Int32 nIndexHeight = -1;
961cdf0e10cSrcweir
962cdf0e10cSrcweir if(!pWrtShell)
963cdf0e10cSrcweir {
964cdf0e10cSrcweir sStdBackup = pFontConfig->GetFontStandard(nFontGroup);
965cdf0e10cSrcweir sOutBackup = pFontConfig->GetFontOutline(nFontGroup);
966cdf0e10cSrcweir sListBackup= pFontConfig->GetFontList(nFontGroup);
967cdf0e10cSrcweir sCapBackup = pFontConfig->GetFontCaption(nFontGroup);
968cdf0e10cSrcweir sIdxBackup = pFontConfig->GetFontIndex(nFontGroup);
969cdf0e10cSrcweir nStandardHeight = pFontConfig->GetFontHeight( FONT_STANDARD, nFontGroup, eLanguage );
970cdf0e10cSrcweir nTitleHeight = pFontConfig->GetFontHeight( FONT_OUTLINE , nFontGroup, eLanguage );
971cdf0e10cSrcweir nListHeight = pFontConfig->GetFontHeight( FONT_LIST , nFontGroup, eLanguage );
972cdf0e10cSrcweir nLabelHeight = pFontConfig->GetFontHeight( FONT_CAPTION , nFontGroup, eLanguage );
973cdf0e10cSrcweir nIndexHeight = pFontConfig->GetFontHeight( FONT_INDEX , nFontGroup, eLanguage );
974cdf0e10cSrcweir if( nStandardHeight <= 0)
975cdf0e10cSrcweir nStandardHeight = pFontConfig->GetDefaultHeightFor( FONT_STANDARD + nFontGroup * FONT_PER_GROUP, eLanguage);
976cdf0e10cSrcweir if( nTitleHeight <= 0)
977cdf0e10cSrcweir nTitleHeight = pFontConfig->GetDefaultHeightFor( FONT_OUTLINE + nFontGroup * FONT_PER_GROUP, eLanguage);
978cdf0e10cSrcweir if( nListHeight <= 0)
979cdf0e10cSrcweir nListHeight = pFontConfig->GetDefaultHeightFor( FONT_LIST + nFontGroup * FONT_PER_GROUP, eLanguage);
980cdf0e10cSrcweir if( nLabelHeight <= 0)
981cdf0e10cSrcweir nLabelHeight = pFontConfig->GetDefaultHeightFor( FONT_CAPTION + nFontGroup * FONT_PER_GROUP, eLanguage);
982cdf0e10cSrcweir if( nIndexHeight <= 0)
983cdf0e10cSrcweir nIndexHeight = pFontConfig->GetDefaultHeightFor( FONT_INDEX + nFontGroup * FONT_PER_GROUP, eLanguage);
984cdf0e10cSrcweir
985cdf0e10cSrcweir aDocOnlyCB.Enable(sal_False);
986cdf0e10cSrcweir }
987cdf0e10cSrcweir else
988cdf0e10cSrcweir {
989cdf0e10cSrcweir SwTxtFmtColl *pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_STANDARD);
990cdf0e10cSrcweir const SvxFontItem& rFont = !nFontGroup ? pColl->GetFont() :
991cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
992cdf0e10cSrcweir sShellStd = sStdBackup = rFont.GetFamilyName();
993cdf0e10cSrcweir
994cdf0e10cSrcweir sal_uInt16 nFontHeightWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >(
995cdf0e10cSrcweir nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONTSIZE :
996cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONTSIZE : RES_CHRATR_CTL_FONTSIZE );
997cdf0e10cSrcweir const SvxFontHeightItem& rFontHeightStandard = (const SvxFontHeightItem& )pColl->GetFmtAttr(nFontHeightWhich);
998cdf0e10cSrcweir nStandardHeight = (sal_Int32)rFontHeightStandard.GetHeight();
999cdf0e10cSrcweir
1000cdf0e10cSrcweir pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_HEADLINE_BASE);
1001cdf0e10cSrcweir const SvxFontItem& rFontHL = !nFontGroup ? pColl->GetFont() :
1002cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
1003cdf0e10cSrcweir sShellTitle = sOutBackup = rFontHL.GetFamilyName();
1004cdf0e10cSrcweir
1005cdf0e10cSrcweir const SvxFontHeightItem& rFontHeightTitle = (const SvxFontHeightItem&)pColl->GetFmtAttr( nFontHeightWhich, sal_True );
1006cdf0e10cSrcweir nTitleHeight = (sal_Int32)rFontHeightTitle.GetHeight();
1007cdf0e10cSrcweir
1008cdf0e10cSrcweir sal_uInt16 nFontWhich = sal::static_int_cast< sal_uInt16, RES_CHRATR >(
1009cdf0e10cSrcweir nFontGroup == FONT_GROUP_DEFAULT ? RES_CHRATR_FONT :
1010cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? RES_CHRATR_CJK_FONT : RES_CHRATR_CTL_FONT);
1011cdf0e10cSrcweir pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_NUMBUL_BASE);
1012cdf0e10cSrcweir const SvxFontItem& rFontLS = !nFontGroup ? pColl->GetFont() :
1013cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
1014cdf0e10cSrcweir bListDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False);
1015cdf0e10cSrcweir sShellList = sListBackup = rFontLS.GetFamilyName();
1016cdf0e10cSrcweir
1017cdf0e10cSrcweir const SvxFontHeightItem& rFontHeightList = (const SvxFontHeightItem&)pColl->GetFmtAttr(nFontHeightWhich, sal_True);
1018cdf0e10cSrcweir nListHeight = (sal_Int32)rFontHeightList.GetHeight();
1019cdf0e10cSrcweir bListHeightDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False);
1020cdf0e10cSrcweir
1021cdf0e10cSrcweir
1022cdf0e10cSrcweir pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_LABEL);
1023cdf0e10cSrcweir bLabelDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False);
1024cdf0e10cSrcweir const SvxFontItem& rFontCP = !nFontGroup ? pColl->GetFont() :
1025cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
1026cdf0e10cSrcweir sShellLabel = sCapBackup = rFontCP.GetFamilyName();
1027cdf0e10cSrcweir const SvxFontHeightItem& rFontHeightLabel = (const SvxFontHeightItem&)pColl->GetFmtAttr(nFontHeightWhich, sal_True);
1028cdf0e10cSrcweir nLabelHeight = (sal_Int32)rFontHeightLabel.GetHeight();
1029cdf0e10cSrcweir bLabelHeightDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False);
1030cdf0e10cSrcweir
1031cdf0e10cSrcweir pColl = pWrtShell->GetTxtCollFromPool(RES_POOLCOLL_REGISTER_BASE);
1032cdf0e10cSrcweir bIdxDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False);
1033cdf0e10cSrcweir const SvxFontItem& rFontIDX = !nFontGroup ? pColl->GetFont() :
1034cdf0e10cSrcweir FONT_GROUP_CJK == nFontGroup ? pColl->GetCJKFont() : pColl->GetCTLFont();
1035cdf0e10cSrcweir sShellIndex = sIdxBackup = rFontIDX.GetFamilyName();
1036cdf0e10cSrcweir const SvxFontHeightItem& rFontHeightIndex = (const SvxFontHeightItem&)pColl->GetFmtAttr(nFontHeightWhich, sal_True);
1037cdf0e10cSrcweir nIndexHeight = (sal_Int32)rFontHeightIndex.GetHeight();
1038cdf0e10cSrcweir bIndexHeightDefault = SFX_ITEM_DEFAULT == pColl->GetAttrSet().GetItemState(nFontWhich, sal_False);
1039cdf0e10cSrcweir }
1040cdf0e10cSrcweir aStandardBox.SetText(sStdBackup );
1041cdf0e10cSrcweir aTitleBox .SetText(sOutBackup );
1042cdf0e10cSrcweir aListBox .SetText(sListBackup);
1043cdf0e10cSrcweir aLabelBox .SetText(sCapBackup );
1044cdf0e10cSrcweir aIdxBox .SetText(sIdxBackup );
1045cdf0e10cSrcweir
1046cdf0e10cSrcweir FontInfo aFontInfo( pFontList->Get(sStdBackup, sStdBackup) );
1047cdf0e10cSrcweir aStandardHeightLB.Fill( &aFontInfo, pFontList );
1048cdf0e10cSrcweir aFontInfo = pFontList->Get(sOutBackup, sOutBackup );
1049cdf0e10cSrcweir aTitleHeightLB.Fill( &aFontInfo, pFontList );
1050cdf0e10cSrcweir aFontInfo = pFontList->Get(sListBackup,sListBackup);
1051cdf0e10cSrcweir aListHeightLB.Fill( &aFontInfo, pFontList );
1052cdf0e10cSrcweir aFontInfo = pFontList->Get(sCapBackup, sCapBackup );
1053cdf0e10cSrcweir aLabelHeightLB.Fill( &aFontInfo, pFontList );
1054cdf0e10cSrcweir aFontInfo = pFontList->Get(sIdxBackup, sIdxBackup );
1055cdf0e10cSrcweir aIndexHeightLB.Fill( &aFontInfo, pFontList );
1056cdf0e10cSrcweir
1057cdf0e10cSrcweir aStandardHeightLB.SetValue( CalcToPoint( nStandardHeight, SFX_MAPUNIT_TWIP, 10 ) );
1058cdf0e10cSrcweir aTitleHeightLB. SetValue( CalcToPoint( nTitleHeight , SFX_MAPUNIT_TWIP, 10 ) );
1059cdf0e10cSrcweir aListHeightLB. SetValue( CalcToPoint( nListHeight , SFX_MAPUNIT_TWIP, 10 ) );
1060cdf0e10cSrcweir aLabelHeightLB. SetValue( CalcToPoint( nLabelHeight , SFX_MAPUNIT_TWIP, 10 ));
1061cdf0e10cSrcweir aIndexHeightLB. SetValue( CalcToPoint( nIndexHeight , SFX_MAPUNIT_TWIP, 10 ));
1062cdf0e10cSrcweir
1063cdf0e10cSrcweir aStandardBox.SaveValue();
1064cdf0e10cSrcweir aTitleBox .SaveValue();
1065cdf0e10cSrcweir aListBox .SaveValue();
1066cdf0e10cSrcweir aLabelBox .SaveValue();
1067cdf0e10cSrcweir aIdxBox .SaveValue();
1068cdf0e10cSrcweir
1069cdf0e10cSrcweir aStandardHeightLB.SaveValue();
1070cdf0e10cSrcweir aTitleHeightLB. SaveValue();
1071cdf0e10cSrcweir aListHeightLB. SaveValue();
1072cdf0e10cSrcweir aLabelHeightLB. SaveValue();
1073cdf0e10cSrcweir aIndexHeightLB. SaveValue();
1074cdf0e10cSrcweir }
1075cdf0e10cSrcweir
1076cdf0e10cSrcweir /*-----------------07.09.96 12.28-------------------
1077cdf0e10cSrcweir
1078cdf0e10cSrcweir --------------------------------------------------*/
1079cdf0e10cSrcweir
1080cdf0e10cSrcweir
IMPL_LINK(SwStdFontTabPage,StandardHdl,PushButton *,EMPTYARG)1081cdf0e10cSrcweir IMPL_LINK( SwStdFontTabPage, StandardHdl, PushButton *, EMPTYARG )
1082cdf0e10cSrcweir {
1083cdf0e10cSrcweir sal_uInt8 nFontOffset = nFontGroup * FONT_PER_GROUP;
1084cdf0e10cSrcweir aStandardBox.SetText(SwStdFontConfig::GetDefaultFor(FONT_STANDARD + nFontOffset, eLanguage));
1085cdf0e10cSrcweir aTitleBox .SetText(SwStdFontConfig::GetDefaultFor(FONT_OUTLINE + nFontOffset, eLanguage));
1086cdf0e10cSrcweir aListBox .SetText(SwStdFontConfig::GetDefaultFor(FONT_LIST + nFontOffset, eLanguage));
1087cdf0e10cSrcweir aLabelBox .SetText(SwStdFontConfig::GetDefaultFor(FONT_CAPTION + nFontOffset, eLanguage));
1088cdf0e10cSrcweir aIdxBox .SetText(SwStdFontConfig::GetDefaultFor(FONT_INDEX + nFontOffset, eLanguage));
1089cdf0e10cSrcweir
1090cdf0e10cSrcweir aStandardBox.SaveValue();
1091cdf0e10cSrcweir aTitleBox .SaveValue();
1092cdf0e10cSrcweir aListBox .SaveValue();
1093cdf0e10cSrcweir aLabelBox .SaveValue();
1094cdf0e10cSrcweir aIdxBox .SaveValue();
1095cdf0e10cSrcweir
1096cdf0e10cSrcweir aStandardHeightLB.SetValue( CalcToPoint(
1097cdf0e10cSrcweir SwStdFontConfig::GetDefaultHeightFor(FONT_STANDARD + nFontOffset, eLanguage),
1098cdf0e10cSrcweir SFX_MAPUNIT_TWIP, 10 ) );
1099cdf0e10cSrcweir aTitleHeightLB .SetValue(CalcToPoint(
1100cdf0e10cSrcweir SwStdFontConfig::GetDefaultHeightFor(FONT_OUTLINE +
1101cdf0e10cSrcweir nFontOffset, eLanguage), SFX_MAPUNIT_TWIP, 10 ));
1102cdf0e10cSrcweir aListHeightLB .SetValue(CalcToPoint(
1103cdf0e10cSrcweir SwStdFontConfig::GetDefaultHeightFor(FONT_LIST + nFontOffset, eLanguage),
1104cdf0e10cSrcweir SFX_MAPUNIT_TWIP, 10 ));
1105cdf0e10cSrcweir aLabelHeightLB .SetValue(CalcToPoint(
1106cdf0e10cSrcweir SwStdFontConfig::GetDefaultHeightFor(FONT_CAPTION + nFontOffset, eLanguage),
1107cdf0e10cSrcweir SFX_MAPUNIT_TWIP, 10 ));
1108cdf0e10cSrcweir aIndexHeightLB .SetValue(CalcToPoint(
1109cdf0e10cSrcweir SwStdFontConfig::GetDefaultHeightFor(FONT_INDEX + nFontOffset, eLanguage),
1110cdf0e10cSrcweir SFX_MAPUNIT_TWIP, 10 ));
1111cdf0e10cSrcweir
1112cdf0e10cSrcweir return 0;
1113cdf0e10cSrcweir }
1114cdf0e10cSrcweir /*-----------------17.01.97 15.43-------------------
1115cdf0e10cSrcweir
1116cdf0e10cSrcweir --------------------------------------------------*/
1117cdf0e10cSrcweir
IMPL_LINK(SwStdFontTabPage,ModifyHdl,ComboBox *,pBox)1118cdf0e10cSrcweir IMPL_LINK( SwStdFontTabPage, ModifyHdl, ComboBox*, pBox )
1119cdf0e10cSrcweir {
1120cdf0e10cSrcweir if(pBox == &aStandardBox)
1121cdf0e10cSrcweir {
1122cdf0e10cSrcweir String sEntry = pBox->GetText();
1123cdf0e10cSrcweir if(bSetListDefault && bListDefault)
1124cdf0e10cSrcweir aListBox.SetText(sEntry);
1125cdf0e10cSrcweir if(bSetLabelDefault && bLabelDefault)
1126cdf0e10cSrcweir aLabelBox.SetText(sEntry);
1127cdf0e10cSrcweir if(bSetIdxDefault && bIdxDefault)
1128cdf0e10cSrcweir aIdxBox.SetText(sEntry);
1129cdf0e10cSrcweir }
1130cdf0e10cSrcweir else if(pBox == &aListBox)
1131cdf0e10cSrcweir {
1132cdf0e10cSrcweir bSetListDefault = sal_False;
1133cdf0e10cSrcweir }
1134cdf0e10cSrcweir else if(pBox == &aLabelBox)
1135cdf0e10cSrcweir {
1136cdf0e10cSrcweir bSetLabelDefault = sal_False;
1137cdf0e10cSrcweir }
1138cdf0e10cSrcweir else if(pBox == &aIdxBox)
1139cdf0e10cSrcweir {
1140cdf0e10cSrcweir bSetIdxDefault = sal_False;
1141cdf0e10cSrcweir }
1142cdf0e10cSrcweir return 0;
1143cdf0e10cSrcweir }
1144cdf0e10cSrcweir
1145cdf0e10cSrcweir /*-- 11.10.2005 15:11:23---------------------------------------------------
1146cdf0e10cSrcweir
1147cdf0e10cSrcweir -----------------------------------------------------------------------*/
IMPL_LINK(SwStdFontTabPage,ModifyHeightHdl,FontSizeBox *,pBox)1148cdf0e10cSrcweir IMPL_LINK( SwStdFontTabPage, ModifyHeightHdl, FontSizeBox*, pBox )
1149cdf0e10cSrcweir {
1150cdf0e10cSrcweir if(pBox == &aStandardHeightLB)
1151cdf0e10cSrcweir {
1152cdf0e10cSrcweir sal_Int64 nValue = pBox->GetValue(FUNIT_TWIP);
1153cdf0e10cSrcweir if(bSetListHeightDefault && bListHeightDefault)
1154cdf0e10cSrcweir aListHeightLB.SetValue(nValue, FUNIT_TWIP);
1155cdf0e10cSrcweir if(bSetLabelHeightDefault && bLabelHeightDefault)
1156cdf0e10cSrcweir aLabelHeightLB.SetValue(nValue, FUNIT_TWIP);
1157cdf0e10cSrcweir if(bSetIndexHeightDefault && bIndexHeightDefault)
1158cdf0e10cSrcweir aIndexHeightLB.SetValue(nValue, FUNIT_TWIP);
1159cdf0e10cSrcweir }
1160cdf0e10cSrcweir else if(pBox == &aListHeightLB)
1161cdf0e10cSrcweir {
1162cdf0e10cSrcweir bSetListHeightDefault = sal_False;
1163cdf0e10cSrcweir }
1164cdf0e10cSrcweir else if(pBox == &aLabelHeightLB)
1165cdf0e10cSrcweir {
1166cdf0e10cSrcweir bSetLabelHeightDefault = sal_False;
1167cdf0e10cSrcweir }
1168cdf0e10cSrcweir else if(pBox == &aIndexHeightLB)
1169cdf0e10cSrcweir {
1170cdf0e10cSrcweir bSetIndexHeightDefault = sal_False;
1171cdf0e10cSrcweir }
1172cdf0e10cSrcweir return 0;
1173cdf0e10cSrcweir }
1174cdf0e10cSrcweir
1175cdf0e10cSrcweir /*-- 28.09.2005 13:22:36---------------------------------------------------
1176cdf0e10cSrcweir
1177cdf0e10cSrcweir -----------------------------------------------------------------------*/
IMPL_LINK(SwStdFontTabPage,LoseFocusHdl,ComboBox *,pBox)1178cdf0e10cSrcweir IMPL_LINK( SwStdFontTabPage, LoseFocusHdl, ComboBox*, pBox )
1179cdf0e10cSrcweir {
1180cdf0e10cSrcweir FontSizeBox* pHeightLB = 0;
1181cdf0e10cSrcweir String sEntry = pBox->GetText();
1182cdf0e10cSrcweir if(pBox == &aStandardBox)
1183cdf0e10cSrcweir {
1184cdf0e10cSrcweir pHeightLB = &aStandardHeightLB;
1185cdf0e10cSrcweir }
1186cdf0e10cSrcweir else if(pBox == &aTitleBox)
1187cdf0e10cSrcweir {
1188cdf0e10cSrcweir pHeightLB = &aTitleHeightLB;
1189cdf0e10cSrcweir }
1190cdf0e10cSrcweir else if(pBox == &aListBox)
1191cdf0e10cSrcweir {
1192cdf0e10cSrcweir pHeightLB = &aListHeightLB;
1193cdf0e10cSrcweir }
1194cdf0e10cSrcweir else if(pBox == &aLabelBox)
1195cdf0e10cSrcweir {
1196cdf0e10cSrcweir pHeightLB = &aLabelHeightLB;
1197cdf0e10cSrcweir }
1198cdf0e10cSrcweir else /*if(pBox == &aIdxBox)*/
1199cdf0e10cSrcweir {
1200cdf0e10cSrcweir pHeightLB = &aIndexHeightLB;
1201cdf0e10cSrcweir }
1202cdf0e10cSrcweir FontInfo aFontInfo( pFontList->Get(sEntry, sEntry) );
1203cdf0e10cSrcweir pHeightLB->Fill( &aFontInfo, pFontList );
1204cdf0e10cSrcweir
1205cdf0e10cSrcweir return 0;
1206cdf0e10cSrcweir }
1207cdf0e10cSrcweir
1208cdf0e10cSrcweir
PageCreated(SfxAllItemSet aSet)1209cdf0e10cSrcweir void SwStdFontTabPage::PageCreated (SfxAllItemSet aSet)
1210cdf0e10cSrcweir {
1211cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pFlagItem,SfxUInt16Item, SID_FONTMODE_TYPE, sal_False);
1212cdf0e10cSrcweir if (pFlagItem)
1213cdf0e10cSrcweir SetFontMode(sal::static_int_cast< sal_uInt8, sal_uInt16>( pFlagItem->GetValue()));
1214cdf0e10cSrcweir }
1215cdf0e10cSrcweir /*-----------------18.01.97 12.14-------------------
1216cdf0e10cSrcweir Optionen Tabelle
1217cdf0e10cSrcweir --------------------------------------------------*/
1218cdf0e10cSrcweir
SwTableOptionsTabPage(Window * pParent,const SfxItemSet & rSet)1219cdf0e10cSrcweir SwTableOptionsTabPage::SwTableOptionsTabPage( Window* pParent, const SfxItemSet& rSet ) :
1220cdf0e10cSrcweir SfxTabPage(pParent, SW_RES(TP_OPTTABLE_PAGE), rSet),
1221cdf0e10cSrcweir aTableFL (this, SW_RES(FL_TABLE )),
1222cdf0e10cSrcweir aHeaderCB (this, SW_RES(CB_HEADER )),
1223cdf0e10cSrcweir aRepeatHeaderCB (this, SW_RES(CB_REPEAT_HEADER )),
1224cdf0e10cSrcweir aDontSplitCB (this, SW_RES(CB_DONT_SPLIT )),
1225cdf0e10cSrcweir aBorderCB (this, SW_RES(CB_BORDER )),
1226cdf0e10cSrcweir
1227cdf0e10cSrcweir aSeparatorFL (this, SW_RES(FL_TABLE_SEPARATOR)),
1228cdf0e10cSrcweir
1229cdf0e10cSrcweir aTableInsertFL (this, SW_RES(FL_TABLE_INSERT )),
1230cdf0e10cSrcweir aNumFormattingCB(this, SW_RES(CB_NUMFORMATTING )),
1231cdf0e10cSrcweir aNumFmtFormattingCB(this, SW_RES(CB_NUMFMT_FORMATTING )),
1232cdf0e10cSrcweir aNumAlignmentCB (this, SW_RES(CB_NUMALIGNMENT )),
1233cdf0e10cSrcweir
1234cdf0e10cSrcweir aMoveFL( this, SW_RES(FL_MOVE )),
1235cdf0e10cSrcweir aMoveFT( this, SW_RES(FT_MOVE )),
1236cdf0e10cSrcweir aRowMoveFT( this, SW_RES(FT_ROWMOVE )),
1237cdf0e10cSrcweir aRowMoveMF( this, SW_RES(MF_ROWMOVE )),
1238cdf0e10cSrcweir aColMoveFT( this, SW_RES(FT_COLMOVE )),
1239cdf0e10cSrcweir aColMoveMF( this, SW_RES(MF_COLMOVE )),
1240cdf0e10cSrcweir
1241cdf0e10cSrcweir aInsertFT( this, SW_RES(FT_INSERT )),
1242cdf0e10cSrcweir aRowInsertFT( this, SW_RES(FT_ROWINSERT)),
1243cdf0e10cSrcweir aRowInsertMF( this, SW_RES(MF_ROWINSERT)),
1244cdf0e10cSrcweir aColInsertFT( this, SW_RES(FT_COLINSERT)),
1245cdf0e10cSrcweir aColInsertMF( this, SW_RES(MF_COLINSERT)),
1246cdf0e10cSrcweir
1247cdf0e10cSrcweir aHandlingFT( this, SW_RES(FT_HANDLING )),
1248cdf0e10cSrcweir aFixRB( this, SW_RES(RB_FIX )),
1249cdf0e10cSrcweir aFixPropRB( this, SW_RES(RB_FIXPROP )),
1250cdf0e10cSrcweir aVarRB( this, SW_RES(RB_VAR )),
1251cdf0e10cSrcweir aFixFT( this, SW_RES(FT_FIX )),
1252cdf0e10cSrcweir aFixPropFT( this, SW_RES(FT_FIXPROP )),
1253cdf0e10cSrcweir aVarFT( this, SW_RES(FT_VAR )),
1254cdf0e10cSrcweir pWrtShell(0),
1255cdf0e10cSrcweir bHTMLMode(sal_False)
1256cdf0e10cSrcweir {
1257cdf0e10cSrcweir FreeResource();
1258cdf0e10cSrcweir
1259cdf0e10cSrcweir Link aLnk(LINK(this, SwTableOptionsTabPage, CheckBoxHdl));
1260cdf0e10cSrcweir aNumFormattingCB.SetClickHdl(aLnk);
1261cdf0e10cSrcweir aNumFmtFormattingCB.SetClickHdl(aLnk);
1262cdf0e10cSrcweir aHeaderCB.SetClickHdl(aLnk);
1263cdf0e10cSrcweir }
1264cdf0e10cSrcweir
1265cdf0e10cSrcweir /*-----------------18.01.97 12.43-------------------
1266cdf0e10cSrcweir
1267cdf0e10cSrcweir --------------------------------------------------*/
1268cdf0e10cSrcweir
~SwTableOptionsTabPage()1269cdf0e10cSrcweir SwTableOptionsTabPage::~SwTableOptionsTabPage()
1270cdf0e10cSrcweir {
1271cdf0e10cSrcweir }
1272cdf0e10cSrcweir
1273cdf0e10cSrcweir /*-----------------18.01.97 12.43-------------------
1274cdf0e10cSrcweir
1275cdf0e10cSrcweir --------------------------------------------------*/
1276cdf0e10cSrcweir
Create(Window * pParent,const SfxItemSet & rAttrSet)1277cdf0e10cSrcweir SfxTabPage* SwTableOptionsTabPage::Create( Window* pParent,
1278cdf0e10cSrcweir const SfxItemSet& rAttrSet )
1279cdf0e10cSrcweir {
1280cdf0e10cSrcweir return new SwTableOptionsTabPage(pParent, rAttrSet );
1281cdf0e10cSrcweir }
1282cdf0e10cSrcweir
1283cdf0e10cSrcweir /*-----------------18.01.97 12.42-------------------
1284cdf0e10cSrcweir
1285cdf0e10cSrcweir --------------------------------------------------*/
1286cdf0e10cSrcweir
FillItemSet(SfxItemSet &)1287cdf0e10cSrcweir sal_Bool SwTableOptionsTabPage::FillItemSet( SfxItemSet& )
1288cdf0e10cSrcweir {
1289cdf0e10cSrcweir sal_Bool bRet = sal_False;
1290cdf0e10cSrcweir SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
1291cdf0e10cSrcweir
1292cdf0e10cSrcweir if(aRowMoveMF.IsModified())
1293cdf0e10cSrcweir pModOpt->SetTblHMove( (sal_uInt16)aRowMoveMF.Denormalize( aRowMoveMF.GetValue(FUNIT_TWIP)));
1294cdf0e10cSrcweir
1295cdf0e10cSrcweir if(aColMoveMF.IsModified())
1296cdf0e10cSrcweir pModOpt->SetTblVMove( (sal_uInt16)aColMoveMF.Denormalize( aColMoveMF.GetValue(FUNIT_TWIP)));
1297cdf0e10cSrcweir
1298cdf0e10cSrcweir if(aRowInsertMF.IsModified())
1299cdf0e10cSrcweir pModOpt->SetTblHInsert((sal_uInt16)aRowInsertMF.Denormalize( aRowInsertMF.GetValue(FUNIT_TWIP)));
1300cdf0e10cSrcweir
1301cdf0e10cSrcweir if(aColInsertMF.IsModified())
1302cdf0e10cSrcweir pModOpt->SetTblVInsert((sal_uInt16)aColInsertMF.Denormalize( aColInsertMF.GetValue(FUNIT_TWIP)));
1303cdf0e10cSrcweir
1304cdf0e10cSrcweir TblChgMode eMode;
1305cdf0e10cSrcweir if(aFixRB.IsChecked())
1306cdf0e10cSrcweir eMode = TBLFIX_CHGABS;
1307cdf0e10cSrcweir else if(aFixPropRB.IsChecked())
1308cdf0e10cSrcweir eMode = TBLFIX_CHGPROP;
1309cdf0e10cSrcweir else
1310cdf0e10cSrcweir eMode = TBLVAR_CHGABS;
1311cdf0e10cSrcweir if(eMode != pModOpt->GetTblMode())
1312cdf0e10cSrcweir {
1313cdf0e10cSrcweir pModOpt->SetTblMode(eMode);
1314cdf0e10cSrcweir // der Tabellen-Tastatur-Modus hat sich geaendert, das soll
1315cdf0e10cSrcweir // jetzt auch die aktuelle Tabelle erfahren
1316cdf0e10cSrcweir if(pWrtShell && nsSelectionType::SEL_TBL & pWrtShell->GetSelectionType())
1317cdf0e10cSrcweir {
1318cdf0e10cSrcweir pWrtShell->SetTblChgMode(eMode);
1319cdf0e10cSrcweir static sal_uInt16 __READONLY_DATA aInva[] =
1320cdf0e10cSrcweir { FN_TABLE_MODE_FIX,
1321cdf0e10cSrcweir FN_TABLE_MODE_FIX_PROP,
1322cdf0e10cSrcweir FN_TABLE_MODE_VARIABLE,
1323cdf0e10cSrcweir 0
1324cdf0e10cSrcweir };
1325cdf0e10cSrcweir pWrtShell->GetView().GetViewFrame()->GetBindings().Invalidate( aInva );
1326cdf0e10cSrcweir }
1327cdf0e10cSrcweir
1328cdf0e10cSrcweir bRet = sal_True;
1329cdf0e10cSrcweir }
1330cdf0e10cSrcweir
1331cdf0e10cSrcweir SwInsertTableOptions aInsOpts( 0, 0 );
1332cdf0e10cSrcweir
1333cdf0e10cSrcweir if (aHeaderCB.IsChecked())
1334cdf0e10cSrcweir aInsOpts.mnInsMode |= tabopts::HEADLINE;
1335cdf0e10cSrcweir
1336cdf0e10cSrcweir if (aRepeatHeaderCB.IsEnabled() )
1337cdf0e10cSrcweir aInsOpts.mnRowsToRepeat = aRepeatHeaderCB.IsChecked()? 1 : 0;
1338cdf0e10cSrcweir
1339cdf0e10cSrcweir if (!aDontSplitCB.IsChecked())
1340cdf0e10cSrcweir aInsOpts.mnInsMode |= tabopts::SPLIT_LAYOUT;
1341cdf0e10cSrcweir
1342cdf0e10cSrcweir if (aBorderCB.IsChecked())
1343cdf0e10cSrcweir aInsOpts.mnInsMode |= tabopts::DEFAULT_BORDER;
1344cdf0e10cSrcweir
1345cdf0e10cSrcweir if (aHeaderCB.GetSavedValue() != aHeaderCB.GetState() ||
1346cdf0e10cSrcweir aRepeatHeaderCB.GetSavedValue() != aRepeatHeaderCB.GetState() ||
1347cdf0e10cSrcweir aDontSplitCB.GetSavedValue() != aDontSplitCB.GetState() ||
1348cdf0e10cSrcweir aBorderCB.GetSavedValue() != aBorderCB.GetState())
1349cdf0e10cSrcweir {
1350cdf0e10cSrcweir pModOpt->SetInsTblFlags(bHTMLMode, aInsOpts);
1351cdf0e10cSrcweir }
1352cdf0e10cSrcweir
1353cdf0e10cSrcweir if (aNumFormattingCB.GetSavedValue() != aNumFormattingCB.GetState())
1354cdf0e10cSrcweir {
1355cdf0e10cSrcweir pModOpt->SetInsTblFormatNum(bHTMLMode, aNumFormattingCB.IsChecked());
1356cdf0e10cSrcweir bRet = sal_True;
1357cdf0e10cSrcweir }
1358cdf0e10cSrcweir
1359cdf0e10cSrcweir if (aNumFmtFormattingCB.GetSavedValue() != aNumFmtFormattingCB.GetState())
1360cdf0e10cSrcweir {
1361cdf0e10cSrcweir pModOpt->SetInsTblChangeNumFormat(bHTMLMode, aNumFmtFormattingCB.IsChecked());
1362cdf0e10cSrcweir bRet = sal_True;
1363cdf0e10cSrcweir }
1364cdf0e10cSrcweir
1365cdf0e10cSrcweir if (aNumAlignmentCB.GetSavedValue() != aNumAlignmentCB.GetState())
1366cdf0e10cSrcweir {
1367cdf0e10cSrcweir pModOpt->SetInsTblAlignNum(bHTMLMode, aNumAlignmentCB.IsChecked());
1368cdf0e10cSrcweir bRet = sal_True;
1369cdf0e10cSrcweir }
1370cdf0e10cSrcweir
1371cdf0e10cSrcweir return bRet;
1372cdf0e10cSrcweir }
1373cdf0e10cSrcweir /*-----------------18.01.97 12.42-------------------
1374cdf0e10cSrcweir
1375cdf0e10cSrcweir --------------------------------------------------*/
Reset(const SfxItemSet & rSet)1376cdf0e10cSrcweir void SwTableOptionsTabPage::Reset( const SfxItemSet& rSet)
1377cdf0e10cSrcweir {
1378cdf0e10cSrcweir const SwModuleOptions* pModOpt = SW_MOD()->GetModuleConfig();
1379cdf0e10cSrcweir if ( rSet.GetItemState( SID_ATTR_METRIC ) >= SFX_ITEM_AVAILABLE )
1380cdf0e10cSrcweir {
1381cdf0e10cSrcweir const SfxUInt16Item& rItem = (SfxUInt16Item&)rSet.Get( SID_ATTR_METRIC );
1382cdf0e10cSrcweir FieldUnit eFieldUnit = (FieldUnit)rItem.GetValue();
1383cdf0e10cSrcweir ::SetFieldUnit( aRowMoveMF, eFieldUnit );
1384cdf0e10cSrcweir ::SetFieldUnit( aColMoveMF, eFieldUnit );
1385cdf0e10cSrcweir ::SetFieldUnit( aRowInsertMF, eFieldUnit );
1386cdf0e10cSrcweir ::SetFieldUnit( aColInsertMF, eFieldUnit );
1387cdf0e10cSrcweir }
1388cdf0e10cSrcweir
1389cdf0e10cSrcweir aRowMoveMF .SetValue(aRowMoveMF.Normalize(pModOpt->GetTblHMove()), FUNIT_TWIP);
1390cdf0e10cSrcweir aColMoveMF .SetValue(aColMoveMF.Normalize(pModOpt->GetTblVMove()), FUNIT_TWIP);
1391cdf0e10cSrcweir aRowInsertMF.SetValue(aRowInsertMF.Normalize(pModOpt->GetTblHInsert()), FUNIT_TWIP);
1392cdf0e10cSrcweir aColInsertMF.SetValue(aColInsertMF.Normalize(pModOpt->GetTblVInsert()), FUNIT_TWIP);
1393cdf0e10cSrcweir
1394cdf0e10cSrcweir switch(pModOpt->GetTblMode())
1395cdf0e10cSrcweir {
1396cdf0e10cSrcweir case TBLFIX_CHGABS: aFixRB.Check(); break;
1397cdf0e10cSrcweir case TBLFIX_CHGPROP: aFixPropRB.Check(); break;
1398cdf0e10cSrcweir case TBLVAR_CHGABS: aVarRB.Check(); break;
1399cdf0e10cSrcweir }
1400cdf0e10cSrcweir const SfxPoolItem* pItem;
1401cdf0e10cSrcweir if(SFX_ITEM_SET == rSet.GetItemState(SID_HTML_MODE, sal_False, &pItem))
1402cdf0e10cSrcweir {
1403cdf0e10cSrcweir bHTMLMode = 0 != (((const SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON);
1404cdf0e10cSrcweir }
1405cdf0e10cSrcweir
1406cdf0e10cSrcweir //bestimmte Controls fuer HTML verstecken
1407cdf0e10cSrcweir if(bHTMLMode)
1408cdf0e10cSrcweir {
1409cdf0e10cSrcweir /* Point aPos(aCaptionFL.GetPosPixel());
1410cdf0e10cSrcweir long nYDiff = aTableFL.GetPosPixel().Y() - aPos.Y();
1411cdf0e10cSrcweir aTableFL.SetPosPixel(aPos);
1412cdf0e10cSrcweir
1413cdf0e10cSrcweir aPos = aHeaderCB.GetPosPixel();
1414cdf0e10cSrcweir aPos.Y() -= nYDiff;
1415cdf0e10cSrcweir aHeaderCB.SetPosPixel(aPos);
1416cdf0e10cSrcweir
1417cdf0e10cSrcweir aPos = aRepeatHeaderCB.GetPosPixel();
1418cdf0e10cSrcweir aPos.Y() -= nYDiff;
1419cdf0e10cSrcweir aRepeatHeaderCB.SetPosPixel(aPos);
1420cdf0e10cSrcweir
1421cdf0e10cSrcweir aPos = aDontSplitCB.GetPosPixel(); // hier muss eine Luecke geschlossen werden
1422cdf0e10cSrcweir aPos.Y() -= nYDiff;
1423cdf0e10cSrcweir aBorderCB.SetPosPixel(aPos);
1424cdf0e10cSrcweir
1425cdf0e10cSrcweir aPos = aTableInsertFL.GetPosPixel();
1426cdf0e10cSrcweir aPos.Y() -= nYDiff;
1427cdf0e10cSrcweir aTableInsertFL.SetPosPixel(aPos);
1428cdf0e10cSrcweir
1429cdf0e10cSrcweir aPos = aNumFormattingCB.GetPosPixel();
1430cdf0e10cSrcweir aPos.Y() -= nYDiff;
1431cdf0e10cSrcweir aNumFormattingCB.SetPosPixel(aPos);
1432cdf0e10cSrcweir
1433cdf0e10cSrcweir aPos = aNumFmtFormattingCB.GetPosPixel();
1434cdf0e10cSrcweir aPos.Y() -= nYDiff;
1435cdf0e10cSrcweir aNumFmtFormattingCB.SetPosPixel(aPos);
1436cdf0e10cSrcweir
1437cdf0e10cSrcweir aPos = aNumAlignmentCB.GetPosPixel();
1438cdf0e10cSrcweir aPos.Y() -= nYDiff;
1439cdf0e10cSrcweir aNumAlignmentCB.SetPosPixel(aPos);
1440cdf0e10cSrcweir
1441cdf0e10cSrcweir aCaptionFL.Hide();
1442cdf0e10cSrcweir aCaptionCB.Hide();
1443cdf0e10cSrcweir aCaptionFT.Hide();
1444cdf0e10cSrcweir aCaptionPB.Hide();
1445cdf0e10cSrcweir */
1446cdf0e10cSrcweir aDontSplitCB.Hide();
1447cdf0e10cSrcweir }
1448cdf0e10cSrcweir
1449cdf0e10cSrcweir SwInsertTableOptions aInsOpts = pModOpt->GetInsTblFlags(bHTMLMode);
1450cdf0e10cSrcweir sal_uInt16 nInsTblFlags = aInsOpts.mnInsMode;
1451cdf0e10cSrcweir
1452cdf0e10cSrcweir aHeaderCB.Check(0 != (nInsTblFlags & tabopts::HEADLINE));
1453cdf0e10cSrcweir aRepeatHeaderCB.Check(aInsOpts.mnRowsToRepeat > 0);
1454cdf0e10cSrcweir aDontSplitCB.Check(!(nInsTblFlags & tabopts::SPLIT_LAYOUT));
1455cdf0e10cSrcweir aBorderCB.Check(0 != (nInsTblFlags & tabopts::DEFAULT_BORDER));
1456cdf0e10cSrcweir
1457cdf0e10cSrcweir aNumFormattingCB.Check(pModOpt->IsInsTblFormatNum(bHTMLMode));
1458cdf0e10cSrcweir aNumFmtFormattingCB.Check(pModOpt->IsInsTblChangeNumFormat(bHTMLMode));
1459cdf0e10cSrcweir aNumAlignmentCB.Check(pModOpt->IsInsTblAlignNum(bHTMLMode));
1460cdf0e10cSrcweir
1461cdf0e10cSrcweir aHeaderCB.SaveValue();
1462cdf0e10cSrcweir aRepeatHeaderCB.SaveValue();
1463cdf0e10cSrcweir aDontSplitCB.SaveValue();
1464cdf0e10cSrcweir aBorderCB.SaveValue();
1465cdf0e10cSrcweir aNumFormattingCB.SaveValue();
1466cdf0e10cSrcweir aNumFmtFormattingCB.SaveValue();
1467cdf0e10cSrcweir aNumAlignmentCB.SaveValue();
1468cdf0e10cSrcweir
1469cdf0e10cSrcweir CheckBoxHdl(0);
1470cdf0e10cSrcweir }
1471cdf0e10cSrcweir /*-----------------18.01.97 12.42-------------------
1472cdf0e10cSrcweir
1473cdf0e10cSrcweir --------------------------------------------------*/
IMPL_LINK(SwTableOptionsTabPage,CheckBoxHdl,CheckBox *,EMPTYARG)1474cdf0e10cSrcweir IMPL_LINK(SwTableOptionsTabPage, CheckBoxHdl, CheckBox*, EMPTYARG)
1475cdf0e10cSrcweir {
1476cdf0e10cSrcweir aNumFmtFormattingCB.Enable(aNumFormattingCB.IsChecked());
1477cdf0e10cSrcweir aNumAlignmentCB.Enable(aNumFormattingCB.IsChecked());
1478cdf0e10cSrcweir aRepeatHeaderCB.Enable(aHeaderCB.IsChecked());
1479cdf0e10cSrcweir return 0;
1480cdf0e10cSrcweir }
1481cdf0e10cSrcweir
PageCreated(SfxAllItemSet aSet)1482cdf0e10cSrcweir void SwTableOptionsTabPage::PageCreated (SfxAllItemSet aSet)
1483cdf0e10cSrcweir {
1484cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False);
1485cdf0e10cSrcweir if (pWrtSh)
1486cdf0e10cSrcweir SetWrtShell(pWrtSh->GetValue());
1487cdf0e10cSrcweir }
1488cdf0e10cSrcweir /* */
1489cdf0e10cSrcweir
1490cdf0e10cSrcweir /*-----------------31.10.97 17:55-------------------
1491cdf0e10cSrcweir TabPage fuer ShadowCrsr
1492cdf0e10cSrcweir --------------------------------------------------*/
1493cdf0e10cSrcweir
SwShdwCrsrOptionsTabPage(Window * pParent,const SfxItemSet & rSet)1494cdf0e10cSrcweir SwShdwCrsrOptionsTabPage::SwShdwCrsrOptionsTabPage( Window* pParent,
1495cdf0e10cSrcweir const SfxItemSet& rSet )
1496cdf0e10cSrcweir : SfxTabPage(pParent, SW_RES(TP_OPTSHDWCRSR), rSet),
1497cdf0e10cSrcweir aUnprintFL ( this, SW_RES( FL_NOPRINT ) ),
1498cdf0e10cSrcweir aParaCB ( this, SW_RES( CB_PARA ) ),
1499cdf0e10cSrcweir aSHyphCB ( this, SW_RES( CB_SHYPH ) ),
1500cdf0e10cSrcweir aSpacesCB ( this, SW_RES( CB_SPACE ) ),
1501cdf0e10cSrcweir aHSpacesCB ( this, SW_RES( CB_HSPACE ) ),
1502cdf0e10cSrcweir aTabCB ( this, SW_RES( CB_TAB ) ),
1503cdf0e10cSrcweir aBreakCB ( this, SW_RES( CB_BREAK ) ),
1504cdf0e10cSrcweir aCharHiddenCB ( this, SW_RES( CB_CHAR_HIDDEN ) ),
1505cdf0e10cSrcweir aFldHiddenCB ( this, SW_RES( CB_FLD_HIDDEN ) ),
1506cdf0e10cSrcweir aFldHiddenParaCB ( this, SW_RES( CB_FLD_HIDDEN_PARA ) ),
1507cdf0e10cSrcweir
1508cdf0e10cSrcweir aSeparatorFL( this, SW_RES( FL_SEPARATOR_SHDW)),
1509cdf0e10cSrcweir
1510cdf0e10cSrcweir aFlagFL( this, SW_RES( FL_SHDWCRSFLAG )),
1511cdf0e10cSrcweir aOnOffCB( this, SW_RES( CB_SHDWCRSONOFF )),
1512cdf0e10cSrcweir
1513cdf0e10cSrcweir aFillModeFT( this, SW_RES( FT_SHDWCRSFILLMODE )),
1514cdf0e10cSrcweir aFillMarginRB( this, SW_RES( RB_SHDWCRSFILLMARGIN )),
1515cdf0e10cSrcweir aFillIndentRB( this, SW_RES( RB_SHDWCRSFILLINDENT )),
1516cdf0e10cSrcweir aFillTabRB( this, SW_RES( RB_SHDWCRSFILLTAB )),
1517cdf0e10cSrcweir aFillSpaceRB( this, SW_RES( RB_SHDWCRSFILLSPACE )),
1518cdf0e10cSrcweir aCrsrOptFL ( this, SW_RES( FL_CRSR_OPT)),
1519cdf0e10cSrcweir aCrsrInProtCB( this, SW_RES( CB_ALLOW_IN_PROT )),
1520cdf0e10cSrcweir m_aLayoutOptionsFL( this, SW_RES( FL_LAYOUT_OPTIONS ) ),
1521cdf0e10cSrcweir m_aMathBaselineAlignmentCB( this, SW_RES( CB_MATH_BASELINE_ALIGNMENT ) ),
1522cdf0e10cSrcweir m_pWrtShell( NULL )
1523cdf0e10cSrcweir {
1524cdf0e10cSrcweir FreeResource();
1525cdf0e10cSrcweir const SfxPoolItem* pItem = 0;
1526cdf0e10cSrcweir
1527cdf0e10cSrcweir SwShadowCursorItem aOpt;
1528cdf0e10cSrcweir if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem ))
1529cdf0e10cSrcweir aOpt = *(SwShadowCursorItem*)pItem;
1530cdf0e10cSrcweir aOnOffCB.Check( aOpt.IsOn() );
1531cdf0e10cSrcweir
1532cdf0e10cSrcweir sal_uInt8 eMode = aOpt.GetMode();
1533cdf0e10cSrcweir aFillIndentRB.Check( FILL_INDENT == eMode );
1534cdf0e10cSrcweir aFillMarginRB.Check( FILL_MARGIN == eMode );
1535cdf0e10cSrcweir aFillTabRB.Check( FILL_TAB == eMode );
1536cdf0e10cSrcweir aFillSpaceRB.Check( FILL_SPACE == eMode );
1537cdf0e10cSrcweir
1538cdf0e10cSrcweir if(SFX_ITEM_SET == rSet.GetItemState(SID_HTML_MODE, sal_False, &pItem )
1539cdf0e10cSrcweir && ((SfxUInt16Item*)pItem)->GetValue() & HTMLMODE_ON)
1540cdf0e10cSrcweir {
1541cdf0e10cSrcweir aTabCB .Hide();
1542cdf0e10cSrcweir aCharHiddenCB.Hide();
1543cdf0e10cSrcweir aFldHiddenCB .Hide();
1544cdf0e10cSrcweir aFldHiddenParaCB.Hide();
1545cdf0e10cSrcweir aBreakCB.SetPosPixel(aTabCB.GetPosPixel());
1546cdf0e10cSrcweir aFlagFL .Hide();
1547cdf0e10cSrcweir aOnOffCB .Hide();
1548cdf0e10cSrcweir aFillModeFT .Hide();
1549cdf0e10cSrcweir aFillMarginRB .Hide();
1550cdf0e10cSrcweir aFillIndentRB .Hide();
1551cdf0e10cSrcweir aFillTabRB .Hide();
1552cdf0e10cSrcweir aFillSpaceRB .Hide();
1553cdf0e10cSrcweir aCrsrOptFL .Hide();
1554cdf0e10cSrcweir aCrsrInProtCB .Hide();
1555cdf0e10cSrcweir aSeparatorFL.Hide();
1556cdf0e10cSrcweir long nWidth = aFlagFL.GetSizePixel().Width() + aFlagFL.GetPosPixel().X()
1557cdf0e10cSrcweir - aUnprintFL.GetPosPixel().X();
1558cdf0e10cSrcweir Size aSize(aUnprintFL.GetSizePixel());
1559cdf0e10cSrcweir aSize.Width() = nWidth;
1560cdf0e10cSrcweir aUnprintFL.SetSizePixel(aSize);
1561cdf0e10cSrcweir }
1562cdf0e10cSrcweir }
1563cdf0e10cSrcweir
~SwShdwCrsrOptionsTabPage()1564cdf0e10cSrcweir SwShdwCrsrOptionsTabPage::~SwShdwCrsrOptionsTabPage()
1565cdf0e10cSrcweir {
1566cdf0e10cSrcweir }
1567cdf0e10cSrcweir
1568cdf0e10cSrcweir
Create(Window * pParent,const SfxItemSet & rSet)1569cdf0e10cSrcweir SfxTabPage* SwShdwCrsrOptionsTabPage::Create( Window* pParent, const SfxItemSet& rSet )
1570cdf0e10cSrcweir {
1571cdf0e10cSrcweir return new SwShdwCrsrOptionsTabPage( pParent, rSet );
1572cdf0e10cSrcweir }
1573cdf0e10cSrcweir
1574cdf0e10cSrcweir
PageCreated(SfxAllItemSet aSet)1575cdf0e10cSrcweir void SwShdwCrsrOptionsTabPage::PageCreated( SfxAllItemSet aSet )
1576cdf0e10cSrcweir {
1577cdf0e10cSrcweir SFX_ITEMSET_ARG (&aSet,pWrtSh,SwWrtShellItem,SID_WRT_SHELL,sal_False);
1578cdf0e10cSrcweir if (pWrtSh)
1579cdf0e10cSrcweir SetWrtShell(pWrtSh->GetValue());
1580cdf0e10cSrcweir }
1581cdf0e10cSrcweir
1582cdf0e10cSrcweir
FillItemSet(SfxItemSet & rSet)1583cdf0e10cSrcweir sal_Bool SwShdwCrsrOptionsTabPage::FillItemSet( SfxItemSet& rSet )
1584cdf0e10cSrcweir {
1585c94a9bc3SOliver-Rainer Wittmann SwShadowCursorItem aOpt;
1586c94a9bc3SOliver-Rainer Wittmann aOpt.SetOn( aOnOffCB.IsChecked() );
1587c94a9bc3SOliver-Rainer Wittmann
1588c94a9bc3SOliver-Rainer Wittmann sal_uInt8 eMode;
1589c94a9bc3SOliver-Rainer Wittmann if( aFillIndentRB.IsChecked() )
1590c94a9bc3SOliver-Rainer Wittmann eMode= FILL_INDENT;
1591c94a9bc3SOliver-Rainer Wittmann else if( aFillMarginRB.IsChecked() )
1592c94a9bc3SOliver-Rainer Wittmann eMode = FILL_MARGIN;
1593c94a9bc3SOliver-Rainer Wittmann else if( aFillTabRB.IsChecked() )
1594c94a9bc3SOliver-Rainer Wittmann eMode = FILL_TAB;
1595c94a9bc3SOliver-Rainer Wittmann else
1596c94a9bc3SOliver-Rainer Wittmann eMode = FILL_SPACE;
1597c94a9bc3SOliver-Rainer Wittmann aOpt.SetMode( eMode );
1598cdf0e10cSrcweir
1599c94a9bc3SOliver-Rainer Wittmann sal_Bool bRet = sal_False;
1600c94a9bc3SOliver-Rainer Wittmann const SfxPoolItem* pItem = 0;
1601c94a9bc3SOliver-Rainer Wittmann if( SFX_ITEM_SET != rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem )
1602c94a9bc3SOliver-Rainer Wittmann || ((SwShadowCursorItem&)*pItem) != aOpt )
1603c94a9bc3SOliver-Rainer Wittmann {
1604c94a9bc3SOliver-Rainer Wittmann rSet.Put( aOpt );
1605c94a9bc3SOliver-Rainer Wittmann bRet = sal_True;
1606c94a9bc3SOliver-Rainer Wittmann }
1607cdf0e10cSrcweir
1608c94a9bc3SOliver-Rainer Wittmann if ( m_pWrtShell )
1609c94a9bc3SOliver-Rainer Wittmann {
1610c94a9bc3SOliver-Rainer Wittmann m_pWrtShell->GetDoc()->set(
1611c94a9bc3SOliver-Rainer Wittmann IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT,
1612cdf0e10cSrcweir m_aMathBaselineAlignmentCB.IsChecked() );
1613c94a9bc3SOliver-Rainer Wittmann bRet |= m_aMathBaselineAlignmentCB.IsChecked() != m_aMathBaselineAlignmentCB.GetSavedValue();
1614c94a9bc3SOliver-Rainer Wittmann }
1615cdf0e10cSrcweir
1616c94a9bc3SOliver-Rainer Wittmann if( aCrsrInProtCB.IsChecked() != aCrsrInProtCB.GetSavedValue())
1617c94a9bc3SOliver-Rainer Wittmann {
1618c94a9bc3SOliver-Rainer Wittmann rSet.Put(SfxBoolItem(FN_PARAM_CRSR_IN_PROTECTED, aCrsrInProtCB.IsChecked()));
1619c94a9bc3SOliver-Rainer Wittmann bRet |= sal_True;
1620c94a9bc3SOliver-Rainer Wittmann }
1621cdf0e10cSrcweir
1622c94a9bc3SOliver-Rainer Wittmann const SwDocDisplayItem* pOldAttr =
1623c94a9bc3SOliver-Rainer Wittmann (const SwDocDisplayItem*)GetOldItem(GetItemSet(), FN_PARAM_DOCDISP);
1624cdf0e10cSrcweir
1625c94a9bc3SOliver-Rainer Wittmann SwDocDisplayItem aDisp;
1626c94a9bc3SOliver-Rainer Wittmann if(pOldAttr)
1627c94a9bc3SOliver-Rainer Wittmann aDisp = *pOldAttr;
1628cdf0e10cSrcweir //
1629cdf0e10cSrcweir aDisp.bParagraphEnd = aParaCB .IsChecked();
1630cdf0e10cSrcweir aDisp.bTab = aTabCB .IsChecked();
1631cdf0e10cSrcweir aDisp.bSpace = aSpacesCB .IsChecked();
1632cdf0e10cSrcweir aDisp.bNonbreakingSpace = aHSpacesCB .IsChecked();
1633cdf0e10cSrcweir aDisp.bSoftHyphen = aSHyphCB .IsChecked();
1634cdf0e10cSrcweir aDisp.bFldHiddenText = aFldHiddenCB .IsChecked();
1635cdf0e10cSrcweir aDisp.bCharHiddenText = aCharHiddenCB.IsChecked();
1636cdf0e10cSrcweir aDisp.bShowHiddenPara = aFldHiddenParaCB .IsChecked();
1637cdf0e10cSrcweir aDisp.bManualBreak = aBreakCB .IsChecked();
1638cdf0e10cSrcweir
1639cdf0e10cSrcweir bRet |= (!pOldAttr || aDisp != *pOldAttr);
1640c94a9bc3SOliver-Rainer Wittmann if(bRet)
1641cdf0e10cSrcweir bRet = 0 != rSet.Put(aDisp);
1642cdf0e10cSrcweir
1643cdf0e10cSrcweir return bRet;
1644cdf0e10cSrcweir }
1645cdf0e10cSrcweir
Reset(const SfxItemSet & rSet)1646cdf0e10cSrcweir void SwShdwCrsrOptionsTabPage::Reset( const SfxItemSet& rSet )
1647cdf0e10cSrcweir {
1648c94a9bc3SOliver-Rainer Wittmann const SfxPoolItem* pItem = 0;
1649cdf0e10cSrcweir
1650cdf0e10cSrcweir SwShadowCursorItem aOpt;
1651c94a9bc3SOliver-Rainer Wittmann if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SHADOWCURSOR, sal_False, &pItem ))
1652c94a9bc3SOliver-Rainer Wittmann {
1653c94a9bc3SOliver-Rainer Wittmann aOpt = *(SwShadowCursorItem*)pItem;
1654c94a9bc3SOliver-Rainer Wittmann }
1655c94a9bc3SOliver-Rainer Wittmann aOnOffCB.Check( aOpt.IsOn() );
1656cdf0e10cSrcweir
1657c94a9bc3SOliver-Rainer Wittmann sal_uInt8 eMode = aOpt.GetMode();
1658c94a9bc3SOliver-Rainer Wittmann aFillIndentRB.Check( FILL_INDENT == eMode );
1659c94a9bc3SOliver-Rainer Wittmann aFillMarginRB.Check( FILL_MARGIN == eMode );
1660c94a9bc3SOliver-Rainer Wittmann aFillTabRB.Check( FILL_TAB == eMode );
1661c94a9bc3SOliver-Rainer Wittmann aFillSpaceRB.Check( FILL_SPACE == eMode );
1662cdf0e10cSrcweir
1663c94a9bc3SOliver-Rainer Wittmann if ( m_pWrtShell )
1664c94a9bc3SOliver-Rainer Wittmann {
1665c94a9bc3SOliver-Rainer Wittmann m_aMathBaselineAlignmentCB.Check( m_pWrtShell->GetDoc()->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) );
1666c94a9bc3SOliver-Rainer Wittmann m_aMathBaselineAlignmentCB.SaveValue();
1667c94a9bc3SOliver-Rainer Wittmann }
1668c94a9bc3SOliver-Rainer Wittmann else
1669c94a9bc3SOliver-Rainer Wittmann {
1670c94a9bc3SOliver-Rainer Wittmann m_aMathBaselineAlignmentCB.Disable();
1671c94a9bc3SOliver-Rainer Wittmann }
1672cdf0e10cSrcweir
1673c94a9bc3SOliver-Rainer Wittmann if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_CRSR_IN_PROTECTED, sal_False, &pItem ))
1674c94a9bc3SOliver-Rainer Wittmann {
1675c94a9bc3SOliver-Rainer Wittmann aCrsrInProtCB.Check(((const SfxBoolItem*)pItem)->GetValue());
1676c94a9bc3SOliver-Rainer Wittmann }
1677c94a9bc3SOliver-Rainer Wittmann aCrsrInProtCB.SaveValue();
1678cdf0e10cSrcweir
1679cdf0e10cSrcweir const SwDocDisplayItem* pDocDisplayAttr = 0;
1680cdf0e10cSrcweir
1681c94a9bc3SOliver-Rainer Wittmann rSet.GetItemState( FN_PARAM_DOCDISP, sal_False, (const SfxPoolItem**)&pDocDisplayAttr );
1682c94a9bc3SOliver-Rainer Wittmann if(pDocDisplayAttr)
1683cdf0e10cSrcweir {
1684cdf0e10cSrcweir aParaCB .Check (pDocDisplayAttr->bParagraphEnd );
1685cdf0e10cSrcweir aTabCB .Check (pDocDisplayAttr->bTab );
1686cdf0e10cSrcweir aSpacesCB .Check (pDocDisplayAttr->bSpace );
1687cdf0e10cSrcweir aHSpacesCB .Check (pDocDisplayAttr->bNonbreakingSpace );
1688cdf0e10cSrcweir aSHyphCB .Check (pDocDisplayAttr->bSoftHyphen );
1689cdf0e10cSrcweir aCharHiddenCB.Check (pDocDisplayAttr->bCharHiddenText );
1690cdf0e10cSrcweir aFldHiddenCB .Check (pDocDisplayAttr->bFldHiddenText );
1691cdf0e10cSrcweir aFldHiddenParaCB.Check (pDocDisplayAttr->bShowHiddenPara );
1692cdf0e10cSrcweir aBreakCB .Check (pDocDisplayAttr->bManualBreak );
1693cdf0e10cSrcweir }
1694cdf0e10cSrcweir }
1695cdf0e10cSrcweir
1696cdf0e10cSrcweir /*-----------------31.10.97 17:55-------------------
1697cdf0e10cSrcweir TabPage fuer Redlining
1698cdf0e10cSrcweir --------------------------------------------------*/
1699cdf0e10cSrcweir
1700cdf0e10cSrcweir struct CharAttr
1701cdf0e10cSrcweir {
1702cdf0e10cSrcweir sal_uInt16 nItemId;
1703cdf0e10cSrcweir sal_uInt16 nAttr;
1704cdf0e10cSrcweir };
1705cdf0e10cSrcweir
1706cdf0e10cSrcweir // Editieren entspricht Einfuegen-Attributen
1707cdf0e10cSrcweir static CharAttr __FAR_DATA aRedlineAttr[] =
1708cdf0e10cSrcweir {
1709cdf0e10cSrcweir { SID_ATTR_CHAR_CASEMAP, SVX_CASEMAP_NOT_MAPPED },
1710cdf0e10cSrcweir { SID_ATTR_CHAR_WEIGHT, WEIGHT_BOLD },
1711cdf0e10cSrcweir { SID_ATTR_CHAR_POSTURE, ITALIC_NORMAL },
1712cdf0e10cSrcweir { SID_ATTR_CHAR_UNDERLINE, UNDERLINE_SINGLE },
1713cdf0e10cSrcweir { SID_ATTR_CHAR_UNDERLINE, UNDERLINE_DOUBLE },
1714cdf0e10cSrcweir { SID_ATTR_CHAR_STRIKEOUT, STRIKEOUT_SINGLE },
1715cdf0e10cSrcweir { SID_ATTR_CHAR_CASEMAP, SVX_CASEMAP_VERSALIEN },
1716cdf0e10cSrcweir { SID_ATTR_CHAR_CASEMAP, SVX_CASEMAP_GEMEINE },
1717cdf0e10cSrcweir { SID_ATTR_CHAR_CASEMAP, SVX_CASEMAP_KAPITAELCHEN },
1718cdf0e10cSrcweir { SID_ATTR_CHAR_CASEMAP, SVX_CASEMAP_TITEL },
1719cdf0e10cSrcweir { SID_ATTR_BRUSH, 0 }
1720cdf0e10cSrcweir };
1721cdf0e10cSrcweir // Items from aRedlineAttr relevant for InsertAttr: strikethrough is
1722cdf0e10cSrcweir // not used
1723cdf0e10cSrcweir static sal_uInt16 aInsertAttrMap[] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 };
1724cdf0e10cSrcweir
1725cdf0e10cSrcweir // Items from aRedlineAttr relevant for DeleteAttr: underline and
1726cdf0e10cSrcweir // double underline is not used
1727cdf0e10cSrcweir static sal_uInt16 aDeletedAttrMap[] = { 0, 1, 2, 5, 6, 7, 8, 9, 10 };
1728cdf0e10cSrcweir
1729cdf0e10cSrcweir // Items from aRedlineAttr relevant for ChangeAttr: strikethrough is
1730cdf0e10cSrcweir // not used
1731cdf0e10cSrcweir static sal_uInt16 aChangedAttrMap[] = { 0, 1, 2, 3, 4, 6, 7, 8, 9, 10 };
1732cdf0e10cSrcweir
1733cdf0e10cSrcweir /*-----------------------------------------------------------------------
1734cdf0e10cSrcweir Beschreibung: Markierungsvorschau
1735cdf0e10cSrcweir -----------------------------------------------------------------------*/
1736cdf0e10cSrcweir
SwMarkPreview(Window * pParent,const ResId & rResID)1737cdf0e10cSrcweir SwMarkPreview::SwMarkPreview( Window *pParent, const ResId& rResID ) :
1738cdf0e10cSrcweir
1739cdf0e10cSrcweir Window(pParent, rResID),
1740cdf0e10cSrcweir m_aTransCol( COL_TRANSPARENT ),
1741cdf0e10cSrcweir m_aMarkCol( COL_LIGHTRED ),
1742cdf0e10cSrcweir nMarkPos(0)
1743cdf0e10cSrcweir
1744cdf0e10cSrcweir {
1745cdf0e10cSrcweir InitColors();
1746cdf0e10cSrcweir SetMapMode(MAP_PIXEL);
1747cdf0e10cSrcweir
1748cdf0e10cSrcweir const Size aSz(GetOutputSizePixel());
1749cdf0e10cSrcweir
1750cdf0e10cSrcweir // Seite
1751cdf0e10cSrcweir aPage.SetSize(Size(aSz.Width() - 3, aSz.Height() - 3));
1752cdf0e10cSrcweir
1753cdf0e10cSrcweir sal_uLong nOutWPix = aPage.GetWidth();
1754cdf0e10cSrcweir sal_uLong nOutHPix = aPage.GetHeight();
1755cdf0e10cSrcweir
1756cdf0e10cSrcweir // PrintArea
1757cdf0e10cSrcweir sal_uLong nLBorder = 8;
1758cdf0e10cSrcweir sal_uLong nRBorder = 8;
1759cdf0e10cSrcweir sal_uLong nTBorder = 4;
1760cdf0e10cSrcweir sal_uLong nBBorder = 4;
1761cdf0e10cSrcweir
1762cdf0e10cSrcweir aLeftPagePrtArea = Rectangle(Point(nLBorder, nTBorder), Point((nOutWPix - 1) - nRBorder, (nOutHPix - 1) - nBBorder));
1763cdf0e10cSrcweir sal_uInt16 nWidth = (sal_uInt16)aLeftPagePrtArea.GetWidth();
1764cdf0e10cSrcweir sal_uInt16 nKorr = (nWidth & 1) != 0 ? 0 : 1;
1765cdf0e10cSrcweir aLeftPagePrtArea.SetSize(Size(nWidth / 2 - (nLBorder + nRBorder) / 2 + nKorr, aLeftPagePrtArea.GetHeight()));
1766cdf0e10cSrcweir
1767cdf0e10cSrcweir aRightPagePrtArea = aLeftPagePrtArea;
1768cdf0e10cSrcweir aRightPagePrtArea.Move(aLeftPagePrtArea.GetWidth() + nLBorder + nRBorder + 1, 0);
1769cdf0e10cSrcweir }
1770cdf0e10cSrcweir
~SwMarkPreview()1771cdf0e10cSrcweir SwMarkPreview::~SwMarkPreview()
1772cdf0e10cSrcweir {
1773cdf0e10cSrcweir }
1774cdf0e10cSrcweir
InitColors(void)1775cdf0e10cSrcweir void SwMarkPreview::InitColors( void )
1776cdf0e10cSrcweir {
1777cdf0e10cSrcweir // m_aTransCol and m_aMarkCol are _not_ changed because they are set from outside!
1778cdf0e10cSrcweir
1779cdf0e10cSrcweir const StyleSettings& rSettings = GetSettings().GetStyleSettings();
1780cdf0e10cSrcweir m_aBgCol = Color( rSettings.GetWindowColor() );
1781cdf0e10cSrcweir
1782cdf0e10cSrcweir sal_Bool bHC = rSettings.GetHighContrastMode();
1783cdf0e10cSrcweir m_aLineCol = bHC? SwViewOption::GetFontColor() : Color( COL_BLACK );
1784cdf0e10cSrcweir m_aShadowCol = bHC? m_aBgCol : rSettings.GetShadowColor();
1785cdf0e10cSrcweir m_aTxtCol = bHC? SwViewOption::GetFontColor() : Color( COL_GRAY );
1786cdf0e10cSrcweir m_aPrintAreaCol = m_aTxtCol;
1787cdf0e10cSrcweir }
1788cdf0e10cSrcweir
DataChanged(const DataChangedEvent & rDCEvt)1789cdf0e10cSrcweir void SwMarkPreview::DataChanged( const DataChangedEvent& rDCEvt )
1790cdf0e10cSrcweir {
1791cdf0e10cSrcweir Window::DataChanged( rDCEvt );
1792cdf0e10cSrcweir
1793cdf0e10cSrcweir if( rDCEvt.GetType() == DATACHANGED_SETTINGS && ( rDCEvt.GetFlags() & SETTINGS_STYLE ) )
1794cdf0e10cSrcweir InitColors();
1795cdf0e10cSrcweir }
1796cdf0e10cSrcweir
Paint(const Rectangle &)1797cdf0e10cSrcweir void SwMarkPreview::Paint(const Rectangle &/*rRect*/)
1798cdf0e10cSrcweir {
1799cdf0e10cSrcweir // Schatten zeichnen
1800cdf0e10cSrcweir Rectangle aShadow(aPage);
1801cdf0e10cSrcweir aShadow += Point(3, 3);
1802cdf0e10cSrcweir DrawRect( aShadow, m_aShadowCol, m_aTransCol );
1803cdf0e10cSrcweir
1804cdf0e10cSrcweir // Seite zeichnen
1805cdf0e10cSrcweir DrawRect( aPage, m_aBgCol, m_aLineCol );
1806cdf0e10cSrcweir
1807cdf0e10cSrcweir // Separator zeichnen
1808cdf0e10cSrcweir Rectangle aPageSeparator(aPage);
1809cdf0e10cSrcweir aPageSeparator.SetSize(Size(2, aPageSeparator.GetHeight()));
1810cdf0e10cSrcweir aPageSeparator.Move(aPage.GetWidth() / 2 - 1, 0);
1811cdf0e10cSrcweir DrawRect( aPageSeparator, m_aLineCol, m_aTransCol );
1812cdf0e10cSrcweir
1813cdf0e10cSrcweir PaintPage(aLeftPagePrtArea);
1814cdf0e10cSrcweir PaintPage(aRightPagePrtArea);
1815cdf0e10cSrcweir
1816cdf0e10cSrcweir Rectangle aLeftMark(Point(aPage.Left() + 2, aLeftPagePrtArea.Top() + 4), Size(aLeftPagePrtArea.Left() - 4, 2));
1817cdf0e10cSrcweir Rectangle aRightMark(Point(aRightPagePrtArea.Right() + 2, aRightPagePrtArea.Bottom() - 6), Size(aLeftPagePrtArea.Left() - 4, 2));
1818cdf0e10cSrcweir
1819cdf0e10cSrcweir switch (nMarkPos)
1820cdf0e10cSrcweir {
1821cdf0e10cSrcweir case 1: // Links
1822cdf0e10cSrcweir aRightMark.SetPos(Point(aRightPagePrtArea.Left() - 2 - aRightMark.GetWidth(), aRightMark.Top()));
1823cdf0e10cSrcweir break;
1824cdf0e10cSrcweir
1825cdf0e10cSrcweir case 2: // Rechts
1826cdf0e10cSrcweir aLeftMark.SetPos(Point(aLeftPagePrtArea.Right() + 2, aLeftMark.Top()));
1827cdf0e10cSrcweir break;
1828cdf0e10cSrcweir
1829cdf0e10cSrcweir case 3: // Aussen
1830cdf0e10cSrcweir break;
1831cdf0e10cSrcweir
1832cdf0e10cSrcweir case 4: // Innen
1833cdf0e10cSrcweir aLeftMark.SetPos(Point(aLeftPagePrtArea.Right() + 2, aLeftMark.Top()));
1834cdf0e10cSrcweir aRightMark.SetPos(Point(aRightPagePrtArea.Left() - 2 - aRightMark.GetWidth(), aRightMark.Top()));
1835cdf0e10cSrcweir break;
1836cdf0e10cSrcweir
1837cdf0e10cSrcweir case 0: // Keine
1838cdf0e10cSrcweir default:
1839cdf0e10cSrcweir return;
1840cdf0e10cSrcweir }
1841cdf0e10cSrcweir DrawRect( aLeftMark, m_aMarkCol, m_aTransCol );
1842cdf0e10cSrcweir DrawRect( aRightMark, m_aMarkCol, m_aTransCol );
1843cdf0e10cSrcweir }
1844cdf0e10cSrcweir
PaintPage(const Rectangle & rRect)1845cdf0e10cSrcweir void SwMarkPreview::PaintPage(const Rectangle &rRect)
1846cdf0e10cSrcweir {
1847cdf0e10cSrcweir // PrintArea zeichnen
1848cdf0e10cSrcweir DrawRect(rRect, m_aTransCol, m_aPrintAreaCol );
1849cdf0e10cSrcweir
1850cdf0e10cSrcweir // Testabsatz zeichnen
1851cdf0e10cSrcweir sal_uLong nLTxtBorder = 4;
1852cdf0e10cSrcweir sal_uLong nRTxtBorder = 4;
1853cdf0e10cSrcweir sal_uLong nTTxtBorder = 4;
1854cdf0e10cSrcweir
1855cdf0e10cSrcweir Rectangle aTextLine = rRect;
1856cdf0e10cSrcweir aTextLine.SetSize(Size(aTextLine.GetWidth(), 2));
1857cdf0e10cSrcweir aTextLine.Left() += nLTxtBorder;
1858cdf0e10cSrcweir aTextLine.Right() -= nRTxtBorder;
1859cdf0e10cSrcweir aTextLine.Move(0, nTTxtBorder);
1860cdf0e10cSrcweir
1861cdf0e10cSrcweir sal_Int32 nStep;
1862cdf0e10cSrcweir sal_uInt16 nLines;
1863cdf0e10cSrcweir
1864cdf0e10cSrcweir nStep = aTextLine.GetHeight() + 2;
1865cdf0e10cSrcweir nLines = (sal_uInt16)(rRect.GetHeight() / (aTextLine.GetHeight() + 2)) - 1;
1866cdf0e10cSrcweir
1867cdf0e10cSrcweir // Text simulieren
1868cdf0e10cSrcweir //
1869cdf0e10cSrcweir for (sal_uInt16 i = 0; i < nLines; ++i)
1870cdf0e10cSrcweir {
1871cdf0e10cSrcweir if (i == (nLines - 1))
1872cdf0e10cSrcweir aTextLine.SetSize(Size(aTextLine.GetWidth() / 2, aTextLine.GetHeight()));
1873cdf0e10cSrcweir
1874cdf0e10cSrcweir if (aPage.IsInside(aTextLine))
1875cdf0e10cSrcweir DrawRect(aTextLine, m_aTxtCol, m_aTransCol );
1876cdf0e10cSrcweir
1877cdf0e10cSrcweir aTextLine.Move(0, nStep);
1878cdf0e10cSrcweir }
1879cdf0e10cSrcweir aTextLine.Move(0, -nStep);
1880cdf0e10cSrcweir }
1881cdf0e10cSrcweir
DrawRect(const Rectangle & rRect,const Color & rFillColor,const Color & rLineColor)1882cdf0e10cSrcweir void SwMarkPreview::DrawRect(const Rectangle &rRect, const Color &rFillColor, const Color &rLineColor)
1883cdf0e10cSrcweir {
1884cdf0e10cSrcweir SetFillColor(rFillColor);
1885cdf0e10cSrcweir SetLineColor(rLineColor);
1886cdf0e10cSrcweir Window::DrawRect(rRect);
1887cdf0e10cSrcweir }
1888cdf0e10cSrcweir
1889cdf0e10cSrcweir namespace
1890cdf0e10cSrcweir {
lcl_FillRedlineAttrListBox(ListBox & rLB,const AuthorCharAttr & rAttrToSelect,const sal_uInt16 * pAttrMap,const sal_uInt16 nAttrMapSize)1891cdf0e10cSrcweir void lcl_FillRedlineAttrListBox(
1892cdf0e10cSrcweir ListBox& rLB, const AuthorCharAttr& rAttrToSelect,
1893cdf0e10cSrcweir const sal_uInt16* pAttrMap, const sal_uInt16 nAttrMapSize)
1894cdf0e10cSrcweir {
1895cdf0e10cSrcweir for (sal_uInt16 i = 0; i != nAttrMapSize; ++i)
1896cdf0e10cSrcweir {
1897cdf0e10cSrcweir CharAttr& rAttr(aRedlineAttr[pAttrMap[i]]);
1898cdf0e10cSrcweir rLB.SetEntryData(i, &rAttr);
1899cdf0e10cSrcweir if (rAttr.nItemId == rAttrToSelect.nItemId &&
1900cdf0e10cSrcweir rAttr.nAttr == rAttrToSelect.nAttr)
1901cdf0e10cSrcweir rLB.SelectEntryPos(i);
1902cdf0e10cSrcweir }
1903cdf0e10cSrcweir }
1904cdf0e10cSrcweir }
1905cdf0e10cSrcweir
SwRedlineOptionsTabPage(Window * pParent,const SfxItemSet & rSet)1906cdf0e10cSrcweir SwRedlineOptionsTabPage::SwRedlineOptionsTabPage( Window* pParent,
1907cdf0e10cSrcweir const SfxItemSet& rSet )
1908cdf0e10cSrcweir : SfxTabPage(pParent, SW_RES(TP_REDLINE_OPT), rSet),
1909cdf0e10cSrcweir
1910cdf0e10cSrcweir aInsertFL( this, SW_RES( FL_TE )),
1911cdf0e10cSrcweir
1912cdf0e10cSrcweir aInsertFT( this, SW_RES( FT_CHG_INSERT )),
1913cdf0e10cSrcweir aInsertAttrFT( this, SW_RES( FT_INS_ATTR )),
1914cdf0e10cSrcweir aInsertLB( this, SW_RES( LB_INS_ATTR )),
1915cdf0e10cSrcweir aInsertColorFT( this, SW_RES( FT_INS_COL )),
1916cdf0e10cSrcweir aInsertColorLB( this, SW_RES( LB_INS_COL )),
1917cdf0e10cSrcweir aInsertedPreviewWN( this, SW_RES( WIN_INS )),
1918cdf0e10cSrcweir
1919cdf0e10cSrcweir aDeletedFT( this, SW_RES( FT_CHG_DELETE )),
1920cdf0e10cSrcweir aDeletedAttrFT( this, SW_RES( FT_DEL_ATTR )),
1921cdf0e10cSrcweir aDeletedLB( this, SW_RES( LB_DEL_ATTR )),
1922cdf0e10cSrcweir aDeletedColorFT( this, SW_RES( FT_DEL_COL )),
1923cdf0e10cSrcweir aDeletedColorLB( this, SW_RES( LB_DEL_COL )),
1924cdf0e10cSrcweir aDeletedPreviewWN( this, SW_RES( WIN_DEL )),
1925cdf0e10cSrcweir
1926cdf0e10cSrcweir aChangedFT( this, SW_RES( FT_CHG_CHANGE )),
1927cdf0e10cSrcweir aChangedAttrFT( this, SW_RES( FT_CHG_ATTR )),
1928cdf0e10cSrcweir aChangedLB( this, SW_RES( LB_CHG_ATTR )),
1929cdf0e10cSrcweir aChangedColorFT( this, SW_RES( FT_CHG_COL )),
1930cdf0e10cSrcweir aChangedColorLB( this, SW_RES( LB_CHG_COL )),
1931cdf0e10cSrcweir aChangedPreviewWN( this, SW_RES( WIN_CHG )),
1932cdf0e10cSrcweir
1933cdf0e10cSrcweir aChangedFL ( this, SW_RES( FL_LC )),
1934cdf0e10cSrcweir
1935cdf0e10cSrcweir aMarkPosFT ( this, SW_RES( FT_MARKPOS )),
1936cdf0e10cSrcweir aMarkPosLB ( this, SW_RES( LB_MARKPOS )),
1937cdf0e10cSrcweir aMarkColorFT ( this, SW_RES( FT_LC_COL )),
1938cdf0e10cSrcweir aMarkColorLB ( this, SW_RES( LB_LC_COL )),
1939cdf0e10cSrcweir aMarkPreviewWN ( this, SW_RES( WIN_MARK )),
1940cdf0e10cSrcweir
1941cdf0e10cSrcweir sAuthor ( SW_RES( STR_AUTHOR )),
1942cdf0e10cSrcweir sNone ( SW_RES( STR_NOTHING ))
1943cdf0e10cSrcweir
1944cdf0e10cSrcweir {
1945cdf0e10cSrcweir FreeResource();
1946cdf0e10cSrcweir
1947cdf0e10cSrcweir for(sal_uInt16 i = 0; i < aInsertLB.GetEntryCount(); i++)
1948cdf0e10cSrcweir {
1949cdf0e10cSrcweir String sEntry(aInsertLB.GetEntry(i));
1950cdf0e10cSrcweir aDeletedLB.InsertEntry(sEntry);
1951cdf0e10cSrcweir aChangedLB.InsertEntry(sEntry);
1952cdf0e10cSrcweir };
1953cdf0e10cSrcweir
1954cdf0e10cSrcweir // remove strikethrough from insert and change and underline + double
1955cdf0e10cSrcweir // underline from delete
1956cdf0e10cSrcweir aInsertLB.RemoveEntry(5);
1957cdf0e10cSrcweir aChangedLB.RemoveEntry(5);
1958cdf0e10cSrcweir aDeletedLB.RemoveEntry(4);
1959cdf0e10cSrcweir aDeletedLB.RemoveEntry(3);
1960*5ba3629cSmseidel
1961cdf0e10cSrcweir Link aLk = LINK(this, SwRedlineOptionsTabPage, AttribHdl);
1962cdf0e10cSrcweir aInsertLB.SetSelectHdl( aLk );
1963cdf0e10cSrcweir aDeletedLB.SetSelectHdl( aLk );
1964cdf0e10cSrcweir aChangedLB.SetSelectHdl( aLk );
1965cdf0e10cSrcweir
1966cdf0e10cSrcweir aLk = LINK(this, SwRedlineOptionsTabPage, ColorHdl);
1967cdf0e10cSrcweir aInsertColorLB.SetSelectHdl( aLk );
1968cdf0e10cSrcweir aDeletedColorLB.SetSelectHdl( aLk );
1969cdf0e10cSrcweir aChangedColorLB.SetSelectHdl( aLk );
1970cdf0e10cSrcweir
1971cdf0e10cSrcweir aLk = LINK(this, SwRedlineOptionsTabPage, ChangedMaskPrevHdl);
1972cdf0e10cSrcweir aMarkPosLB.SetSelectHdl( aLk );
1973cdf0e10cSrcweir aMarkColorLB.SetSelectHdl( aLk );
1974cdf0e10cSrcweir //solution: set different accessible name of four color box
1975cdf0e10cSrcweir aInsertColorLB.SetAccessibleName(::rtl::OUString( aInsertFT.GetDisplayText()) + ::rtl::OUString(aInsertColorFT.GetDisplayText()));
1976cdf0e10cSrcweir aDeletedColorLB.SetAccessibleName(::rtl::OUString( aDeletedFT.GetDisplayText()) + ::rtl::OUString( aDeletedColorFT.GetDisplayText()));
1977cdf0e10cSrcweir aChangedColorLB.SetAccessibleName(::rtl::OUString( aChangedFT.GetDisplayText()) + ::rtl::OUString( aChangedColorFT.GetDisplayText()));
1978cdf0e10cSrcweir aMarkColorLB.SetAccessibleName(::rtl::OUString( aMarkPosFT.GetDisplayText()) + ::rtl::OUString( aMarkColorFT.GetDisplayText()));
1979cdf0e10cSrcweir }
1980cdf0e10cSrcweir
~SwRedlineOptionsTabPage()1981cdf0e10cSrcweir SwRedlineOptionsTabPage::~SwRedlineOptionsTabPage()
1982cdf0e10cSrcweir {
1983cdf0e10cSrcweir }
1984cdf0e10cSrcweir
Create(Window * pParent,const SfxItemSet & rSet)1985cdf0e10cSrcweir SfxTabPage* SwRedlineOptionsTabPage::Create( Window* pParent, const SfxItemSet& rSet)
1986cdf0e10cSrcweir {
1987cdf0e10cSrcweir return new SwRedlineOptionsTabPage( pParent, rSet );
1988cdf0e10cSrcweir }
1989cdf0e10cSrcweir
FillItemSet(SfxItemSet &)1990cdf0e10cSrcweir sal_Bool SwRedlineOptionsTabPage::FillItemSet( SfxItemSet& )
1991cdf0e10cSrcweir {
1992cdf0e10cSrcweir CharAttr *pAttr;
1993cdf0e10cSrcweir SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig();
1994cdf0e10cSrcweir
1995cdf0e10cSrcweir AuthorCharAttr aInsertedAttr;
1996cdf0e10cSrcweir AuthorCharAttr aDeletedAttr;
1997cdf0e10cSrcweir AuthorCharAttr aChangedAttr;
1998cdf0e10cSrcweir
1999cdf0e10cSrcweir AuthorCharAttr aOldInsertAttr(pOpt->GetInsertAuthorAttr());
2000cdf0e10cSrcweir AuthorCharAttr aOldDeletedAttr(pOpt->GetDeletedAuthorAttr());
2001cdf0e10cSrcweir AuthorCharAttr aOldChangedAttr(pOpt->GetFormatAuthorAttr());
2002cdf0e10cSrcweir
2003cdf0e10cSrcweir ColorData nOldMarkColor = pOpt->GetMarkAlignColor().GetColor();
2004cdf0e10cSrcweir sal_uInt16 nOldMarkMode = pOpt->GetMarkAlignMode();
2005cdf0e10cSrcweir
2006cdf0e10cSrcweir sal_uInt16 nPos = aInsertLB.GetSelectEntryPos();
2007cdf0e10cSrcweir if (nPos != LISTBOX_ENTRY_NOTFOUND)
2008cdf0e10cSrcweir {
2009cdf0e10cSrcweir pAttr = (CharAttr *)aInsertLB.GetEntryData(nPos);
2010cdf0e10cSrcweir aInsertedAttr.nItemId = pAttr->nItemId;
2011cdf0e10cSrcweir aInsertedAttr.nAttr = pAttr->nAttr;
2012cdf0e10cSrcweir
2013cdf0e10cSrcweir nPos = aInsertColorLB.GetSelectEntryPos();
2014cdf0e10cSrcweir
2015cdf0e10cSrcweir switch (nPos)
2016cdf0e10cSrcweir {
2017cdf0e10cSrcweir case 0:
2018cdf0e10cSrcweir aInsertedAttr.nColor = COL_NONE;
2019cdf0e10cSrcweir break;
2020cdf0e10cSrcweir case 1:
2021cdf0e10cSrcweir case LISTBOX_ENTRY_NOTFOUND:
2022cdf0e10cSrcweir aInsertedAttr.nColor = COL_TRANSPARENT;
2023cdf0e10cSrcweir break;
2024cdf0e10cSrcweir default:
2025cdf0e10cSrcweir aInsertedAttr.nColor = aInsertColorLB.GetEntryColor(nPos).GetColor();
2026cdf0e10cSrcweir break;
2027cdf0e10cSrcweir }
2028cdf0e10cSrcweir
2029cdf0e10cSrcweir pOpt->SetInsertAuthorAttr(aInsertedAttr);
2030cdf0e10cSrcweir }
2031cdf0e10cSrcweir
2032cdf0e10cSrcweir nPos = aDeletedLB.GetSelectEntryPos();
2033cdf0e10cSrcweir if (nPos != LISTBOX_ENTRY_NOTFOUND)
2034cdf0e10cSrcweir {
2035cdf0e10cSrcweir pAttr = (CharAttr *)aDeletedLB.GetEntryData(nPos);
2036cdf0e10cSrcweir aDeletedAttr.nItemId = pAttr->nItemId;
2037cdf0e10cSrcweir aDeletedAttr.nAttr = pAttr->nAttr;
2038cdf0e10cSrcweir
2039cdf0e10cSrcweir nPos = aDeletedColorLB.GetSelectEntryPos();
2040cdf0e10cSrcweir
2041cdf0e10cSrcweir switch (nPos)
2042cdf0e10cSrcweir {
2043cdf0e10cSrcweir case 0:
2044cdf0e10cSrcweir aDeletedAttr.nColor = COL_NONE;
2045cdf0e10cSrcweir break;
2046cdf0e10cSrcweir case 1:
2047cdf0e10cSrcweir case LISTBOX_ENTRY_NOTFOUND:
2048cdf0e10cSrcweir aDeletedAttr.nColor = COL_TRANSPARENT;
2049cdf0e10cSrcweir break;
2050cdf0e10cSrcweir default:
2051cdf0e10cSrcweir aDeletedAttr.nColor = aDeletedColorLB.GetEntryColor(nPos).GetColor();
2052cdf0e10cSrcweir break;
2053cdf0e10cSrcweir }
2054cdf0e10cSrcweir
2055cdf0e10cSrcweir pOpt->SetDeletedAuthorAttr(aDeletedAttr);
2056cdf0e10cSrcweir }
2057cdf0e10cSrcweir
2058cdf0e10cSrcweir nPos = aChangedLB.GetSelectEntryPos();
2059cdf0e10cSrcweir if (nPos != LISTBOX_ENTRY_NOTFOUND)
2060cdf0e10cSrcweir {
2061cdf0e10cSrcweir pAttr = (CharAttr *)aChangedLB.GetEntryData(nPos);
2062cdf0e10cSrcweir aChangedAttr.nItemId = pAttr->nItemId;
2063cdf0e10cSrcweir aChangedAttr.nAttr = pAttr->nAttr;
2064cdf0e10cSrcweir
2065cdf0e10cSrcweir nPos = aChangedColorLB.GetSelectEntryPos();
2066cdf0e10cSrcweir
2067cdf0e10cSrcweir switch (nPos)
2068cdf0e10cSrcweir {
2069cdf0e10cSrcweir case 0:
2070cdf0e10cSrcweir aChangedAttr.nColor = COL_NONE;
2071cdf0e10cSrcweir break;
2072cdf0e10cSrcweir case 1:
2073cdf0e10cSrcweir case LISTBOX_ENTRY_NOTFOUND:
2074cdf0e10cSrcweir aChangedAttr.nColor = COL_TRANSPARENT;
2075cdf0e10cSrcweir break;
2076cdf0e10cSrcweir default:
2077cdf0e10cSrcweir aChangedAttr.nColor = aChangedColorLB.GetEntryColor(nPos).GetColor();
2078cdf0e10cSrcweir break;
2079cdf0e10cSrcweir }
2080cdf0e10cSrcweir
2081cdf0e10cSrcweir pOpt->SetFormatAuthorAttr(aChangedAttr);
2082cdf0e10cSrcweir }
2083cdf0e10cSrcweir
2084cdf0e10cSrcweir nPos = 0;
2085cdf0e10cSrcweir switch (aMarkPosLB.GetSelectEntryPos())
2086cdf0e10cSrcweir {
2087cdf0e10cSrcweir case 0: nPos = text::HoriOrientation::NONE; break;
2088cdf0e10cSrcweir case 1: nPos = text::HoriOrientation::LEFT; break;
2089cdf0e10cSrcweir case 2: nPos = text::HoriOrientation::RIGHT; break;
2090cdf0e10cSrcweir case 3: nPos = text::HoriOrientation::OUTSIDE; break;
2091cdf0e10cSrcweir case 4: nPos = text::HoriOrientation::INSIDE; break;
2092cdf0e10cSrcweir }
2093cdf0e10cSrcweir pOpt->SetMarkAlignMode(nPos);
2094cdf0e10cSrcweir
2095cdf0e10cSrcweir pOpt->SetMarkAlignColor(aMarkColorLB.GetSelectEntryColor());
2096cdf0e10cSrcweir
2097cdf0e10cSrcweir if (!(aInsertedAttr == aOldInsertAttr) ||
2098cdf0e10cSrcweir !(aDeletedAttr == aOldDeletedAttr) ||
2099cdf0e10cSrcweir !(aChangedAttr == aOldChangedAttr) ||
2100cdf0e10cSrcweir nOldMarkColor != pOpt->GetMarkAlignColor().GetColor() ||
2101cdf0e10cSrcweir nOldMarkMode != pOpt->GetMarkAlignMode())
2102cdf0e10cSrcweir {
2103cdf0e10cSrcweir // Alle Dokumente aktualisieren
2104cdf0e10cSrcweir TypeId aType(TYPE(SwDocShell));
2105cdf0e10cSrcweir SwDocShell* pDocShell = (SwDocShell*)SfxObjectShell::GetFirst(&aType);
2106cdf0e10cSrcweir
2107cdf0e10cSrcweir while( pDocShell )
2108cdf0e10cSrcweir {
2109cdf0e10cSrcweir pDocShell->GetWrtShell()->UpdateRedlineAttr();
2110cdf0e10cSrcweir pDocShell = (SwDocShell*)SfxObjectShell::GetNext(*pDocShell, &aType);
2111cdf0e10cSrcweir }
2112cdf0e10cSrcweir }
2113cdf0e10cSrcweir
2114cdf0e10cSrcweir return sal_False;
2115cdf0e10cSrcweir }
2116cdf0e10cSrcweir
Reset(const SfxItemSet &)2117cdf0e10cSrcweir void SwRedlineOptionsTabPage::Reset( const SfxItemSet& )
2118cdf0e10cSrcweir {
2119cdf0e10cSrcweir const SwModuleOptions *pOpt = SW_MOD()->GetModuleConfig();
2120cdf0e10cSrcweir
2121cdf0e10cSrcweir const AuthorCharAttr &rInsertAttr = pOpt->GetInsertAuthorAttr();
2122cdf0e10cSrcweir const AuthorCharAttr &rDeletedAttr = pOpt->GetDeletedAuthorAttr();
2123cdf0e10cSrcweir const AuthorCharAttr &rChangedAttr = pOpt->GetFormatAuthorAttr();
2124cdf0e10cSrcweir
2125cdf0e10cSrcweir // Preview initialisieren
2126cdf0e10cSrcweir InitFontStyle(aInsertedPreviewWN);
2127cdf0e10cSrcweir InitFontStyle(aDeletedPreviewWN);
2128cdf0e10cSrcweir InitFontStyle(aChangedPreviewWN);
2129cdf0e10cSrcweir
2130cdf0e10cSrcweir // Farblistboxen initialisieren
2131cdf0e10cSrcweir String sColor;
2132cdf0e10cSrcweir aInsertColorLB.SetUpdateMode(sal_False);
2133cdf0e10cSrcweir aDeletedColorLB.SetUpdateMode(sal_False);
2134cdf0e10cSrcweir aChangedColorLB.SetUpdateMode(sal_False);
2135cdf0e10cSrcweir aMarkColorLB.SetUpdateMode(sal_False);
2136cdf0e10cSrcweir
2137cdf0e10cSrcweir aInsertColorLB.InsertEntry(sNone);
2138cdf0e10cSrcweir aDeletedColorLB.InsertEntry(sNone);
2139cdf0e10cSrcweir aChangedColorLB.InsertEntry(sNone);
2140cdf0e10cSrcweir
2141cdf0e10cSrcweir aInsertColorLB.InsertEntry(sAuthor);
2142cdf0e10cSrcweir aDeletedColorLB.InsertEntry(sAuthor);
2143cdf0e10cSrcweir aChangedColorLB.InsertEntry(sAuthor);
2144cdf0e10cSrcweir
2145c7be74b1SArmin Le Grand XColorListSharedPtr aColorTbl = XColorList::GetStdColorList();
2146cdf0e10cSrcweir sal_uInt16 i;
2147c7be74b1SArmin Le Grand for( i = 0; i < aColorTbl->Count(); ++i )
2148cdf0e10cSrcweir {
2149c7be74b1SArmin Le Grand XColorEntry* pEntry = aColorTbl->GetColor( i );
2150cdf0e10cSrcweir Color aColor = pEntry->GetColor();
2151cdf0e10cSrcweir String sName = pEntry->GetName();
2152cdf0e10cSrcweir
2153cdf0e10cSrcweir aInsertColorLB.InsertEntry( aColor, sName );
2154cdf0e10cSrcweir aDeletedColorLB.InsertEntry( aColor, sName );
2155cdf0e10cSrcweir aChangedColorLB.InsertEntry( aColor, sName );
2156cdf0e10cSrcweir aMarkColorLB.InsertEntry( aColor, sName );
2157cdf0e10cSrcweir }
2158cdf0e10cSrcweir aInsertColorLB.SetUpdateMode( sal_True );
2159cdf0e10cSrcweir aDeletedColorLB.SetUpdateMode( sal_True );
2160cdf0e10cSrcweir aChangedColorLB.SetUpdateMode( sal_True );
2161cdf0e10cSrcweir aMarkColorLB.SetUpdateMode( sal_True );
2162cdf0e10cSrcweir
2163cdf0e10cSrcweir ColorData nColor = rInsertAttr.nColor;
2164cdf0e10cSrcweir
2165cdf0e10cSrcweir switch (nColor)
2166cdf0e10cSrcweir {
2167cdf0e10cSrcweir case COL_TRANSPARENT:
2168cdf0e10cSrcweir aInsertColorLB.SelectEntryPos(1);
2169cdf0e10cSrcweir break;
2170cdf0e10cSrcweir case COL_NONE:
2171cdf0e10cSrcweir aInsertColorLB.SelectEntryPos(0);
2172cdf0e10cSrcweir break;
2173cdf0e10cSrcweir default:
2174cdf0e10cSrcweir aInsertColorLB.SelectEntry(Color(nColor));
2175cdf0e10cSrcweir }
2176cdf0e10cSrcweir
2177cdf0e10cSrcweir nColor = rDeletedAttr.nColor;
2178cdf0e10cSrcweir
2179cdf0e10cSrcweir switch (nColor)
2180cdf0e10cSrcweir {
2181cdf0e10cSrcweir case COL_TRANSPARENT:
2182cdf0e10cSrcweir aDeletedColorLB.SelectEntryPos(1);
2183cdf0e10cSrcweir break;
2184cdf0e10cSrcweir case COL_NONE:
2185cdf0e10cSrcweir aDeletedColorLB.SelectEntryPos(0);
2186cdf0e10cSrcweir break;
2187cdf0e10cSrcweir default:
2188cdf0e10cSrcweir aDeletedColorLB.SelectEntry(Color(nColor));
2189cdf0e10cSrcweir }
2190cdf0e10cSrcweir
2191cdf0e10cSrcweir nColor = rChangedAttr.nColor;
2192cdf0e10cSrcweir
2193cdf0e10cSrcweir switch (nColor)
2194cdf0e10cSrcweir {
2195cdf0e10cSrcweir case COL_TRANSPARENT:
2196cdf0e10cSrcweir aChangedColorLB.SelectEntryPos(1);
2197cdf0e10cSrcweir break;
2198cdf0e10cSrcweir case COL_NONE:
2199cdf0e10cSrcweir aChangedColorLB.SelectEntryPos(0);
2200cdf0e10cSrcweir break;
2201cdf0e10cSrcweir default:
2202cdf0e10cSrcweir aChangedColorLB.SelectEntry(Color(nColor));
2203cdf0e10cSrcweir }
2204cdf0e10cSrcweir
2205cdf0e10cSrcweir aMarkColorLB.SelectEntry(pOpt->GetMarkAlignColor());
2206cdf0e10cSrcweir
2207cdf0e10cSrcweir aInsertLB.SelectEntryPos(0);
2208cdf0e10cSrcweir aDeletedLB.SelectEntryPos(0);
2209cdf0e10cSrcweir aChangedLB.SelectEntryPos(0);
2210*5ba3629cSmseidel
2211cdf0e10cSrcweir lcl_FillRedlineAttrListBox(aInsertLB, rInsertAttr, aInsertAttrMap,
2212cdf0e10cSrcweir sizeof(aInsertAttrMap) / sizeof(sal_uInt16));
2213cdf0e10cSrcweir lcl_FillRedlineAttrListBox(aDeletedLB, rDeletedAttr, aDeletedAttrMap,
2214cdf0e10cSrcweir sizeof(aDeletedAttrMap) / sizeof(sal_uInt16));
2215cdf0e10cSrcweir lcl_FillRedlineAttrListBox(aChangedLB, rChangedAttr, aChangedAttrMap,
2216cdf0e10cSrcweir sizeof(aChangedAttrMap) / sizeof(sal_uInt16));
2217*5ba3629cSmseidel
2218cdf0e10cSrcweir sal_uInt16 nPos = 0;
2219cdf0e10cSrcweir switch (pOpt->GetMarkAlignMode())
2220cdf0e10cSrcweir {
2221cdf0e10cSrcweir case text::HoriOrientation::NONE: nPos = 0; break;
2222cdf0e10cSrcweir case text::HoriOrientation::LEFT: nPos = 1; break;
2223cdf0e10cSrcweir case text::HoriOrientation::RIGHT: nPos = 2; break;
2224cdf0e10cSrcweir case text::HoriOrientation::OUTSIDE: nPos = 3; break;
2225cdf0e10cSrcweir case text::HoriOrientation::INSIDE: nPos = 4; break;
2226cdf0e10cSrcweir }
2227cdf0e10cSrcweir aMarkPosLB.SelectEntryPos(nPos);
2228cdf0e10cSrcweir
2229cdf0e10cSrcweir // Einstellungen in Preview anzeigen
2230cdf0e10cSrcweir AttribHdl(&aInsertLB);
2231cdf0e10cSrcweir ColorHdl(&aInsertColorLB);
2232cdf0e10cSrcweir AttribHdl(&aDeletedLB);
2233cdf0e10cSrcweir ColorHdl(&aInsertColorLB);
2234cdf0e10cSrcweir AttribHdl(&aChangedLB);
2235cdf0e10cSrcweir ColorHdl(&aChangedColorLB);
2236cdf0e10cSrcweir
2237cdf0e10cSrcweir ChangedMaskPrevHdl();
2238cdf0e10cSrcweir }
2239cdf0e10cSrcweir
IMPL_LINK(SwRedlineOptionsTabPage,AttribHdl,ListBox *,pLB)2240cdf0e10cSrcweir IMPL_LINK( SwRedlineOptionsTabPage, AttribHdl, ListBox *, pLB )
2241cdf0e10cSrcweir {
2242cdf0e10cSrcweir SvxFontPrevWindow *pPrev = 0;
2243cdf0e10cSrcweir ColorListBox *pColorLB;
2244cdf0e10cSrcweir
2245cdf0e10cSrcweir if (pLB == &aInsertLB)
2246cdf0e10cSrcweir {
2247cdf0e10cSrcweir pColorLB = &aInsertColorLB;
2248cdf0e10cSrcweir pPrev = &aInsertedPreviewWN;
2249cdf0e10cSrcweir }
2250cdf0e10cSrcweir else if (pLB == &aDeletedLB)
2251cdf0e10cSrcweir {
2252cdf0e10cSrcweir pColorLB = &aDeletedColorLB;
2253cdf0e10cSrcweir pPrev = &aDeletedPreviewWN;
2254cdf0e10cSrcweir }
2255cdf0e10cSrcweir else
2256cdf0e10cSrcweir {
2257cdf0e10cSrcweir pColorLB = &aChangedColorLB;
2258cdf0e10cSrcweir pPrev = &aChangedPreviewWN;
2259cdf0e10cSrcweir }
2260cdf0e10cSrcweir
2261cdf0e10cSrcweir SvxFont& rFont = pPrev->GetFont();
2262cdf0e10cSrcweir SvxFont& rCJKFont = pPrev->GetCJKFont();
2263cdf0e10cSrcweir
2264cdf0e10cSrcweir rFont.SetWeight(WEIGHT_NORMAL);
2265cdf0e10cSrcweir rCJKFont.SetWeight(WEIGHT_NORMAL);
2266cdf0e10cSrcweir rFont.SetItalic(ITALIC_NONE);
2267cdf0e10cSrcweir rCJKFont.SetItalic(ITALIC_NONE);
2268cdf0e10cSrcweir rFont.SetUnderline(UNDERLINE_NONE);
2269cdf0e10cSrcweir rCJKFont.SetUnderline(UNDERLINE_NONE);
2270cdf0e10cSrcweir rFont.SetStrikeout(STRIKEOUT_NONE);
2271cdf0e10cSrcweir rCJKFont.SetStrikeout(STRIKEOUT_NONE);
2272cdf0e10cSrcweir rFont.SetCaseMap(SVX_CASEMAP_NOT_MAPPED);
2273cdf0e10cSrcweir rCJKFont.SetCaseMap(SVX_CASEMAP_NOT_MAPPED);
2274cdf0e10cSrcweir
2275cdf0e10cSrcweir sal_uInt16 nPos = pColorLB->GetSelectEntryPos();
2276cdf0e10cSrcweir
2277cdf0e10cSrcweir switch( nPos )
2278cdf0e10cSrcweir {
2279cdf0e10cSrcweir case 0:
2280cdf0e10cSrcweir rFont.SetColor( Color( COL_BLACK ) );
2281cdf0e10cSrcweir rCJKFont.SetColor( Color( COL_BLACK ) );
2282cdf0e10cSrcweir break;
2283cdf0e10cSrcweir case 1:
2284cdf0e10cSrcweir case LISTBOX_ENTRY_NOTFOUND:
2285cdf0e10cSrcweir rFont.SetColor( Color( COL_RED ) );
2286cdf0e10cSrcweir rCJKFont.SetColor( Color( COL_RED ) );
2287cdf0e10cSrcweir break;
2288cdf0e10cSrcweir default:
2289cdf0e10cSrcweir rFont.SetColor( pColorLB->GetEntryColor( nPos ) );
2290cdf0e10cSrcweir rCJKFont.SetColor( pColorLB->GetEntryColor( nPos ) );
2291cdf0e10cSrcweir break;
2292cdf0e10cSrcweir }
2293cdf0e10cSrcweir
2294cdf0e10cSrcweir nPos = pLB->GetSelectEntryPos();
2295cdf0e10cSrcweir if( nPos == LISTBOX_ENTRY_NOTFOUND )
2296cdf0e10cSrcweir nPos = 0;
2297cdf0e10cSrcweir
2298cdf0e10cSrcweir CharAttr* pAttr = ( CharAttr* ) pLB->GetEntryData( nPos );
2299cdf0e10cSrcweir //switch off preview background color
2300cdf0e10cSrcweir pPrev->ResetColor();
2301cdf0e10cSrcweir switch (pAttr->nItemId)
2302cdf0e10cSrcweir {
2303cdf0e10cSrcweir case SID_ATTR_CHAR_WEIGHT:
2304cdf0e10cSrcweir rFont.SetWeight( ( FontWeight ) pAttr->nAttr );
2305cdf0e10cSrcweir rCJKFont.SetWeight( ( FontWeight ) pAttr->nAttr );
2306cdf0e10cSrcweir break;
2307cdf0e10cSrcweir
2308cdf0e10cSrcweir case SID_ATTR_CHAR_POSTURE:
2309cdf0e10cSrcweir rFont.SetItalic( ( FontItalic ) pAttr->nAttr );
2310cdf0e10cSrcweir rCJKFont.SetItalic( ( FontItalic ) pAttr->nAttr );
2311cdf0e10cSrcweir break;
2312cdf0e10cSrcweir
2313cdf0e10cSrcweir case SID_ATTR_CHAR_UNDERLINE:
2314cdf0e10cSrcweir rFont.SetUnderline( ( FontUnderline ) pAttr->nAttr );
2315cdf0e10cSrcweir rCJKFont.SetUnderline( ( FontUnderline ) pAttr->nAttr );
2316cdf0e10cSrcweir break;
2317cdf0e10cSrcweir
2318cdf0e10cSrcweir case SID_ATTR_CHAR_STRIKEOUT:
2319cdf0e10cSrcweir rFont.SetStrikeout( ( FontStrikeout ) pAttr->nAttr );
2320cdf0e10cSrcweir rCJKFont.SetStrikeout( ( FontStrikeout ) pAttr->nAttr );
2321cdf0e10cSrcweir break;
2322cdf0e10cSrcweir
2323cdf0e10cSrcweir case SID_ATTR_CHAR_CASEMAP:
2324cdf0e10cSrcweir rFont.SetCaseMap( ( SvxCaseMap ) pAttr->nAttr );
2325cdf0e10cSrcweir rCJKFont.SetCaseMap( ( SvxCaseMap ) pAttr->nAttr );
2326cdf0e10cSrcweir break;
2327cdf0e10cSrcweir
2328cdf0e10cSrcweir case SID_ATTR_BRUSH:
2329cdf0e10cSrcweir {
2330cdf0e10cSrcweir nPos = pColorLB->GetSelectEntryPos();
2331cdf0e10cSrcweir if( nPos )
2332cdf0e10cSrcweir pPrev->SetColor( pColorLB->GetSelectEntryColor() );
2333cdf0e10cSrcweir else
2334cdf0e10cSrcweir pPrev->SetColor( Color( COL_LIGHTGRAY ) );
2335cdf0e10cSrcweir
2336cdf0e10cSrcweir rFont.SetColor( Color( COL_BLACK ) );
2337cdf0e10cSrcweir rCJKFont.SetColor( Color( COL_BLACK ) );
2338cdf0e10cSrcweir }
2339cdf0e10cSrcweir break;
2340cdf0e10cSrcweir }
2341cdf0e10cSrcweir
2342cdf0e10cSrcweir pPrev->Invalidate();
2343cdf0e10cSrcweir
2344cdf0e10cSrcweir return 0;
2345cdf0e10cSrcweir }
2346cdf0e10cSrcweir
IMPL_LINK(SwRedlineOptionsTabPage,ColorHdl,ColorListBox *,pColorLB)2347cdf0e10cSrcweir IMPL_LINK( SwRedlineOptionsTabPage, ColorHdl, ColorListBox *, pColorLB )
2348cdf0e10cSrcweir {
2349cdf0e10cSrcweir SvxFontPrevWindow *pPrev = 0;
2350cdf0e10cSrcweir ListBox* pLB;
2351cdf0e10cSrcweir
2352cdf0e10cSrcweir if (pColorLB == &aInsertColorLB)
2353cdf0e10cSrcweir {
2354cdf0e10cSrcweir pLB = &aInsertLB;
2355cdf0e10cSrcweir pPrev = &aInsertedPreviewWN;
2356cdf0e10cSrcweir }
2357cdf0e10cSrcweir else if (pColorLB == &aDeletedColorLB)
2358cdf0e10cSrcweir {
2359cdf0e10cSrcweir pLB = &aDeletedLB;
2360cdf0e10cSrcweir pPrev = &aDeletedPreviewWN;
2361cdf0e10cSrcweir }
2362cdf0e10cSrcweir else
2363cdf0e10cSrcweir {
2364cdf0e10cSrcweir pLB = &aChangedLB;
2365cdf0e10cSrcweir pPrev = &aChangedPreviewWN;
2366cdf0e10cSrcweir }
2367cdf0e10cSrcweir
2368cdf0e10cSrcweir SvxFont& rFont = pPrev->GetFont();
2369cdf0e10cSrcweir SvxFont& rCJKFont = pPrev->GetCJKFont();
2370cdf0e10cSrcweir sal_uInt16 nPos = pLB->GetSelectEntryPos();
2371cdf0e10cSrcweir if( nPos == LISTBOX_ENTRY_NOTFOUND )
2372cdf0e10cSrcweir nPos = 0;
2373cdf0e10cSrcweir
2374cdf0e10cSrcweir CharAttr* pAttr = ( CharAttr* ) pLB->GetEntryData( nPos );
2375cdf0e10cSrcweir
2376cdf0e10cSrcweir if( pAttr->nItemId == SID_ATTR_BRUSH )
2377cdf0e10cSrcweir {
2378cdf0e10cSrcweir rFont.SetColor( Color( COL_BLACK ) );
2379cdf0e10cSrcweir rCJKFont.SetColor( Color( COL_BLACK ) );
2380cdf0e10cSrcweir nPos = pColorLB->GetSelectEntryPos();
2381cdf0e10cSrcweir if( nPos && nPos != LISTBOX_ENTRY_NOTFOUND )
2382cdf0e10cSrcweir pPrev->SetColor( pColorLB->GetSelectEntryColor() );
2383cdf0e10cSrcweir else
2384cdf0e10cSrcweir pPrev->SetColor( Color( COL_LIGHTGRAY ) );
2385cdf0e10cSrcweir }
2386cdf0e10cSrcweir else
2387cdf0e10cSrcweir {
2388cdf0e10cSrcweir nPos = pColorLB->GetSelectEntryPos();
2389cdf0e10cSrcweir
2390cdf0e10cSrcweir switch( nPos )
2391cdf0e10cSrcweir {
2392cdf0e10cSrcweir case 0:
2393cdf0e10cSrcweir rFont.SetColor( Color( COL_BLACK ) );
2394cdf0e10cSrcweir rCJKFont.SetColor( Color( COL_BLACK ) );
2395cdf0e10cSrcweir break;
2396cdf0e10cSrcweir case 1:
2397cdf0e10cSrcweir case LISTBOX_ENTRY_NOTFOUND:
2398cdf0e10cSrcweir rFont.SetColor( Color( COL_RED ) );
2399cdf0e10cSrcweir rCJKFont.SetColor( Color( COL_RED ) );
2400cdf0e10cSrcweir break;
2401cdf0e10cSrcweir default:
2402cdf0e10cSrcweir rFont.SetColor( pColorLB->GetEntryColor( nPos ) );
2403cdf0e10cSrcweir rCJKFont.SetColor( pColorLB->GetEntryColor( nPos ) );
2404cdf0e10cSrcweir break;
2405cdf0e10cSrcweir }
2406cdf0e10cSrcweir }
2407cdf0e10cSrcweir
2408cdf0e10cSrcweir pPrev->Invalidate();
2409cdf0e10cSrcweir
2410cdf0e10cSrcweir return 0;
2411cdf0e10cSrcweir }
2412cdf0e10cSrcweir
IMPL_LINK(SwRedlineOptionsTabPage,ChangedMaskPrevHdl,ListBox *,EMPTYARG)2413cdf0e10cSrcweir IMPL_LINK( SwRedlineOptionsTabPage, ChangedMaskPrevHdl, ListBox *, EMPTYARG )
2414cdf0e10cSrcweir {
2415cdf0e10cSrcweir aMarkPreviewWN.SetMarkPos(aMarkPosLB.GetSelectEntryPos());
2416cdf0e10cSrcweir aMarkPreviewWN.SetColor(aMarkColorLB.GetSelectEntryColor().GetColor());
2417cdf0e10cSrcweir
2418cdf0e10cSrcweir aMarkPreviewWN.Invalidate();
2419cdf0e10cSrcweir
2420cdf0e10cSrcweir return 0;
2421cdf0e10cSrcweir }
2422cdf0e10cSrcweir
InitFontStyle(SvxFontPrevWindow & rExampleWin)2423cdf0e10cSrcweir void SwRedlineOptionsTabPage::InitFontStyle(SvxFontPrevWindow& rExampleWin)
2424cdf0e10cSrcweir {
2425cdf0e10cSrcweir const AllSettings& rAllSettings = Application::GetSettings();
2426cdf0e10cSrcweir LanguageType eLangType = rAllSettings.GetUILanguage();
2427cdf0e10cSrcweir Color aBackCol( rAllSettings.GetStyleSettings().GetWindowColor() );
2428cdf0e10cSrcweir SvxFont& rFont = rExampleWin.GetFont();
2429cdf0e10cSrcweir SvxFont& rCJKFont = rExampleWin.GetCJKFont();
2430cdf0e10cSrcweir SvxFont& rCTLFont = rExampleWin.GetCTLFont();
2431cdf0e10cSrcweir
2432cdf0e10cSrcweir Font aFont( OutputDevice::GetDefaultFont( DEFAULTFONT_SERIF, eLangType,
2433cdf0e10cSrcweir DEFAULTFONT_FLAGS_ONLYONE, &rExampleWin ) );
2434cdf0e10cSrcweir Font aCJKFont( OutputDevice::GetDefaultFont( DEFAULTFONT_CJK_TEXT, eLangType,
2435cdf0e10cSrcweir DEFAULTFONT_FLAGS_ONLYONE, &rExampleWin ) );
2436cdf0e10cSrcweir Font aCTLFont( OutputDevice::GetDefaultFont( DEFAULTFONT_CTL_TEXT, eLangType,
2437cdf0e10cSrcweir DEFAULTFONT_FLAGS_ONLYONE, &rExampleWin ) );
2438cdf0e10cSrcweir const Size aDefSize( 0, 12 );
2439cdf0e10cSrcweir aFont.SetSize( aDefSize );
2440cdf0e10cSrcweir aCJKFont.SetSize( aDefSize );
2441cdf0e10cSrcweir aCTLFont.SetSize( aDefSize );
2442cdf0e10cSrcweir
2443cdf0e10cSrcweir aFont.SetFillColor( aBackCol );
2444cdf0e10cSrcweir aCJKFont.SetFillColor( aBackCol );
2445cdf0e10cSrcweir aCTLFont.SetFillColor( aBackCol );
2446cdf0e10cSrcweir
2447cdf0e10cSrcweir aFont.SetWeight( WEIGHT_NORMAL );
2448cdf0e10cSrcweir aCJKFont.SetWeight( WEIGHT_NORMAL );
2449cdf0e10cSrcweir aCTLFont.SetWeight( WEIGHT_NORMAL );
2450cdf0e10cSrcweir
2451cdf0e10cSrcweir rFont = aFont;
2452cdf0e10cSrcweir rCJKFont = aCJKFont;
2453cdf0e10cSrcweir rCTLFont = aCTLFont;
2454cdf0e10cSrcweir
2455cdf0e10cSrcweir const Size aNewSize( 0, rExampleWin.GetOutputSize().Height() * 2 / 3 );
2456cdf0e10cSrcweir rFont.SetSize( aNewSize );
2457cdf0e10cSrcweir rCJKFont.SetSize( aNewSize );
2458cdf0e10cSrcweir
2459cdf0e10cSrcweir rExampleWin.SetFont( rFont, rCJKFont,rCTLFont );
2460cdf0e10cSrcweir
2461cdf0e10cSrcweir rExampleWin.UseResourceText();
2462cdf0e10cSrcweir
2463cdf0e10cSrcweir Wallpaper aWall( aBackCol );
2464cdf0e10cSrcweir rExampleWin.SetBackground( aWall );
2465cdf0e10cSrcweir rExampleWin.Invalidate();
2466cdf0e10cSrcweir }
2467cdf0e10cSrcweir
2468cdf0e10cSrcweir
2469cdf0e10cSrcweir #ifdef DBG_UTIL
2470cdf0e10cSrcweir /*******************************************************
2471cdf0e10cSrcweir ******************************************************/
2472cdf0e10cSrcweir /*----------------- OS 11.01.95 -----------------------
2473cdf0e10cSrcweir TabPage Testeinstellungen
2474cdf0e10cSrcweir -------------------------------------------------------*/
2475cdf0e10cSrcweir
lcl_SetPosSize(Window & rWin,Point aPos,Size aSize)2476cdf0e10cSrcweir void lcl_SetPosSize(Window& rWin, Point aPos, Size aSize)
2477cdf0e10cSrcweir {
2478cdf0e10cSrcweir aPos = rWin.LogicToPixel(aPos, MAP_APPFONT);
2479cdf0e10cSrcweir aSize = rWin.OutputDevice::LogicToPixel(aSize, MAP_APPFONT);
2480cdf0e10cSrcweir rWin.SetPosSizePixel(aPos, aSize);
2481cdf0e10cSrcweir }
2482cdf0e10cSrcweir
SwTestTabPage(Window * pParent,const SfxItemSet & rCoreSet)2483cdf0e10cSrcweir SwTestTabPage::SwTestTabPage( Window* pParent,
2484cdf0e10cSrcweir const SfxItemSet& rCoreSet) :
2485cdf0e10cSrcweir SfxTabPage( pParent, WB_HIDE, rCoreSet),
2486cdf0e10cSrcweir aTestFL ( this, WB_GROUP ),
2487cdf0e10cSrcweir aTest1CBox ( this, 0 ),
2488cdf0e10cSrcweir aTest2CBox ( this, 0 ),
2489cdf0e10cSrcweir aTest3CBox ( this, 0 ),
2490cdf0e10cSrcweir aTest4CBox ( this, 0 ),
2491cdf0e10cSrcweir aTest5CBox ( this, 0 ),
2492cdf0e10cSrcweir aTest6CBox ( this, 0 ),
2493cdf0e10cSrcweir aTest7CBox ( this, 0 ),
2494cdf0e10cSrcweir aTest8CBox ( this, 0 ),
2495cdf0e10cSrcweir aTest9CBox ( this, 0 ),
2496cdf0e10cSrcweir aTest10CBox ( this, 0 ),
2497cdf0e10cSrcweir bAttrModified( sal_False )
2498cdf0e10cSrcweir {
2499cdf0e10cSrcweir lcl_SetPosSize(*this, Point(0,0), Size(260 , 135));
2500cdf0e10cSrcweir lcl_SetPosSize(aTestFL, Point(6,2), Size(209,8));
2501cdf0e10cSrcweir lcl_SetPosSize(aTest1CBox , Point(12 , 14), Size(74 , 10));
2502cdf0e10cSrcweir lcl_SetPosSize(aTest2CBox , Point(12 , 27), Size(74 , 10));
2503cdf0e10cSrcweir lcl_SetPosSize(aTest3CBox , Point(12 , 40), Size(74 , 10));
2504cdf0e10cSrcweir lcl_SetPosSize(aTest4CBox , Point(12 , 53), Size(74 , 10));
2505cdf0e10cSrcweir lcl_SetPosSize(aTest5CBox , Point(12 , 66), Size(74 , 10));
2506cdf0e10cSrcweir lcl_SetPosSize(aTest6CBox , Point(116, 14), Size(74 , 10));
2507cdf0e10cSrcweir lcl_SetPosSize(aTest7CBox , Point(116, 27), Size(74 , 10));
2508cdf0e10cSrcweir lcl_SetPosSize(aTest8CBox , Point(116, 40), Size(74 , 10));
2509cdf0e10cSrcweir lcl_SetPosSize(aTest9CBox , Point(116, 53), Size(74 , 10));
2510cdf0e10cSrcweir lcl_SetPosSize(aTest10CBox , Point(116, 66), Size(74 , 10));
2511cdf0e10cSrcweir
2512cdf0e10cSrcweir aTestFL.SetText( String(ByteString("Einstellungen nur f\xFCr Testzwecke" ), RTL_TEXTENCODING_MS_1252));
2513cdf0e10cSrcweir aTest1CBox .SetText( C2S("unused"));
2514cdf0e10cSrcweir aTest2CBox .SetText( C2S("dynamic"));
2515cdf0e10cSrcweir aTest3CBox .SetText( C2S("No calm" ));
2516cdf0e10cSrcweir aTest4CBox .SetText( C2S("WYSIWYG debug" ));
2517cdf0e10cSrcweir aTest5CBox .SetText( C2S("No idle format" ));
2518cdf0e10cSrcweir aTest6CBox .SetText( C2S("No screen adj" ));
2519cdf0e10cSrcweir aTest7CBox .SetText( C2S("win format" ));
2520cdf0e10cSrcweir aTest8CBox .SetText( C2S("No Scroll" ));
2521cdf0e10cSrcweir aTest9CBox .SetText( C2S("DrawingLayerNotLoading"));
2522cdf0e10cSrcweir aTest10CBox.SetText( C2S("AutoFormat by Input" ));
2523cdf0e10cSrcweir aTestFL.Show();
2524cdf0e10cSrcweir aTest1CBox .Show();
2525cdf0e10cSrcweir aTest2CBox .Show();
2526cdf0e10cSrcweir aTest3CBox .Show();
2527cdf0e10cSrcweir aTest4CBox .Show();
2528cdf0e10cSrcweir aTest5CBox .Show();
2529cdf0e10cSrcweir aTest6CBox .Show();
2530cdf0e10cSrcweir aTest7CBox .Show();
2531cdf0e10cSrcweir aTest8CBox .Show();
2532cdf0e10cSrcweir aTest9CBox .Show();
2533cdf0e10cSrcweir aTest10CBox.Show();
2534cdf0e10cSrcweir Init();
2535cdf0e10cSrcweir
2536cdf0e10cSrcweir }
2537cdf0e10cSrcweir
2538cdf0e10cSrcweir
2539cdf0e10cSrcweir //------------------------------------------------------------------------
2540cdf0e10cSrcweir
2541cdf0e10cSrcweir
Create(Window * pParent,const SfxItemSet & rAttrSet)2542cdf0e10cSrcweir SfxTabPage* SwTestTabPage::Create( Window* pParent,
2543cdf0e10cSrcweir const SfxItemSet& rAttrSet )
2544cdf0e10cSrcweir {
2545cdf0e10cSrcweir return ( new SwTestTabPage( pParent, rAttrSet ) );
2546cdf0e10cSrcweir }
2547cdf0e10cSrcweir //------------------------------------------------------------------------
2548cdf0e10cSrcweir
2549cdf0e10cSrcweir
FillItemSet(SfxItemSet & rCoreSet)2550cdf0e10cSrcweir sal_Bool SwTestTabPage::FillItemSet( SfxItemSet& rCoreSet )
2551cdf0e10cSrcweir {
2552cdf0e10cSrcweir
2553cdf0e10cSrcweir if ( bAttrModified )
2554cdf0e10cSrcweir {
2555cdf0e10cSrcweir SwTestItem aTestItem(FN_PARAM_SWTEST);
2556cdf0e10cSrcweir aTestItem.bTest1=aTest1CBox.IsChecked();
2557cdf0e10cSrcweir aTestItem.bTest2=aTest2CBox.IsChecked();
2558cdf0e10cSrcweir aTestItem.bTest3=aTest3CBox.IsChecked();
2559cdf0e10cSrcweir aTestItem.bTest4=aTest4CBox.IsChecked();
2560cdf0e10cSrcweir aTestItem.bTest5=aTest5CBox.IsChecked();
2561cdf0e10cSrcweir aTestItem.bTest6=aTest6CBox.IsChecked();
2562cdf0e10cSrcweir aTestItem.bTest7=aTest7CBox.IsChecked();
2563cdf0e10cSrcweir aTestItem.bTest8=aTest8CBox.IsChecked();
2564cdf0e10cSrcweir aTestItem.bTest9=aTest9CBox.IsChecked();
2565cdf0e10cSrcweir aTestItem.bTest10=aTest10CBox.IsChecked();
2566cdf0e10cSrcweir rCoreSet.Put(aTestItem);
2567cdf0e10cSrcweir }
2568cdf0e10cSrcweir return bAttrModified;
2569cdf0e10cSrcweir }
2570cdf0e10cSrcweir //------------------------------------------------------------------------
2571cdf0e10cSrcweir
2572cdf0e10cSrcweir
Reset(const SfxItemSet &)2573cdf0e10cSrcweir void SwTestTabPage::Reset( const SfxItemSet& )
2574cdf0e10cSrcweir {
2575cdf0e10cSrcweir const SfxItemSet& rSet = GetItemSet();
2576cdf0e10cSrcweir const SwTestItem* pTestAttr = 0;
2577cdf0e10cSrcweir
2578cdf0e10cSrcweir if( SFX_ITEM_SET == rSet.GetItemState( FN_PARAM_SWTEST , sal_False,
2579cdf0e10cSrcweir (const SfxPoolItem**)&pTestAttr ))
2580cdf0e10cSrcweir {
2581cdf0e10cSrcweir aTest1CBox.Check(pTestAttr->bTest1);
2582cdf0e10cSrcweir aTest2CBox.Check(pTestAttr->bTest2);
2583cdf0e10cSrcweir aTest3CBox.Check(pTestAttr->bTest3);
2584cdf0e10cSrcweir aTest4CBox.Check(pTestAttr->bTest4);
2585cdf0e10cSrcweir aTest5CBox.Check(pTestAttr->bTest5);
2586cdf0e10cSrcweir aTest6CBox.Check(pTestAttr->bTest6);
2587cdf0e10cSrcweir aTest7CBox.Check(pTestAttr->bTest7);
2588cdf0e10cSrcweir aTest8CBox.Check(pTestAttr->bTest8);
2589cdf0e10cSrcweir aTest9CBox.Check(pTestAttr->bTest9);
2590cdf0e10cSrcweir aTest10CBox.Check(pTestAttr->bTest10);
2591cdf0e10cSrcweir }
2592cdf0e10cSrcweir }
2593cdf0e10cSrcweir //------------------------------------------------------------------------
2594cdf0e10cSrcweir
2595cdf0e10cSrcweir
Init()2596cdf0e10cSrcweir void SwTestTabPage::Init()
2597cdf0e10cSrcweir {
2598cdf0e10cSrcweir // handler
2599cdf0e10cSrcweir Link aLk = LINK( this, SwTestTabPage, AutoClickHdl );
2600cdf0e10cSrcweir aTest1CBox.SetClickHdl( aLk );
2601cdf0e10cSrcweir aTest2CBox.SetClickHdl( aLk );
2602cdf0e10cSrcweir aTest3CBox.SetClickHdl( aLk );
2603cdf0e10cSrcweir aTest4CBox.SetClickHdl( aLk );
2604cdf0e10cSrcweir aTest5CBox.SetClickHdl( aLk );
2605cdf0e10cSrcweir aTest6CBox.SetClickHdl( aLk );
2606cdf0e10cSrcweir aTest7CBox.SetClickHdl( aLk );
2607cdf0e10cSrcweir aTest8CBox.SetClickHdl( aLk );
2608cdf0e10cSrcweir aTest9CBox.SetClickHdl( aLk );
2609cdf0e10cSrcweir aTest10CBox.SetClickHdl( aLk );
2610cdf0e10cSrcweir }
2611cdf0e10cSrcweir //------------------------------------------------------------------------
2612cdf0e10cSrcweir
2613cdf0e10cSrcweir
IMPL_LINK_INLINE_START(SwTestTabPage,AutoClickHdl,CheckBox *,EMPTYARG)2614cdf0e10cSrcweir IMPL_LINK_INLINE_START( SwTestTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
2615cdf0e10cSrcweir {
2616cdf0e10cSrcweir bAttrModified = sal_True;
2617cdf0e10cSrcweir return 0;
2618cdf0e10cSrcweir }
2619cdf0e10cSrcweir IMPL_LINK_INLINE_END( SwTestTabPage, AutoClickHdl, CheckBox *, EMPTYARG )
2620cdf0e10cSrcweir #endif
2621cdf0e10cSrcweir
2622