Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : :
29 : :
30 : : #include <hintids.hxx>
31 : :
32 : : #include <com/sun/star/i18n/TransliterationModules.hpp>
33 : : #include <com/sun/star/i18n/TransliterationModulesExtra.hpp>
34 : : #include <com/sun/star/i18n/TextConversionOption.hpp>
35 : : #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
36 : : #include <com/sun/star/lang/XInitialization.hpp>
37 : :
38 : : #include <tools/shl.hxx>
39 : : #include <i18npool/mslangid.hxx>
40 : : #include <sfx2/objface.hxx>
41 : : #include <sfx2/viewfrm.hxx>
42 : : #include <sfx2/bindings.hxx>
43 : : #include <sfx2/dispatch.hxx>
44 : : #include <sfx2/request.hxx>
45 : : #include <editeng/spltitem.hxx>
46 : : #include <editeng/orphitem.hxx>
47 : : #include <editeng/brkitem.hxx>
48 : : #include <editeng/widwitem.hxx>
49 : : #include <editeng/kernitem.hxx>
50 : : #include <editeng/escpitem.hxx>
51 : : #include <editeng/lspcitem.hxx>
52 : : #include <editeng/adjitem.hxx>
53 : : #include <editeng/crsditem.hxx>
54 : : #include <editeng/shdditem.hxx>
55 : : #include <editeng/hyznitem.hxx>
56 : : #include <editeng/udlnitem.hxx>
57 : : #include <editeng/fontitem.hxx>
58 : : #include <editeng/fhgtitem.hxx>
59 : : #include <svx/clipfmtitem.hxx>
60 : : #include <svl/stritem.hxx>
61 : : #include <svl/slstitm.hxx>
62 : : #include <editeng/colritem.hxx>
63 : : #include <editeng/wghtitem.hxx>
64 : : #include <editeng/cntritem.hxx>
65 : : #include <editeng/postitem.hxx>
66 : : #include <editeng/frmdiritem.hxx>
67 : : #include <svx/svdoutl.hxx>
68 : : #include <svl/whiter.hxx>
69 : : #include <svl/cjkoptions.hxx>
70 : : #include <svl/ctloptions.hxx>
71 : : #include <unotools/useroptions.hxx>
72 : : #include <vcl/msgbox.hxx>
73 : : #include <editeng/flditem.hxx>
74 : : #include <editeng/editstat.hxx>
75 : : #include <svx/hlnkitem.hxx>
76 : : #include <svx/htmlmode.hxx>
77 : : #include <editeng/langitem.hxx>
78 : : #include <editeng/unolingu.hxx>
79 : : #include <editeng/scripttypeitem.hxx>
80 : : #include <editeng/writingmodeitem.hxx>
81 : : #include <swundo.hxx>
82 : : #include <doc.hxx>
83 : : #include <viewopt.hxx>
84 : : #include <wrtsh.hxx>
85 : : #include <uitool.hxx>
86 : : #include <popup.hrc>
87 : : #include <pardlg.hxx>
88 : : #include <swdtflvr.hxx>
89 : : #include <drwtxtsh.hxx>
90 : : #include <swmodule.hxx>
91 : : #include <initui.hxx>
92 : : #include <edtwin.hxx>
93 : : #include <swwait.hxx>
94 : : #include <docstat.hxx>
95 : :
96 : : #include <cmdid.h>
97 : : #include <globals.hrc>
98 : : #include <shells.hrc>
99 : : #include <breakit.hxx>
100 : : #include "annotsh.hxx"
101 : : #include "view.hxx"
102 : : #include <PostItMgr.hxx>
103 : : #include <SidebarWin.hxx>
104 : :
105 : : #include "swtypes.hxx"
106 : :
107 : : #include <svx/svxdlg.hxx>
108 : : #include <svx/dialogs.hrc>
109 : :
110 : : #include <svx/svxids.hrc>
111 : : #include <svl/itempool.hxx>
112 : : #include <editeng/outliner.hxx>
113 : : #include <editeng/editeng.hxx>
114 : : #include <editeng/editview.hxx>
115 : :
116 : : #include <svl/languageoptions.hxx>
117 : : #include <svtools/langtab.hxx>
118 : :
119 : : #include <docsh.hxx>
120 : : #include <svl/undo.hxx>
121 : : #include "swabstdlg.hxx"
122 : : #include "chrdlg.hrc"
123 : : #include "misc.hrc"
124 : : #include <app.hrc>
125 : :
126 : : #include <comphelper/processfactory.hxx>
127 : : #include <comphelper/string.hxx>
128 : : #include <cppuhelper/bootstrap.hxx>
129 : :
130 : : #include <langhelper.hxx>
131 : :
132 : : #include <wordcountdialog.hxx>
133 : :
134 : : using namespace ::com::sun::star;
135 : : using namespace ::com::sun::star::uno;
136 : : using namespace ::com::sun::star::beans;
137 : : using namespace ::com::sun::star::i18n;
138 : :
139 : : #define SwAnnotationShell
140 : :
141 : : #include <sfx2/msg.hxx>
142 : : #include <swslots.hxx>
143 : :
144 [ + + ][ + - ]: 292 : SFX_IMPL_INTERFACE(SwAnnotationShell, SfxShell, SW_RES(STR_SHELLNAME_DRAW_TEXT))
[ + - ]
145 : : {
146 [ + - ][ + - ]: 73 : SFX_OBJECTBAR_REGISTRATION(SFX_OBJECTBAR_OBJECT, SW_RES(RID_TEXT_TOOLBOX));
147 [ + - ][ + - ]: 73 : SFX_POPUPMENU_REGISTRATION(SW_RES(MN_ANNOTATION_POPUPMENU));
148 : 73 : }
149 : :
150 [ # # ][ # # ]: 1147 : TYPEINIT1(SwAnnotationShell,SfxShell)
151 : :
152 : 0 : SwAnnotationShell::SwAnnotationShell( SwView& r )
153 : 0 : : rView(r)
154 : : {
155 : 0 : SwWrtShell &rSh = rView.GetWrtShell();
156 [ # # ][ # # ]: 0 : SetPool(rSh.GetAttrPool().GetSecondaryPool());
157 : 0 : }
158 : :
159 : 0 : SwAnnotationShell::~SwAnnotationShell()
160 : : {
161 [ # # ]: 0 : }
162 : :
163 : 0 : ::svl::IUndoManager* SwAnnotationShell::GetUndoManager()
164 : : {
165 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
166 [ # # ]: 0 : if ( !pPostItMgr ||
[ # # # # ]
167 : 0 : !pPostItMgr->HasActiveSidebarWin() )
168 : : {
169 : : OSL_ENSURE(pPostItMgr,"PostItMgr::Layout(): We are looping forever");
170 : 0 : return 0;
171 : : }
172 : 0 : return &pPostItMgr->GetActiveSidebarWin()->GetOutlinerView()->GetOutliner()->GetUndoManager();
173 : : }
174 : :
175 : 0 : void SwAnnotationShell::Exec( SfxRequest &rReq )
176 : : {
177 : : //TODO: clean this up!!!!
178 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
179 [ # # ][ # # ]: 0 : if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
[ # # ][ # # ]
180 : : return;
181 : :
182 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
183 [ # # ]: 0 : SfxItemSet aEditAttr(pOLV->GetAttribs());
184 [ # # ]: 0 : SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges());
185 : :
186 : 0 : sal_uInt16 nSlot = rReq.GetSlot();
187 [ # # ]: 0 : sal_uInt16 nWhich = GetPool().GetWhich(nSlot);
188 : 0 : const SfxItemSet *pNewAttrs = rReq.GetArgs();
189 : 0 : sal_uInt16 nEEWhich = 0;
190 [ # # # # : 0 : switch (nSlot)
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # #
# # # # ]
191 : : {
192 : : case SID_ATTR_CHAR_FONT:
193 : : case SID_ATTR_CHAR_FONTHEIGHT:
194 : : case SID_ATTR_CHAR_WEIGHT:
195 : : case SID_ATTR_CHAR_POSTURE:
196 : : {
197 [ # # ]: 0 : SfxItemPool* pSecondPool = aEditAttr.GetPool()->GetSecondaryPool();
198 [ # # ]: 0 : if( !pSecondPool )
199 : 0 : pSecondPool = aEditAttr.GetPool();
200 [ # # ]: 0 : SvxScriptSetItem aSetItem( nSlot, *pSecondPool );
201 [ # # ][ # # ]: 0 : aSetItem.PutItemForScriptType( pOLV->GetSelectedScriptType(), pNewAttrs->Get( nWhich ));
[ # # ]
202 [ # # ]: 0 : aNewAttr.Put( aSetItem.GetItemSet() );
203 [ # # ]: 0 : rReq.Done();
204 [ # # ]: 0 : break;
205 : : }
206 : 0 : case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
207 : : case SID_ATTR_CHAR_UNDERLINE:
208 : : {
209 [ # # ]: 0 : FontUnderline eFU = ((const SvxUnderlineItem&)aEditAttr.Get(EE_CHAR_UNDERLINE)).GetLineStyle();
210 [ # # ][ # # ]: 0 : aNewAttr.Put(SvxUnderlineItem(eFU == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_UNDERLINE));
[ # # ]
211 : 0 : break;
212 : : }
213 : : case SID_ATTR_CHAR_OVERLINE:
214 : : {
215 [ # # ]: 0 : FontUnderline eFO = ((const SvxOverlineItem&)aEditAttr.Get(EE_CHAR_OVERLINE)).GetLineStyle();
216 [ # # ][ # # ]: 0 : aNewAttr.Put(SvxOverlineItem(eFO == UNDERLINE_SINGLE ? UNDERLINE_NONE : UNDERLINE_SINGLE, EE_CHAR_OVERLINE));
[ # # ]
217 : 0 : break;
218 : : }
219 : 0 : case SID_ATTR_CHAR_CONTOUR: nEEWhich = EE_CHAR_OUTLINE; break;
220 : 0 : case SID_ATTR_CHAR_SHADOWED: nEEWhich = EE_CHAR_SHADOW; break;
221 : 0 : case SID_ATTR_CHAR_STRIKEOUT: nEEWhich = EE_CHAR_STRIKEOUT; break;
222 : 0 : case SID_ATTR_CHAR_WORDLINEMODE: nEEWhich = EE_CHAR_WLM; break;
223 : 0 : case SID_ATTR_CHAR_RELIEF : nEEWhich = EE_CHAR_RELIEF; break;
224 : 0 : case SID_ATTR_CHAR_LANGUAGE : nEEWhich = EE_CHAR_LANGUAGE;break;
225 : 0 : case SID_ATTR_CHAR_KERNING : nEEWhich = EE_CHAR_KERNING; break;
226 : 0 : case SID_ATTR_CHAR_SCALEWIDTH: nEEWhich = EE_CHAR_FONTWIDTH; break;
227 : 0 : case SID_ATTR_CHAR_AUTOKERN : nEEWhich = EE_CHAR_PAIRKERNING; break;
228 : 0 : case SID_ATTR_CHAR_ESCAPEMENT: nEEWhich = EE_CHAR_ESCAPEMENT; break;
229 : : case SID_ATTR_PARA_ADJUST_LEFT:
230 [ # # ][ # # ]: 0 : aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_LEFT, EE_PARA_JUST));
[ # # ]
231 : 0 : break;
232 : : case SID_ATTR_PARA_ADJUST_CENTER:
233 [ # # ][ # # ]: 0 : aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_CENTER, EE_PARA_JUST));
[ # # ]
234 : 0 : break;
235 : : case SID_ATTR_PARA_ADJUST_RIGHT:
236 [ # # ][ # # ]: 0 : aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_RIGHT, EE_PARA_JUST));
[ # # ]
237 : 0 : break;
238 : : case SID_ATTR_PARA_ADJUST_BLOCK:
239 [ # # ][ # # ]: 0 : aNewAttr.Put(SvxAdjustItem(SVX_ADJUST_BLOCK, EE_PARA_JUST));
[ # # ]
240 : 0 : break;
241 : :
242 : : case SID_ATTR_PARA_LINESPACE_10:
243 : : {
244 [ # # ]: 0 : SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_LINE, EE_PARA_SBL);
245 : 0 : aItem.SetPropLineSpace(100);
246 [ # # ][ # # ]: 0 : aNewAttr.Put(aItem);
247 : : }
248 : 0 : break;
249 : : case SID_ATTR_PARA_LINESPACE_15:
250 : : {
251 [ # # ]: 0 : SvxLineSpacingItem aItem(SVX_LINESPACE_ONE_POINT_FIVE_LINES, EE_PARA_SBL);
252 : 0 : aItem.SetPropLineSpace(150);
253 [ # # ][ # # ]: 0 : aNewAttr.Put(aItem);
254 : : }
255 : 0 : break;
256 : : case SID_ATTR_PARA_LINESPACE_20:
257 : : {
258 [ # # ]: 0 : SvxLineSpacingItem aItem(SVX_LINESPACE_TWO_LINES, EE_PARA_SBL);
259 : 0 : aItem.SetPropLineSpace(200);
260 [ # # ][ # # ]: 0 : aNewAttr.Put(aItem);
261 : : }
262 : 0 : break;
263 : : case SID_SELECTALL:
264 : : {
265 : 0 : Outliner * pOutliner = pOLV->GetOutliner();
266 [ # # ]: 0 : if(pOutliner)
267 : : {
268 [ # # ]: 0 : sal_uLong nParaCount = pOutliner->GetParagraphCount();
269 [ # # ]: 0 : if (nParaCount > 0)
270 [ # # ]: 0 : pOLV->SelectRange(0L, sal_uInt16(nParaCount) );
271 : : }
272 : 0 : break;
273 : : }
274 : : case FN_FORMAT_RESET:
275 : : {
276 [ # # ]: 0 : pPostItMgr->GetActiveSidebarWin()->ResetAttributes();
277 [ # # ]: 0 : rReq.Done();
278 : 0 : break;
279 : : }
280 : : case FN_SET_SUPER_SCRIPT:
281 : : {
282 [ # # ]: 0 : SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
283 : : SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
284 [ # # ][ # # ]: 0 : aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
285 : :
286 [ # # ]: 0 : if( eEsc == SVX_ESCAPEMENT_SUPERSCRIPT )
287 : 0 : aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
288 : : else
289 : 0 : aItem.SetEscapement( SVX_ESCAPEMENT_SUPERSCRIPT );
290 [ # # ][ # # ]: 0 : aNewAttr.Put( aItem, EE_CHAR_ESCAPEMENT );
291 : : }
292 : 0 : break;
293 : : case FN_SET_SUB_SCRIPT:
294 : : {
295 [ # # ]: 0 : SvxEscapementItem aItem(EE_CHAR_ESCAPEMENT);
296 : : SvxEscapement eEsc = (SvxEscapement ) ( (const SvxEscapementItem&)
297 [ # # ][ # # ]: 0 : aEditAttr.Get( EE_CHAR_ESCAPEMENT ) ).GetEnumValue();
298 : :
299 [ # # ]: 0 : if( eEsc == SVX_ESCAPEMENT_SUBSCRIPT )
300 : 0 : aItem.SetEscapement( SVX_ESCAPEMENT_OFF );
301 : : else
302 : 0 : aItem.SetEscapement( SVX_ESCAPEMENT_SUBSCRIPT );
303 [ # # ][ # # ]: 0 : aNewAttr.Put( aItem, EE_CHAR_ESCAPEMENT );
304 : : }
305 : 0 : break;
306 : : case SID_HYPERLINK_SETLINK:
307 : : {
308 : 0 : const SfxPoolItem* pItem = 0;
309 [ # # ]: 0 : if(pNewAttrs)
310 [ # # ]: 0 : pNewAttrs->GetItemState(nSlot, sal_False, &pItem);
311 : :
312 [ # # ]: 0 : if(pItem)
313 : : {
314 : 0 : const SvxHyperlinkItem& rHLinkItem = *(const SvxHyperlinkItem *)pItem;
315 [ # # ][ # # ]: 0 : SvxURLField aFld(rHLinkItem.GetURL(), rHLinkItem.GetName(), SVXURLFORMAT_APPDEFAULT);
[ # # ]
316 [ # # ]: 0 : aFld.SetTargetFrame(rHLinkItem.GetTargetFrame());
317 : :
318 [ # # ]: 0 : const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
319 : :
320 [ # # ][ # # ]: 0 : if (pFieldItem && pFieldItem->GetField()->ISA(SvxURLField))
[ # # ][ # # ]
[ # # ]
321 : : {
322 : : // Feld selektieren, so dass es beim Insert geloescht wird
323 [ # # ]: 0 : ESelection aSel = pOLV->GetSelection();
324 : 0 : aSel.nEndPos++;
325 [ # # ]: 0 : pOLV->SetSelection(aSel);
326 : : }
327 [ # # ]: 0 : if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
328 [ # # ][ # # ]: 0 : pOLV->InsertField(SvxFieldItem(aFld, EE_FEATURE_FIELD));
[ # # ][ # # ]
329 : : }
330 : : break;
331 : : }
332 : : case FN_INSERT_SOFT_HYPHEN:
333 : : case FN_INSERT_HARDHYPHEN:
334 : : case FN_INSERT_HARD_SPACE:
335 : : case SID_INSERT_RLM :
336 : : case SID_INSERT_LRM :
337 : : case SID_INSERT_ZWNBSP :
338 : : case SID_INSERT_ZWSP:
339 : : {
340 : 0 : sal_Unicode cIns = 0;
341 [ # # # # : 0 : switch(rReq.GetSlot())
# # # # ]
342 : : {
343 : 0 : case FN_INSERT_SOFT_HYPHEN: cIns = CHAR_SOFTHYPHEN; break;
344 : 0 : case FN_INSERT_HARDHYPHEN: cIns = CHAR_HARDHYPHEN; break;
345 : 0 : case FN_INSERT_HARD_SPACE: cIns = CHAR_HARDBLANK; break;
346 : 0 : case SID_INSERT_RLM : cIns = CHAR_RLM ; break;
347 : 0 : case SID_INSERT_LRM : cIns = CHAR_LRM ; break;
348 : 0 : case SID_INSERT_ZWSP : cIns = CHAR_ZWSP ; break;
349 : 0 : case SID_INSERT_ZWNBSP: cIns = CHAR_ZWNBSP; break;
350 : : }
351 [ # # ][ # # ]: 0 : pOLV->InsertText( rtl::OUString(cIns));
[ # # ]
352 [ # # ]: 0 : rReq.Done();
353 : 0 : break;
354 : : }
355 : : case SID_CHARMAP:
356 : : {
357 [ # # ]: 0 : if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
358 [ # # ]: 0 : InsertSymbol(rReq);
359 : 0 : break;
360 : : }
361 : : case FN_INSERT_STRING:
362 : : {
363 : 0 : const SfxPoolItem* pItem = 0;
364 [ # # ]: 0 : if(pNewAttrs)
365 [ # # ]: 0 : pNewAttrs->GetItemState(nSlot, sal_False, &pItem );
366 [ # # ]: 0 : if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
367 [ # # ]: 0 : pOLV->InsertText(((const SfxStringItem *)pItem)->GetValue());
368 : : break;
369 : : }
370 : :
371 : : case FN_FORMAT_FOOTNOTE_DLG:
372 : : {
373 [ # # ]: 0 : SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
374 : : OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
375 : :
376 [ # # ]: 0 : VclAbstractDialog* pDlg = pFact->CreateSwFootNoteOptionDlg( rView.GetWindow(), rView.GetWrtShell(), DLG_DOC_FOOTNOTE );
377 : : OSL_ENSURE(pDlg, "Dialogdiet fail!");
378 [ # # ]: 0 : pDlg->Execute();
379 [ # # ][ # # ]: 0 : delete pDlg;
380 : 0 : break;
381 : : }
382 : : case FN_NUMBERING_OUTLINE_DLG:
383 : : {
384 [ # # ]: 0 : SfxItemSet aTmp(GetPool(), FN_PARAM_1, FN_PARAM_1);
385 [ # # ]: 0 : SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
386 : : OSL_ENSURE(pFact, "Dialogdiet fail!");
387 : : SfxAbstractTabDialog* pDlg = pFact->CreateSwTabDialog( DLG_TAB_OUTLINE,
388 [ # # ]: 0 : rView.GetWindow(), &aTmp, rView.GetWrtShell());
389 : : OSL_ENSURE(pDlg, "Dialogdiet fail!");
390 [ # # ]: 0 : pDlg->Execute();
391 [ # # ][ # # ]: 0 : delete pDlg;
392 [ # # ][ # # ]: 0 : rReq.Done();
393 : : }
394 : 0 : break;
395 : : case SID_OPEN_XML_FILTERSETTINGS:
396 : : {
397 : : try
398 : : {
399 [ # # ][ # # ]: 0 : uno::Reference < ui::dialogs::XExecutableDialog > xDialog(::comphelper::getProcessServiceFactory()->createInstance(rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.ui.XSLTFilterDialog"))), uno::UNO_QUERY);
[ # # ][ # # ]
[ # # ]
400 [ # # ]: 0 : if( xDialog.is() )
401 : : {
402 [ # # ][ # # ]: 0 : xDialog->execute();
403 [ # # ]: 0 : }
404 : : }
405 [ # # ]: 0 : catch (const uno::Exception&)
406 : : {
407 : : }
408 [ # # ]: 0 : rReq.Ignore ();
409 : : }
410 : 0 : break;
411 : : case FN_WORDCOUNT_DIALOG:
412 : : {
413 : 0 : SfxViewFrame* pVFrame = rView.GetViewFrame();
414 [ # # ]: 0 : if (pVFrame != NULL)
415 : : {
416 [ # # ]: 0 : pVFrame->ToggleChildWindow(FN_WORDCOUNT_DIALOG);
417 [ # # ]: 0 : Invalidate(rReq.GetSlot());
418 : :
419 [ # # ][ # # ]: 0 : SwWordCountWrapper *pWrdCnt = (SwWordCountWrapper*)pVFrame->GetChildWindow(SwWordCountWrapper::GetChildWindowId());
420 [ # # ]: 0 : if (pWrdCnt)
421 [ # # ]: 0 : pWrdCnt->UpdateCounts();
422 : : }
423 : : }
424 : 0 : break;
425 : : case SID_CHAR_DLG:
426 : : {
427 : 0 : const SfxItemSet* pArgs = rReq.GetArgs();
428 : :
429 [ # # ]: 0 : if( !pArgs )
430 : : {
431 : : /* mod
432 : : SwView* pView = &GetView();
433 : : FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
434 : : SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric));
435 : : */
436 [ # # ]: 0 : SfxItemSet aDlgAttr(GetPool(), EE_ITEMS_START, EE_ITEMS_END);
437 : :
438 : : // util::Language gibts an der EditEngine nicht! Daher nicht im Set.
439 : :
440 [ # # ]: 0 : aDlgAttr.Put( aEditAttr );
441 [ # # ][ # # ]: 0 : aDlgAttr.Put( SvxKerningItem(0, RES_CHRATR_KERNING) );
[ # # ]
442 : :
443 [ # # ]: 0 : SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
444 : : OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
445 : :
446 [ # # ]: 0 : SfxAbstractTabDialog* pDlg = pFact->CreateSwCharDlg( rView.GetWindow(), rView, aDlgAttr, DLG_CHAR,0, sal_True );
447 : : OSL_ENSURE(pDlg, "Dialogdiet fail!");
448 [ # # ]: 0 : sal_uInt16 nRet = pDlg->Execute();
449 [ # # ]: 0 : if(RET_OK == nRet )
450 : : {
451 [ # # ][ # # ]: 0 : rReq.Done( *( pDlg->GetOutputItemSet() ) );
452 [ # # ][ # # ]: 0 : aNewAttr.Put(*pDlg->GetOutputItemSet());
453 : : }
454 [ # # ][ # # ]: 0 : delete( pDlg );
455 [ # # ]: 0 : if(RET_OK != nRet)
456 [ # # ][ # # ]: 0 : return ;
457 : : }
458 : : else
459 [ # # ]: 0 : aNewAttr.Put(*pArgs);
460 : 0 : break;
461 : : }
462 : : case SID_PARA_DLG:
463 : : {
464 : 0 : const SfxItemSet* pArgs = rReq.GetArgs();
465 : :
466 [ # # ]: 0 : if (!pArgs)
467 : : {
468 : : /* mod todo ???
469 : : SwView* pView = &GetView();
470 : : FieldUnit eMetric = ::GetDfltMetric(0 != PTR_CAST(SwWebView, pView));
471 : : SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, eMetric));
472 : : */
473 : 0 : SfxItemSet aDlgAttr(GetPool(),
474 : : EE_ITEMS_START, EE_ITEMS_END,
475 : : SID_ATTR_PARA_HYPHENZONE, SID_ATTR_PARA_HYPHENZONE,
476 : : SID_ATTR_PARA_SPLIT, SID_ATTR_PARA_SPLIT,
477 : : SID_ATTR_PARA_WIDOWS, SID_ATTR_PARA_WIDOWS,
478 : : SID_ATTR_PARA_ORPHANS, SID_ATTR_PARA_ORPHANS,
479 [ # # ]: 0 : 0);
480 : :
481 [ # # ]: 0 : aDlgAttr.Put(aEditAttr);
482 : :
483 : :
484 [ # # ][ # # ]: 0 : aDlgAttr.Put( SvxHyphenZoneItem( sal_False, RES_PARATR_HYPHENZONE) );
[ # # ]
485 [ # # ][ # # ]: 0 : aDlgAttr.Put( SvxFmtBreakItem( SVX_BREAK_NONE, RES_BREAK ) );
[ # # ]
486 [ # # ][ # # ]: 0 : aDlgAttr.Put( SvxFmtSplitItem( sal_True, RES_PARATR_SPLIT ) );
[ # # ]
487 [ # # ][ # # ]: 0 : aDlgAttr.Put( SvxWidowsItem( 0, RES_PARATR_WIDOWS ) );
[ # # ]
488 [ # # ][ # # ]: 0 : aDlgAttr.Put( SvxOrphansItem( 0, RES_PARATR_ORPHANS ) );
[ # # ]
489 : :
490 : :
491 [ # # ]: 0 : SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
492 : : OSL_ENSURE(pFact, "SwAbstractDialogFactory fail!");
493 : :
494 [ # # ]: 0 : SfxAbstractTabDialog* pDlg = pFact->CreateSwParaDlg( rView.GetWindow(), rView, aDlgAttr,DLG_STD, DLG_PARA, 0, sal_True );
495 : : OSL_ENSURE(pDlg, "Dialogdiet fail!");
496 [ # # ]: 0 : sal_uInt16 nRet = pDlg->Execute();
497 [ # # ]: 0 : if(RET_OK == nRet)
498 : : {
499 [ # # ][ # # ]: 0 : rReq.Done( *( pDlg->GetOutputItemSet() ) );
500 [ # # ][ # # ]: 0 : aNewAttr.Put(*pDlg->GetOutputItemSet());
501 : : }
502 [ # # ][ # # ]: 0 : delete( pDlg );
503 [ # # ]: 0 : if(RET_OK != nRet)
504 [ # # ][ # # ]: 0 : return;
505 : : }
506 : : else
507 [ # # ]: 0 : aNewAttr.Put(*pArgs);
508 : 0 : break;
509 : : }
510 : :
511 : : case SID_AUTOSPELL_CHECK:
512 : : {
513 [ # # ]: 0 : rView.ExecuteSlot(rReq);
514 : 0 : break;
515 : : }
516 : : case SID_ATTR_PARA_LEFT_TO_RIGHT:
517 : : case SID_ATTR_PARA_RIGHT_TO_LEFT:
518 : : {
519 : 0 : sal_Bool bLeftToRight = nSlot == SID_ATTR_PARA_LEFT_TO_RIGHT;
520 : :
521 : : const SfxPoolItem* pPoolItem;
522 [ # # ][ # # ]: 0 : if( pNewAttrs && SFX_ITEM_SET == pNewAttrs->GetItemState( nSlot, sal_True, &pPoolItem ) )
[ # # ][ # # ]
523 : : {
524 [ # # ]: 0 : if( !( (SfxBoolItem*)pPoolItem)->GetValue() )
525 : 0 : bLeftToRight = !bLeftToRight;
526 : : }
527 : 0 : SfxItemSet aAttr( *aNewAttr.GetPool(),
528 : : EE_PARA_JUST, EE_PARA_JUST,
529 : : EE_PARA_WRITINGDIR, EE_PARA_WRITINGDIR,
530 [ # # ]: 0 : 0 );
531 : :
532 : 0 : sal_uInt16 nAdjust = SVX_ADJUST_LEFT;
533 [ # # ][ # # ]: 0 : if( SFX_ITEM_ON == aEditAttr.GetItemState(EE_PARA_JUST, sal_True, &pPoolItem ) )
534 [ # # ]: 0 : nAdjust = ( (SvxAdjustItem*)pPoolItem)->GetEnumValue();
535 : :
536 [ # # ]: 0 : if( bLeftToRight )
537 : : {
538 [ # # ][ # # ]: 0 : aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_LEFT_TOP, EE_PARA_WRITINGDIR ) );
[ # # ]
539 [ # # ]: 0 : if( nAdjust == SVX_ADJUST_RIGHT )
540 [ # # ][ # # ]: 0 : aAttr.Put( SvxAdjustItem( SVX_ADJUST_LEFT, EE_PARA_JUST ) );
[ # # ]
541 : : }
542 : : else
543 : : {
544 [ # # ][ # # ]: 0 : aAttr.Put( SvxFrameDirectionItem( FRMDIR_HORI_RIGHT_TOP, EE_PARA_WRITINGDIR ) );
[ # # ]
545 [ # # ]: 0 : if( nAdjust == SVX_ADJUST_LEFT )
546 [ # # ][ # # ]: 0 : aAttr.Put( SvxAdjustItem( SVX_ADJUST_RIGHT, EE_PARA_JUST ) );
[ # # ]
547 : : }
548 [ # # ]: 0 : pOLV->SetAttribs(aAttr);
549 [ # # ]: 0 : break;
550 : : }
551 : : }
552 : :
553 [ # # ][ # # ]: 0 : if(nEEWhich && pNewAttrs)
554 [ # # ][ # # ]: 0 : aNewAttr.Put(pNewAttrs->Get(nWhich), nEEWhich);
555 : :
556 [ # # ]: 0 : Rectangle aNullRect;
557 [ # # ]: 0 : Rectangle aOutRect = pOLV->GetOutputArea();
558 [ # # ][ # # ]: 0 : if (aNullRect != aOutRect)
559 [ # # ]: 0 : pOLV->SetAttribs(aNewAttr);
560 : :
561 [ # # ]: 0 : rView.GetViewFrame()->GetBindings().InvalidateAll(sal_False);
562 [ # # ][ # # ]: 0 : if ( pOLV->GetOutliner()->IsModified() )
563 [ # # ][ # # ]: 0 : rView.GetWrtShell().SetModified();
[ # # ][ # # ]
[ # # ]
564 : :
565 : : }
566 : :
567 : 0 : void SwAnnotationShell::GetState(SfxItemSet& rSet)
568 : : {
569 : : //TODO: clean this up!!!
570 : : // FN_SET_SUPER_SCRIPT
571 : : //SID_ATTR_PARA_ADJUST
572 : : //SID_ATTR_PARA_ADJUST_BLOCK
573 : :
574 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
575 [ # # ][ # # ]: 0 : if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
[ # # ][ # # ]
576 : 0 : return;
577 : :
578 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
579 [ # # ]: 0 : SfxItemSet aEditAttr(pOLV->GetAttribs());
580 : :
581 [ # # ]: 0 : SfxWhichIter aIter(rSet);
582 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
583 [ # # ]: 0 : while(nWhich)
584 : : {
585 : 0 : sal_uInt16 nEEWhich = 0;
586 [ # # ]: 0 : sal_uInt16 nSlotId = GetPool().GetSlotId( nWhich );
587 [ # # # # : 0 : switch( nSlotId )
# # # # #
# # # # #
# ]
588 : : {
589 : : case SID_ATTR_CHAR_FONT:
590 : : case SID_ATTR_CHAR_FONTHEIGHT:
591 : : case SID_ATTR_CHAR_WEIGHT:
592 : : case SID_ATTR_CHAR_POSTURE:
593 : : {
594 [ # # ]: 0 : if ( pOLV )
595 : : {
596 [ # # ]: 0 : sal_uInt16 nScriptType = pOLV->GetSelectedScriptType();
597 [ # # ]: 0 : SfxItemPool* pSecondPool = aEditAttr.GetPool()->GetSecondaryPool();
598 [ # # ]: 0 : if( !pSecondPool )
599 : 0 : pSecondPool = aEditAttr.GetPool();
600 [ # # ]: 0 : SvxScriptSetItem aSetItem( nSlotId, *pSecondPool );
601 [ # # ]: 0 : aSetItem.GetItemSet().Put( aEditAttr, sal_False );
602 [ # # ]: 0 : const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScriptType );
603 [ # # ]: 0 : if( pI )
604 [ # # ]: 0 : rSet.Put( *pI, nWhich );
605 : : else
606 [ # # ][ # # ]: 0 : rSet.InvalidateItem( nWhich );
607 : : }
608 : : else
609 [ # # ]: 0 : rSet.InvalidateItem( nWhich );
610 : : }
611 : 0 : break;
612 : 0 : case SID_ATTR_CHAR_COLOR: nEEWhich = EE_CHAR_COLOR; break;
613 : 0 : case SID_ATTR_CHAR_UNDERLINE: nEEWhich = EE_CHAR_UNDERLINE;break;
614 : 0 : case SID_ATTR_CHAR_OVERLINE: nEEWhich = EE_CHAR_OVERLINE;break;
615 : 0 : case SID_ATTR_CHAR_CONTOUR: nEEWhich = EE_CHAR_OUTLINE; break;
616 : 0 : case SID_ATTR_CHAR_SHADOWED: nEEWhich = EE_CHAR_SHADOW;break;
617 : 0 : case SID_ATTR_CHAR_STRIKEOUT: nEEWhich = EE_CHAR_STRIKEOUT;break;
618 : 0 : case SID_ATTR_CHAR_LANGUAGE : nEEWhich = EE_CHAR_LANGUAGE;break;
619 : : case FN_SET_SUPER_SCRIPT:
620 : : case FN_SET_SUB_SCRIPT:
621 : : {
622 : 0 : sal_uInt16 nEsc = 0;
623 : 0 : const SfxPoolItem *pEscItem = 0;
624 [ # # ]: 0 : if (nWhich==FN_SET_SUPER_SCRIPT)
625 : 0 : nEsc = SVX_ESCAPEMENT_SUPERSCRIPT;
626 : : else
627 : 0 : nEsc = SVX_ESCAPEMENT_SUBSCRIPT;
628 : :
629 [ # # ]: 0 : if( !pEscItem )
630 [ # # ]: 0 : pEscItem = &aEditAttr.Get( EE_CHAR_ESCAPEMENT );
631 : :
632 [ # # ][ # # ]: 0 : if( nEsc == ((const SvxEscapementItem*)pEscItem)->GetEnumValue() )
633 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( nWhich, sal_True ));
[ # # ]
634 : : else
635 [ # # ]: 0 : rSet.InvalidateItem( nWhich );
636 : 0 : break;
637 : : }
638 : : case SID_ATTR_PARA_ADJUST_LEFT:
639 : : case SID_ATTR_PARA_ADJUST_RIGHT:
640 : : case SID_ATTR_PARA_ADJUST_CENTER:
641 : : case SID_ATTR_PARA_ADJUST_BLOCK:
642 : : {
643 : 0 : const SfxPoolItem *pAdjust = 0;
644 : 0 : int eAdjust = 0;
645 : :
646 [ # # ]: 0 : if (nWhich==SID_ATTR_PARA_ADJUST_LEFT)
647 : 0 : eAdjust = SVX_ADJUST_LEFT;
648 : : else
649 [ # # ]: 0 : if (nWhich==SID_ATTR_PARA_ADJUST_RIGHT)
650 : 0 : eAdjust = SVX_ADJUST_RIGHT;
651 : : else
652 [ # # ]: 0 : if (nWhich==SID_ATTR_PARA_ADJUST_CENTER)
653 : 0 : eAdjust = SVX_ADJUST_CENTER;
654 : : else
655 [ # # ]: 0 : if (nWhich==SID_ATTR_PARA_ADJUST_BLOCK)
656 : 0 : eAdjust = SVX_ADJUST_BLOCK;
657 : :
658 [ # # ]: 0 : if( !pAdjust )
659 [ # # ]: 0 : aEditAttr.GetItemState( EE_PARA_JUST, sal_False, &pAdjust);
660 : :
661 [ # # ][ # # ]: 0 : if( !pAdjust || IsInvalidItem( pAdjust ))
[ # # ]
662 [ # # ]: 0 : rSet.InvalidateItem( nSlotId ), nSlotId = 0;
663 : : else
664 : : {
665 [ # # ]: 0 : if ( eAdjust == ((const SvxAdjustItem*)pAdjust)->GetAdjust())
666 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( nWhich, sal_True ));
[ # # ]
667 : : else
668 [ # # ]: 0 : rSet.InvalidateItem( nWhich );
669 : : }
670 : : break;
671 : : }
672 : : case SID_ATTR_PARA_LINESPACE_10:
673 : : case SID_ATTR_PARA_LINESPACE_15:
674 : : case SID_ATTR_PARA_LINESPACE_20:
675 : : {
676 : 0 : const SfxPoolItem *pLSpace = 0;
677 : 0 : int nLSpace = 0;
678 : :
679 [ # # ]: 0 : if (nWhich==SID_ATTR_PARA_LINESPACE_10)
680 : 0 : nLSpace = 100;
681 : : else
682 [ # # ]: 0 : if (nWhich==SID_ATTR_PARA_LINESPACE_15)
683 : 0 : nLSpace = 150;
684 : : else
685 [ # # ]: 0 : if (nWhich==SID_ATTR_PARA_LINESPACE_20)
686 : 0 : nLSpace = 200;
687 : :
688 [ # # ]: 0 : if( !pLSpace )
689 [ # # ]: 0 : aEditAttr.GetItemState( EE_PARA_SBL, sal_False, &pLSpace );
690 : :
691 [ # # ][ # # ]: 0 : if( !pLSpace || IsInvalidItem( pLSpace ))
[ # # ]
692 [ # # ]: 0 : rSet.InvalidateItem( nSlotId ), nSlotId = 0;
693 : : else
694 : : {
695 [ # # ]: 0 : if( nLSpace == ((const SvxLineSpacingItem*)pLSpace)->GetPropLineSpace() )
696 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( nWhich, sal_True ));
[ # # ]
697 : : else
698 [ # # ]: 0 : rSet.InvalidateItem( nWhich );
699 : : }
700 : : break;
701 : : }
702 : : case SID_AUTOSPELL_CHECK:
703 : : {
704 [ # # ]: 0 : const SfxPoolItem* pState = rView.GetSlotState(nWhich);
705 [ # # ]: 0 : if (pState)
706 [ # # ][ # # ]: 0 : rSet.Put(SfxBoolItem(nWhich, ((const SfxBoolItem*)pState)->GetValue()));
[ # # ]
707 : : else
708 [ # # ]: 0 : rSet.DisableItem( nWhich );
709 : 0 : break;
710 : : }
711 : : case SID_ATTR_PARA_LEFT_TO_RIGHT:
712 : : case SID_ATTR_PARA_RIGHT_TO_LEFT:
713 : : {
714 [ # # ][ # # ]: 0 : if ( !SvtLanguageOptions().IsCTLFontEnabled() )
[ # # ][ # # ]
715 [ # # ]: 0 : rSet.DisableItem( nWhich );
716 : : else
717 : : {
718 [ # # ][ # # ]: 0 : if(pOLV->GetOutliner() && pOLV->GetOutliner()->IsVertical())
[ # # ][ # # ]
719 [ # # ]: 0 : rSet.DisableItem( nWhich );
720 : : else
721 : : {
722 : 0 : sal_Bool bFlag = sal_False;
723 [ # # ]: 0 : switch( ( ( (SvxFrameDirectionItem&) aEditAttr.Get( EE_PARA_WRITINGDIR ) ) ).GetValue() )
[ # # # ]
724 : : {
725 : : case FRMDIR_HORI_LEFT_TOP:
726 : : {
727 : 0 : bFlag = nWhich == SID_ATTR_PARA_LEFT_TO_RIGHT;
728 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( nWhich, bFlag ));
[ # # ]
729 : 0 : break;
730 : : }
731 : : case FRMDIR_HORI_RIGHT_TOP:
732 : : {
733 : 0 : bFlag = nWhich != SID_ATTR_PARA_LEFT_TO_RIGHT;
734 [ # # ][ # # ]: 0 : rSet.Put( SfxBoolItem( nWhich, bFlag ));
[ # # ]
735 : 0 : break;
736 : : }
737 : : }
738 : : }
739 : : }
740 : : }
741 : 0 : break;
742 : : case SID_INSERT_RLM :
743 : : case SID_INSERT_LRM :
744 : : case SID_INSERT_ZWNBSP :
745 : : case SID_INSERT_ZWSP:
746 : : {
747 [ # # ]: 0 : SvtCTLOptions aCTLOptions;
748 [ # # ]: 0 : sal_Bool bEnabled = aCTLOptions.IsCTLFontEnabled();
749 [ # # ]: 0 : rView.GetViewFrame()->GetBindings().SetVisibleState( nWhich, bEnabled );
750 [ # # ]: 0 : if(!bEnabled)
751 [ # # ][ # # ]: 0 : rSet.DisableItem(nWhich);
752 : : }
753 : 0 : break;
754 : : default:
755 [ # # ]: 0 : rSet.InvalidateItem( nWhich );
756 : 0 : break;
757 : : }
758 : :
759 [ # # ]: 0 : if(nEEWhich)
760 [ # # ][ # # ]: 0 : rSet.Put(aEditAttr.Get(nEEWhich, sal_True), nWhich);
761 : :
762 [ # # ]: 0 : if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED)
763 [ # # ]: 0 : rSet.DisableItem( nWhich );
764 : :
765 [ # # ]: 0 : nWhich = aIter.NextWhich();
766 [ # # ][ # # ]: 0 : }
767 : : }
768 : :
769 : 0 : void SwAnnotationShell::ExecSearch(SfxRequest& rReq, sal_Bool bNoMessage)
770 : : {
771 : 0 : rView.ExecSearch(rReq,bNoMessage);
772 : 0 : }
773 : :
774 : 0 : void SwAnnotationShell::StateSearch(SfxItemSet &rSet)
775 : : {
776 : 0 : rView.StateSearch(rSet);
777 : 0 : }
778 : :
779 : 0 : void SwAnnotationShell::ExecClpbrd(SfxRequest &rReq)
780 : : {
781 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
782 [ # # ][ # # ]: 0 : if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
[ # # ][ # # ]
783 : 0 : return;
784 : :
785 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
786 [ # # ]: 0 : SfxItemSet aEditAttr(pOLV->GetAttribs());
787 [ # # ]: 0 : SfxItemSet aNewAttr(*aEditAttr.GetPool(), aEditAttr.GetRanges());
788 : :
789 [ # # ]: 0 : long aOldHeight = pPostItMgr->GetActiveSidebarWin()->GetPostItTextHeight();
790 : 0 : sal_uInt16 nSlot = rReq.GetSlot();
791 [ # # # # : 0 : switch (nSlot)
# # ]
792 : : {
793 : : case SID_CUT:
794 [ # # ][ # # ]: 0 : if ( (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED) && pOLV->HasSelection() )
[ # # ][ # # ]
795 [ # # ]: 0 : pOLV->Cut();
796 : 0 : break;
797 : : case SID_COPY:
798 [ # # ][ # # ]: 0 : if( pOLV->HasSelection() )
799 [ # # ]: 0 : pOLV->Copy();
800 : 0 : break;
801 : : case SID_PASTE:
802 [ # # ]: 0 : if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
803 [ # # ]: 0 : pOLV->Paste();
804 : 0 : break;
805 : : case SID_PASTE_SPECIAL:
806 : : {
807 [ # # ]: 0 : if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED)
808 : : {
809 [ # # ]: 0 : SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
810 [ # # ]: 0 : SfxAbstractPasteDialog* pDlg = pFact->CreatePasteDialog( &rView.GetEditWin() );
811 : :
812 [ # # ]: 0 : pDlg->Insert( SOT_FORMAT_STRING, aEmptyStr );
813 [ # # ]: 0 : pDlg->Insert( SOT_FORMAT_RTF, aEmptyStr );
814 : :
815 [ # # ]: 0 : TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( &rView.GetEditWin() ) );
816 : :
817 [ # # ][ # # ]: 0 : sal_uLong nFormat = pDlg->GetFormat( aDataHelper.GetTransferable() );
[ # # ]
818 : :
819 [ # # ]: 0 : if (nFormat > 0)
820 : : {
821 [ # # ]: 0 : if (nFormat == SOT_FORMAT_STRING)
822 [ # # ]: 0 : pOLV->Paste();
823 : : else
824 [ # # ]: 0 : pOLV->PasteSpecial();
825 : : }
826 [ # # ][ # # ]: 0 : delete pDlg;
[ # # ]
827 : : }
828 : 0 : break;
829 : : }
830 : : case SID_CLIPBOARD_FORMAT_ITEMS:
831 : : {
832 : 0 : sal_uLong nFormat = 0;
833 : : const SfxPoolItem* pItem;
834 [ # # ][ # # ]: 0 : if ( rReq.GetArgs() && rReq.GetArgs()->GetItemState(nSlot, sal_True, &pItem) == SFX_ITEM_SET &&
[ # # ][ # # ]
[ # # ]
835 [ # # ][ # # ]: 0 : pItem->ISA(SfxUInt32Item) )
836 : : {
837 : 0 : nFormat = ((const SfxUInt32Item*)pItem)->GetValue();
838 : : }
839 : :
840 [ # # ]: 0 : if ( nFormat )
841 : : {
842 [ # # ]: 0 : if (SOT_FORMAT_STRING == nFormat)
843 [ # # ]: 0 : pOLV->Paste();
844 : : else
845 [ # # ]: 0 : pOLV->PasteSpecial();
846 : : }
847 : : break;
848 : : }
849 : : }
850 [ # # ][ # # ]: 0 : pPostItMgr->GetActiveSidebarWin()->ResizeIfNeccessary(aOldHeight,pPostItMgr->GetActiveSidebarWin()->GetPostItTextHeight());
[ # # ][ # # ]
851 : : }
852 : :
853 : 0 : void SwAnnotationShell::StateClpbrd(SfxItemSet &rSet)
854 : : {
855 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
856 [ # # ][ # # ]: 0 : if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
[ # # ][ # # ]
857 : 0 : return;
858 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
859 : :
860 [ # # ]: 0 : TransferableDataHelper aDataHelper( TransferableDataHelper::CreateFromSystemClipboard( &rView.GetEditWin() ) );
861 [ # # ][ # # ]: 0 : bool bPastePossible = ( aDataHelper.HasFormat( SOT_FORMAT_STRING ) || aDataHelper.HasFormat( SOT_FORMAT_RTF ) );
[ # # ][ # # ]
862 [ # # ][ # # ]: 0 : bPastePossible = bPastePossible && (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()!=SwPostItHelper::DELETED);
863 : :
864 [ # # ]: 0 : SfxWhichIter aIter(rSet);
865 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
866 : :
867 [ # # ]: 0 : while(nWhich)
868 : : {
869 [ # # # # : 0 : switch(nWhich)
# ]
870 : : {
871 : : case SID_CUT:
872 : : {
873 [ # # ][ # # ]: 0 : if ( (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED) || !pOLV->HasSelection() )
[ # # ][ # # ]
874 [ # # ]: 0 : rSet.DisableItem( nWhich );
875 : : }
876 : : case SID_COPY:
877 : : {
878 [ # # ][ # # ]: 0 : if( !pOLV->HasSelection() )
879 [ # # ]: 0 : rSet.DisableItem( nWhich );
880 : 0 : break;
881 : : }
882 : : case SID_PASTE:
883 : : case SID_PASTE_SPECIAL:
884 : : {
885 [ # # ]: 0 : if( !bPastePossible )
886 [ # # ]: 0 : rSet.DisableItem( nWhich );
887 : 0 : break;
888 : : }
889 : : case SID_CLIPBOARD_FORMAT_ITEMS:
890 : : {
891 [ # # ]: 0 : if ( bPastePossible )
892 : : {
893 [ # # ]: 0 : SvxClipboardFmtItem aFormats( SID_CLIPBOARD_FORMAT_ITEMS );
894 [ # # ][ # # ]: 0 : if ( aDataHelper.HasFormat( SOT_FORMAT_RTF ) )
895 [ # # ]: 0 : aFormats.AddClipbrdFormat( SOT_FORMAT_RTF );
896 [ # # ]: 0 : aFormats.AddClipbrdFormat( SOT_FORMAT_STRING );
897 [ # # ][ # # ]: 0 : rSet.Put( aFormats );
898 : : }
899 : : else
900 [ # # ]: 0 : rSet.DisableItem( nWhich );
901 : 0 : break;
902 : : }
903 : : }
904 [ # # ]: 0 : nWhich = aIter.NextWhich();
905 [ # # ][ # # ]: 0 : }
906 : : }
907 : :
908 : 0 : void SwAnnotationShell::StateStatusLine(SfxItemSet &rSet)
909 : : {
910 [ # # ]: 0 : SfxWhichIter aIter( rSet );
911 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
912 : :
913 [ # # ]: 0 : while( nWhich )
914 : : {
915 [ # # # ]: 0 : switch( nWhich )
916 : : {
917 : : case FN_STAT_SELMODE:
918 : : {
919 [ # # ][ # # ]: 0 : rSet.Put(SfxUInt16Item(FN_STAT_SELMODE, 0));
[ # # ]
920 [ # # ]: 0 : rSet.DisableItem( nWhich );
921 : 0 : break;
922 : : }
923 : : case FN_STAT_TEMPLATE:
924 : : {
925 [ # # ]: 0 : rSet.DisableItem( nWhich );
926 : 0 : break;
927 : : }
928 : : }
929 [ # # ]: 0 : nWhich = aIter.NextWhich();
930 [ # # ]: 0 : }
931 : 0 : }
932 : :
933 : 0 : void SwAnnotationShell::StateInsert(SfxItemSet &rSet)
934 : : {
935 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
936 [ # # ][ # # ]: 0 : if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
[ # # ][ # # ]
937 : 0 : return;
938 : :
939 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
940 [ # # ]: 0 : SfxWhichIter aIter(rSet);
941 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
942 : :
943 [ # # ]: 0 : while(nWhich)
944 : : {
945 [ # # ]: 0 : switch(nWhich)
946 : : {
947 : : case SID_HYPERLINK_GETLINK:
948 : : {
949 [ # # ]: 0 : SvxHyperlinkItem aHLinkItem;
950 : 0 : aHLinkItem.SetInsertMode(HLINK_FIELD);
951 : :
952 [ # # ]: 0 : const SvxFieldItem* pFieldItem = pOLV->GetFieldAtSelection();
953 : :
954 [ # # ]: 0 : if (pFieldItem)
955 : : {
956 : 0 : const SvxFieldData* pField = pFieldItem->GetField();
957 : :
958 [ # # ][ # # ]: 0 : if (pField->ISA(SvxURLField))
[ # # ]
959 : : {
960 [ # # ][ # # ]: 0 : aHLinkItem.SetName(((const SvxURLField*) pField)->GetRepresentation());
[ # # ]
961 [ # # ][ # # ]: 0 : aHLinkItem.SetURL(((const SvxURLField*) pField)->GetURL());
[ # # ]
962 [ # # ][ # # ]: 0 : aHLinkItem.SetTargetFrame(((const SvxURLField*) pField)->GetTargetFrame());
[ # # ]
963 : : }
964 : : }
965 : : else
966 : : {
967 [ # # ]: 0 : String sSel(pOLV->GetSelected());
968 [ # # ]: 0 : sSel.Erase(255);
969 [ # # ][ # # ]: 0 : aHLinkItem.SetName(comphelper::string::stripEnd(sSel, ' '));
[ # # ][ # # ]
[ # # ][ # # ]
970 : : }
971 : :
972 [ # # ][ # # ]: 0 : sal_uInt16 nHtmlMode = ::GetHtmlMode(rView.GetDocShell());
973 : 0 : aHLinkItem.SetInsertMode((SvxLinkInsertMode)(aHLinkItem.GetInsertMode() |
974 [ # # ]: 0 : ((nHtmlMode & HTMLMODE_ON) != 0 ? HLINK_HTMLMODE : 0)));
975 : :
976 [ # # ][ # # ]: 0 : rSet.Put(aHLinkItem);
977 : : }
978 : 0 : break;
979 : : }
980 : :
981 [ # # ]: 0 : if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED)
982 [ # # ]: 0 : rSet.DisableItem( nWhich );
983 : :
984 [ # # ]: 0 : nWhich = aIter.NextWhich();
985 [ # # ]: 0 : }
986 : : }
987 : :
988 : :
989 : 0 : void SwAnnotationShell::NoteExec(SfxRequest &rReq)
990 : : {
991 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
992 [ # # ]: 0 : if ( !pPostItMgr )
993 : 0 : return;
994 : :
995 : 0 : sal_uInt16 nSlot = rReq.GetSlot();
996 [ # # # # : 0 : switch (nSlot)
# # # ]
997 : : {
998 : : case FN_REPLY:
999 : : case FN_POSTIT:
1000 : : case FN_DELETE_COMMENT:
1001 [ # # ]: 0 : if ( pPostItMgr->HasActiveSidebarWin() )
1002 : 0 : pPostItMgr->GetActiveSidebarWin()->ExecuteCommand(nSlot);
1003 : 0 : break;
1004 : : case FN_DELETE_ALL_NOTES:
1005 : 0 : pPostItMgr->Delete();
1006 : 0 : break;
1007 : : case FN_DELETE_NOTE_AUTHOR:
1008 : : {
1009 : 0 : SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, nSlot, sal_False);
1010 [ # # ]: 0 : if ( pItem )
1011 [ # # ]: 0 : pPostItMgr->Delete( pItem->GetValue() );
1012 : 0 : break;
1013 : : }
1014 : : case FN_HIDE_NOTE:
1015 : 0 : break;
1016 : : case FN_HIDE_ALL_NOTES:
1017 : 0 : pPostItMgr->Hide();
1018 : 0 : break;
1019 : : case FN_HIDE_NOTE_AUTHOR:
1020 : : {
1021 : 0 : SFX_REQUEST_ARG( rReq, pItem, SfxStringItem, nSlot, sal_False);
1022 [ # # ]: 0 : if ( pItem )
1023 : 0 : pPostItMgr->Hide( pItem->GetValue() );
1024 : : }
1025 : : }
1026 : : }
1027 : :
1028 : 0 : void SwAnnotationShell::GetNoteState(SfxItemSet &rSet)
1029 : : {
1030 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
1031 [ # # ]: 0 : SfxWhichIter aIter(rSet);
1032 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
1033 [ # # ]: 0 : while(nWhich)
1034 : : {
1035 [ # # ]: 0 : sal_uInt16 nSlotId = GetPool().GetSlotId( nWhich );
1036 [ # # # ]: 0 : switch( nSlotId )
1037 : : {
1038 : : case FN_POSTIT:
1039 : : case FN_DELETE_NOTE_AUTHOR:
1040 : : case FN_DELETE_ALL_NOTES:
1041 : : case FN_HIDE_NOTE:
1042 : : case FN_HIDE_NOTE_AUTHOR:
1043 : : case FN_HIDE_ALL_NOTES:
1044 : : case FN_DELETE_COMMENT:
1045 : : {
1046 [ # # ][ # # ]: 0 : if ( !pPostItMgr ||
[ # # ]
1047 [ # # ]: 0 : !pPostItMgr->HasActiveAnnotationWin() )
1048 : : {
1049 [ # # ]: 0 : rSet.DisableItem(nWhich);
1050 : : }
1051 : 0 : break;
1052 : : }
1053 : : case FN_REPLY:
1054 : : {
1055 [ # # ][ # # ]: 0 : if ( !pPostItMgr ||
[ # # ]
1056 [ # # ]: 0 : !pPostItMgr->HasActiveAnnotationWin() )
1057 : : {
1058 [ # # ]: 0 : rSet.DisableItem(nWhich);
1059 : : }
1060 : : else
1061 : : {
1062 [ # # ]: 0 : SvtUserOptions aUserOpt;
1063 [ # # ]: 0 : String sAuthor;
1064 [ # # ][ # # ]: 0 : if( !(sAuthor = aUserOpt.GetFullName()).Len())
[ # # ]
1065 [ # # ][ # # ]: 0 : if( !(sAuthor = aUserOpt.GetID()).Len() )
[ # # ]
1066 [ # # ][ # # ]: 0 : sAuthor = String( SW_RES( STR_REDLINE_UNKNOWN_AUTHOR ));
[ # # ]
1067 [ # # ][ # # ]: 0 : if (sAuthor == pPostItMgr->GetActiveSidebarWin()->GetAuthor())
[ # # ][ # # ]
1068 [ # # ][ # # ]: 0 : rSet.DisableItem(nWhich);
[ # # ]
1069 : : }
1070 : 0 : break;
1071 : : }
1072 : : default:
1073 [ # # ]: 0 : rSet.InvalidateItem( nWhich );
1074 : 0 : break;
1075 : : }
1076 : :
1077 [ # # ][ # # ]: 0 : if (pPostItMgr->HasActiveSidebarWin())
1078 : : {
1079 [ # # ][ # # ]: 0 : if ( (pPostItMgr->GetActiveSidebarWin()->IsProtected()) &&
[ # # ][ # # ]
[ # # ]
1080 : : ( (nSlotId==FN_DELETE_COMMENT) || (nSlotId==FN_REPLY) ) )
1081 [ # # ]: 0 : rSet.DisableItem( nWhich );
1082 : : }
1083 [ # # ]: 0 : nWhich = aIter.NextWhich();
1084 [ # # ]: 0 : }
1085 : 0 : }
1086 : :
1087 : 0 : void SwAnnotationShell::ExecLingu(SfxRequest &rReq)
1088 : : {
1089 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
1090 [ # # ][ # # ]: 0 : if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
[ # # ][ # # ]
1091 : 0 : return;
1092 : :
1093 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
1094 [ # # ]: 0 : SfxItemSet aEditAttr(pOLV->GetAttribs());
1095 : 0 : sal_uInt16 nSlot = rReq.GetSlot();
1096 : 0 : SwWrtShell &rSh = rView.GetWrtShell();
1097 : 0 : bool bRestoreSelection = false;
1098 : 0 : ESelection aOldSelection;
1099 : :
1100 [ # # # # : 0 : switch (nSlot)
# # ]
1101 : : {
1102 : : case SID_LANGUAGE_STATUS:
1103 : : {
1104 [ # # ]: 0 : aOldSelection = pOLV->GetSelection();
1105 [ # # ][ # # ]: 0 : if (!pOLV->GetEditView().HasSelection())
1106 : : {
1107 : 0 : bRestoreSelection = true;
1108 [ # # ]: 0 : pOLV->GetEditView().SelectCurrentWord();
1109 : : }
1110 : :
1111 [ # # ]: 0 : bRestoreSelection = SwLangHelper::SetLanguageStatus(pOLV,rReq,rView,rSh);
1112 : 0 : break;
1113 : : }
1114 : : case SID_THES:
1115 : : {
1116 [ # # ]: 0 : String aReplaceText;
1117 [ # # ][ # # ]: 0 : SFX_REQUEST_ARG( rReq, pItem2, SfxStringItem, SID_THES, sal_False );
1118 [ # # ]: 0 : if (pItem2)
1119 [ # # ]: 0 : aReplaceText = pItem2->GetValue();
1120 [ # # ]: 0 : if (aReplaceText.Len() > 0)
1121 [ # # ]: 0 : ReplaceTextWithSynonym( pOLV->GetEditView(), aReplaceText );
1122 [ # # ]: 0 : break;
1123 : : }
1124 : : case SID_THESAURUS:
1125 : : {
1126 [ # # ]: 0 : pOLV->StartThesaurus();
1127 : 0 : break;
1128 : : }
1129 : : case SID_HANGUL_HANJA_CONVERSION:
1130 : : pOLV->StartTextConversion( LANGUAGE_KOREAN, LANGUAGE_KOREAN, NULL,
1131 [ # # ]: 0 : i18n::TextConversionOption::CHARACTER_BY_CHARACTER, sal_True, sal_False );
1132 : 0 : break;
1133 : :
1134 : : case SID_CHINESE_CONVERSION:
1135 : : {
1136 : : //open ChineseTranslationDialog
1137 : : Reference< XComponentContext > xContext(
1138 [ # # ]: 0 : ::cppu::defaultBootstrap_InitialComponentContext() ); //@todo get context from calc if that has one
1139 [ # # ]: 0 : if(xContext.is())
1140 : : {
1141 [ # # ][ # # ]: 0 : Reference< lang::XMultiComponentFactory > xMCF( xContext->getServiceManager() );
1142 [ # # ]: 0 : if(xMCF.is())
1143 : : {
1144 : : Reference< ui::dialogs::XExecutableDialog > xDialog(
1145 [ # # ]: 0 : xMCF->createInstanceWithContext(
1146 : : rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("com.sun.star.linguistic2.ChineseTranslationDialog"))
1147 [ # # ][ # # ]: 0 : , xContext), UNO_QUERY);
[ # # ]
1148 [ # # ]: 0 : Reference< lang::XInitialization > xInit( xDialog, UNO_QUERY );
1149 [ # # ]: 0 : if( xInit.is() )
1150 : : {
1151 : : // initialize dialog
1152 [ # # ]: 0 : Reference< awt::XWindow > xDialogParentWindow(0);
1153 [ # # ]: 0 : Sequence<Any> aSeq(1);
1154 [ # # ]: 0 : Any* pArray = aSeq.getArray();
1155 : 0 : PropertyValue aParam;
1156 [ # # ]: 0 : aParam.Name = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("ParentWindow"));
1157 [ # # ][ # # ]: 0 : aParam.Value <<= makeAny(xDialogParentWindow);
1158 [ # # ][ # # ]: 0 : pArray[0] <<= makeAny(aParam);
1159 [ # # ][ # # ]: 0 : xInit->initialize( aSeq );
1160 : :
1161 : : //execute dialog
1162 [ # # ][ # # ]: 0 : sal_Int16 nDialogRet = xDialog->execute();
1163 [ # # ]: 0 : if( RET_OK == nDialogRet )
1164 : : {
1165 : : //get some parameters from the dialog
1166 : 0 : sal_Bool bToSimplified = sal_True;
1167 : 0 : sal_Bool bUseVariants = sal_True;
1168 : 0 : sal_Bool bCommonTerms = sal_True;
1169 [ # # ]: 0 : Reference< beans::XPropertySet > xProp( xDialog, UNO_QUERY );
1170 [ # # ]: 0 : if( xProp.is() )
1171 : : {
1172 : : try
1173 : : {
1174 [ # # ][ # # ]: 0 : xProp->getPropertyValue( C2U("IsDirectionToSimplified") ) >>= bToSimplified;
[ # # ]
1175 [ # # ][ # # ]: 0 : xProp->getPropertyValue( C2U("IsUseCharacterVariants") ) >>= bUseVariants;
[ # # ]
1176 [ # # ][ # # ]: 0 : xProp->getPropertyValue( C2U("IsTranslateCommonTerms") ) >>= bCommonTerms;
[ # # ][ # # ]
1177 : : }
1178 [ # # ]: 0 : catch (const Exception&)
1179 : : {
1180 : : }
1181 : : }
1182 : :
1183 : : //execute translation
1184 [ # # ]: 0 : sal_Int16 nSourceLang = bToSimplified ? LANGUAGE_CHINESE_TRADITIONAL : LANGUAGE_CHINESE_SIMPLIFIED;
1185 [ # # ]: 0 : sal_Int16 nTargetLang = bToSimplified ? LANGUAGE_CHINESE_SIMPLIFIED : LANGUAGE_CHINESE_TRADITIONAL;
1186 [ # # ]: 0 : sal_Int32 nOptions = bUseVariants ? i18n::TextConversionOption::USE_CHARACTER_VARIANTS : 0;
1187 [ # # ]: 0 : if( !bCommonTerms )
1188 : 0 : nOptions = nOptions | i18n::TextConversionOption::CHARACTER_BY_CHARACTER;
1189 : :
1190 [ # # ]: 0 : Font aTargetFont = pOLV->GetWindow()->GetDefaultFont( DEFAULTFONT_CJK_TEXT,
1191 [ # # ][ # # ]: 0 : nTargetLang, DEFAULTFONT_FLAGS_ONLYONE );
[ # # ]
1192 : :
1193 [ # # ][ # # ]: 0 : pOLV->StartTextConversion( nSourceLang, nTargetLang, &aTargetFont, nOptions, sal_False, sal_False );
1194 [ # # ]: 0 : }
1195 : : }
1196 [ # # ]: 0 : Reference< lang::XComponent > xComponent( xDialog, UNO_QUERY );
1197 [ # # ]: 0 : if( xComponent.is() )
1198 [ # # ][ # # ]: 0 : xComponent->dispose();
1199 : 0 : }
1200 : 0 : }
1201 : : }
1202 : 0 : break;
1203 : : }
1204 : :
1205 [ # # ]: 0 : if (bRestoreSelection)
1206 : : {
1207 : : // restore selection
1208 [ # # ]: 0 : pOLV->GetEditView().SetSelection( aOldSelection );
1209 [ # # ]: 0 : }
1210 : : }
1211 : :
1212 : 0 : void SwAnnotationShell::GetLinguState(SfxItemSet &rSet)
1213 : : {
1214 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
1215 [ # # ][ # # ]: 0 : if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
[ # # ][ # # ]
1216 : 0 : return;
1217 : :
1218 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
1219 [ # # ]: 0 : SfxItemSet aEditAttr(pOLV->GetAttribs());
1220 : :
1221 [ # # ]: 0 : SfxWhichIter aIter(rSet);
1222 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
1223 [ # # ]: 0 : while(nWhich)
1224 : : {
1225 [ # # # # : 0 : switch (nWhich)
# ]
1226 : : {
1227 : : case SID_LANGUAGE_STATUS:
1228 : : {
1229 [ # # ]: 0 : SwLangHelper::GetLanguageStatus(pOLV,rSet);
1230 : 0 : break;
1231 : : }
1232 : :
1233 : : case SID_THES:
1234 : : {
1235 [ # # ]: 0 : String aStatusVal;
1236 : 0 : LanguageType nLang = LANGUAGE_NONE;
1237 [ # # ]: 0 : bool bIsLookUpWord = GetStatusValueForThesaurusFromContext( aStatusVal, nLang, pOLV->GetEditView() );
1238 [ # # ][ # # ]: 0 : rSet.Put( SfxStringItem( SID_THES, aStatusVal ) );
[ # # ]
1239 : :
1240 : : // disable "Thesaurus" context menu entry if there is nothing to look up
1241 [ # # ]: 0 : uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
1242 [ # # ]: 0 : lang::Locale aLocale( SvxCreateLocale( nLang ) );
1243 [ # # # # ]: 0 : if (!bIsLookUpWord ||
[ # # ][ # # ]
[ # # ]
1244 [ # # ][ # # ]: 0 : !xThes.is() || nLang == LANGUAGE_NONE || !xThes->hasLocale( aLocale ))
1245 [ # # ]: 0 : rSet.DisableItem( SID_THES );
1246 [ # # ]: 0 : break;
1247 : : }
1248 : :
1249 : : // disable "Thesaurus" if the language is not supported
1250 : : case SID_THESAURUS:
1251 : : {
1252 : 0 : const SfxPoolItem &rItem = rView.GetWrtShell().GetDoc()->GetDefault(
1253 : : GetWhichOfScript( RES_CHRATR_LANGUAGE,
1254 [ # # ][ # # ]: 0 : GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage())) );
[ # # # # ]
1255 : : LanguageType nLang = ((const SvxLanguageItem &)
1256 : 0 : rItem).GetLanguage();
1257 [ # # ]: 0 : uno::Reference< linguistic2::XThesaurus > xThes( ::GetThesaurus() );
1258 [ # # ][ # # ]: 0 : if (!xThes.is() || nLang == LANGUAGE_NONE ||
[ # # ][ # # ]
1259 [ # # ][ # # ]: 0 : !xThes->hasLocale( SvxCreateLocale( nLang ) ))
[ # # ][ # # ]
[ # # ]
1260 [ # # ]: 0 : rSet.DisableItem( SID_THESAURUS );
1261 : : }
1262 : 0 : break;
1263 : : case SID_HANGUL_HANJA_CONVERSION:
1264 : : case SID_CHINESE_CONVERSION:
1265 : : {
1266 [ # # ][ # # ]: 0 : if (!SvtCJKOptions().IsAnyEnabled())
[ # # ][ # # ]
1267 : : {
1268 [ # # ]: 0 : rView.GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_False );
1269 [ # # ]: 0 : rSet.DisableItem(nWhich);
1270 : : }
1271 : : else
1272 [ # # ]: 0 : rView.GetViewFrame()->GetBindings().SetVisibleState( nWhich, sal_True );
1273 : : }
1274 : 0 : break;
1275 : : }
1276 : :
1277 [ # # ]: 0 : if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED)
1278 [ # # ]: 0 : rSet.DisableItem( nWhich );
1279 : :
1280 [ # # ]: 0 : nWhich = aIter.NextWhich();
1281 [ # # ][ # # ]: 0 : }
1282 : : }
1283 : :
1284 : 0 : void SwAnnotationShell::ExecTransliteration(SfxRequest &rReq)
1285 : : {
1286 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
1287 [ # # ][ # # ]: 0 : if (!pPostItMgr || !pPostItMgr->HasActiveSidebarWin())
[ # # ]
1288 : 0 : return;
1289 : :
1290 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
1291 : :
1292 [ # # ]: 0 : if (!pOLV)
1293 : 0 : return;
1294 : :
1295 : : using namespace ::com::sun::star::i18n;
1296 : :
1297 : 0 : sal_uInt32 nMode = 0;
1298 : :
1299 [ # # # # : 0 : switch( rReq.GetSlot() )
# # # # #
# ]
1300 : : {
1301 : : case SID_TRANSLITERATE_SENTENCE_CASE:
1302 : 0 : nMode = TransliterationModulesExtra::SENTENCE_CASE;
1303 : 0 : break;
1304 : : case SID_TRANSLITERATE_TITLE_CASE:
1305 : 0 : nMode = TransliterationModulesExtra::TITLE_CASE;
1306 : 0 : break;
1307 : : case SID_TRANSLITERATE_TOGGLE_CASE:
1308 : 0 : nMode = TransliterationModulesExtra::TOGGLE_CASE;
1309 : 0 : break;
1310 : : case SID_TRANSLITERATE_UPPER:
1311 : 0 : nMode = TransliterationModules_LOWERCASE_UPPERCASE;
1312 : 0 : break;
1313 : : case SID_TRANSLITERATE_LOWER:
1314 : 0 : nMode = TransliterationModules_UPPERCASE_LOWERCASE;
1315 : 0 : break;
1316 : : case SID_TRANSLITERATE_HALFWIDTH:
1317 : 0 : nMode = TransliterationModules_FULLWIDTH_HALFWIDTH;
1318 : 0 : break;
1319 : : case SID_TRANSLITERATE_FULLWIDTH:
1320 : 0 : nMode = TransliterationModules_HALFWIDTH_FULLWIDTH;
1321 : 0 : break;
1322 : : case SID_TRANSLITERATE_HIRAGANA:
1323 : 0 : nMode = TransliterationModules_KATAKANA_HIRAGANA;
1324 : 0 : break;
1325 : : case SID_TRANSLITERATE_KATAGANA:
1326 : 0 : nMode = TransliterationModules_HIRAGANA_KATAKANA;
1327 : 0 : break;
1328 : :
1329 : : default:
1330 : : OSL_ENSURE(!this, "wrong dispatcher");
1331 : : }
1332 : :
1333 [ # # ]: 0 : if( nMode )
1334 : 0 : pOLV->TransliterateText( nMode );
1335 : : }
1336 : :
1337 : 0 : void SwAnnotationShell::ExecRotateTransliteration( SfxRequest & rReq )
1338 : : {
1339 [ # # ]: 0 : if( rReq.GetSlot() == SID_TRANSLITERATE_ROTATE_CASE )
1340 : : {
1341 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
1342 [ # # ][ # # ]: 0 : if (!pPostItMgr || !pPostItMgr->HasActiveSidebarWin())
[ # # ]
1343 : 0 : return;
1344 : :
1345 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
1346 : :
1347 [ # # ]: 0 : if (!pOLV)
1348 : 0 : return;
1349 : :
1350 : 0 : pOLV->TransliterateText(m_aRotateCase.getNextMode());
1351 : : }
1352 : : }
1353 : :
1354 : 0 : void SwAnnotationShell::ExecUndo(SfxRequest &rReq)
1355 : : {
1356 : 0 : const SfxItemSet* pArgs = rReq.GetArgs();
1357 [ # # ]: 0 : ::svl::IUndoManager* pUndoManager = GetUndoManager();
1358 : 0 : SwWrtShell &rSh = rView.GetWrtShell();
1359 : :
1360 [ # # ]: 0 : long aOldHeight = rView.GetPostItMgr()->HasActiveSidebarWin()
1361 : 0 : ? rView.GetPostItMgr()->GetActiveSidebarWin()->GetPostItTextHeight()
1362 [ # # # # ]: 0 : : 0;
1363 : :
1364 : 0 : sal_uInt16 nId = rReq.GetSlot();
1365 : 0 : sal_uInt16 nCnt = 1;
1366 : 0 : const SfxPoolItem* pItem=0;
1367 [ # # ][ # # ]: 0 : if( pArgs && SFX_ITEM_SET == pArgs->GetItemState( nId, sal_False, &pItem ) )
[ # # ][ # # ]
1368 : 0 : nCnt = ((SfxUInt16Item*)pItem)->GetValue();
1369 [ # # # ]: 0 : switch( nId )
1370 : : {
1371 : : case SID_UNDO:
1372 : : {
1373 [ # # ]: 0 : if ( pUndoManager )
1374 : : {
1375 [ # # ]: 0 : sal_uInt16 nCount = pUndoManager->GetUndoActionCount();
1376 : 0 : sal_uInt16 nSteps = nCnt;
1377 [ # # ]: 0 : if ( nCount < nCnt )
1378 : : {
1379 : 0 : nCnt = nCnt - nCount;
1380 : 0 : nSteps = nCount;
1381 : : }
1382 : : else
1383 : 0 : nCnt = 0;
1384 : :
1385 [ # # ]: 0 : while( nSteps-- )
1386 [ # # ]: 0 : pUndoManager->Undo();
1387 : : }
1388 : :
1389 [ # # ]: 0 : if ( nCnt )
1390 [ # # ]: 0 : rSh.Do( SwWrtShell::UNDO, nCnt );
1391 : :
1392 : 0 : break;
1393 : : }
1394 : :
1395 : : case SID_REDO:
1396 : : {
1397 [ # # ]: 0 : if ( pUndoManager )
1398 : : {
1399 [ # # ]: 0 : sal_uInt16 nCount = pUndoManager->GetRedoActionCount();
1400 : 0 : sal_uInt16 nSteps = nCnt;
1401 [ # # ]: 0 : if ( nCount < nCnt )
1402 : : {
1403 : 0 : nCnt = nCnt - nCount;
1404 : 0 : nSteps = nCount;
1405 : : }
1406 : : else
1407 : 0 : nCnt = 0;
1408 : :
1409 [ # # ]: 0 : while( nSteps-- )
1410 [ # # ]: 0 : pUndoManager->Redo();
1411 : : }
1412 : :
1413 [ # # ]: 0 : if ( nCnt )
1414 [ # # ]: 0 : rSh.Do( SwWrtShell::REDO, nCnt );
1415 : :
1416 : 0 : break;
1417 : : }
1418 : : }
1419 : :
1420 [ # # ]: 0 : rView.GetViewFrame()->GetBindings().InvalidateAll(sal_False);
1421 : :
1422 [ # # ][ # # ]: 0 : if (rView.GetPostItMgr()->HasActiveSidebarWin())
1423 [ # # ][ # # ]: 0 : rView.GetPostItMgr()->GetActiveSidebarWin()->ResizeIfNeccessary(aOldHeight,rView.GetPostItMgr()->GetActiveSidebarWin()->GetPostItTextHeight());
1424 : 0 : }
1425 : :
1426 : 0 : void SwAnnotationShell::StateUndo(SfxItemSet &rSet)
1427 : : {
1428 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
1429 [ # # ][ # # ]: 0 : if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
[ # # ][ # # ]
1430 : 0 : return;
1431 : :
1432 [ # # ]: 0 : SfxWhichIter aIter(rSet);
1433 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
1434 [ # # ]: 0 : ::svl::IUndoManager* pUndoManager = GetUndoManager();
1435 : 0 : SfxViewFrame *pSfxViewFrame = rView.GetViewFrame();
1436 : 0 : SwWrtShell &rSh = rView.GetWrtShell();
1437 : :
1438 [ # # ]: 0 : while( nWhich )
1439 : : {
1440 [ # # # # ]: 0 : switch ( nWhich )
1441 : : {
1442 : : case SID_UNDO:
1443 : : {
1444 [ # # ]: 0 : sal_uInt16 nCount = pUndoManager->GetUndoActionCount();
1445 [ # # ]: 0 : if ( nCount )
1446 [ # # ][ # # ]: 0 : pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet );
1447 [ # # ][ # # ]: 0 : else if (rSh.GetLastUndoInfo(0, 0))
1448 : : {
1449 [ # # ][ # # ]: 0 : rSet.Put( SfxStringItem( nWhich, rSh.GetDoString(SwWrtShell::UNDO)) );
[ # # ][ # # ]
[ # # ]
1450 : : }
1451 : : else
1452 [ # # ]: 0 : rSet.DisableItem(nWhich);
1453 : 0 : break;
1454 : : }
1455 : : case SID_REDO:
1456 : : {
1457 [ # # ]: 0 : sal_uInt16 nCount = pUndoManager->GetRedoActionCount();
1458 [ # # ]: 0 : if ( nCount )
1459 [ # # ][ # # ]: 0 : pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet );
1460 [ # # ][ # # ]: 0 : else if (rSh.GetFirstRedoInfo(0))
1461 : : {
1462 [ # # ][ # # ]: 0 : rSet.Put(SfxStringItem( nWhich, rSh.GetDoString(SwWrtShell::REDO)) );
[ # # ][ # # ]
[ # # ]
1463 : : }
1464 : : else
1465 [ # # ]: 0 : rSet.DisableItem(nWhich);
1466 : 0 : break;
1467 : : }
1468 : : case SID_GETUNDOSTRINGS:
1469 : : case SID_GETREDOSTRINGS:
1470 : : {
1471 [ # # ]: 0 : if( pUndoManager )
1472 : : {
1473 : : rtl::OUString (::svl::IUndoManager:: *fnGetComment)( size_t, bool const ) const;
1474 : :
1475 : : sal_uInt16 nCount;
1476 [ # # ]: 0 : if( SID_GETUNDOSTRINGS == nWhich )
1477 : : {
1478 [ # # ]: 0 : nCount = pUndoManager->GetUndoActionCount();
1479 : 0 : fnGetComment = &::svl::IUndoManager::GetUndoActionComment;
1480 : : }
1481 : : else
1482 : : {
1483 [ # # ]: 0 : nCount = pUndoManager->GetRedoActionCount();
1484 : 0 : fnGetComment = &::svl::IUndoManager::GetRedoActionComment;
1485 : : }
1486 : :
1487 [ # # ]: 0 : String sList;
1488 [ # # ]: 0 : if( nCount )
1489 : : {
1490 [ # # ]: 0 : for( sal_uInt16 n = 0; n < nCount; ++n )
1491 [ # # ][ # # ]: 0 : ( sList += (pUndoManager->*fnGetComment)( n, ::svl::IUndoManager::TopLevel ) )
[ # # ]
1492 [ # # ]: 0 : += '\n';
1493 : : }
1494 : :
1495 [ # # ]: 0 : SfxStringListItem aItem( nWhich );
1496 [ # # ][ # # ]: 0 : if ((nWhich == SID_GETUNDOSTRINGS) &&
[ # # ]
1497 [ # # ]: 0 : rSh.GetLastUndoInfo(0, 0))
1498 : : {
1499 [ # # ]: 0 : rSh.GetDoStrings( SwWrtShell::UNDO, aItem );
1500 : : }
1501 [ # # ][ # # ]: 0 : else if ((nWhich == SID_GETREDOSTRINGS) &&
[ # # ]
1502 [ # # ]: 0 : (rSh.GetFirstRedoInfo(0)))
1503 : : {
1504 [ # # ]: 0 : rSh.GetDoStrings( SwWrtShell::UNDO, aItem );
1505 : : }
1506 : :
1507 [ # # ][ # # ]: 0 : sList += aItem.GetString();
[ # # ]
1508 [ # # ]: 0 : aItem.SetString( sList );
1509 [ # # ][ # # ]: 0 : rSet.Put( aItem );
[ # # ]
1510 : : }
1511 : : else
1512 [ # # ]: 0 : rSet.DisableItem( nWhich );
1513 : : }
1514 : 0 : break;
1515 : :
1516 : : default:
1517 : : {
1518 [ # # ][ # # ]: 0 : pSfxViewFrame->GetSlotState( nWhich, pSfxViewFrame->GetInterface(), &rSet );
1519 : 0 : break;
1520 : : }
1521 : :
1522 : : }
1523 : :
1524 [ # # ]: 0 : if (pPostItMgr->GetActiveSidebarWin()->GetLayoutStatus()==SwPostItHelper::DELETED)
1525 [ # # ]: 0 : rSet.DisableItem( nWhich );
1526 : :
1527 [ # # ]: 0 : nWhich = aIter.NextWhich();
1528 [ # # ]: 0 : }
1529 : : }
1530 : :
1531 : 0 : void SwAnnotationShell::StateDisableItems( SfxItemSet &rSet )
1532 : : {
1533 [ # # ]: 0 : SfxWhichIter aIter(rSet);
1534 [ # # ]: 0 : sal_uInt16 nWhich = aIter.FirstWhich();
1535 [ # # ]: 0 : while (nWhich)
1536 : : {
1537 [ # # ]: 0 : rSet.DisableItem( nWhich );
1538 [ # # ]: 0 : nWhich = aIter.NextWhich();
1539 [ # # ]: 0 : }
1540 : 0 : }
1541 : :
1542 : 0 : void SwAnnotationShell::InsertSymbol(SfxRequest& rReq)
1543 : : {
1544 : 0 : SwPostItMgr* pPostItMgr = rView.GetPostItMgr();
1545 [ # # ][ # # ]: 0 : if ( !pPostItMgr || !pPostItMgr->HasActiveSidebarWin() )
[ # # ][ # # ]
1546 : 0 : return;
1547 : :
1548 : 0 : OutlinerView* pOLV = pPostItMgr->GetActiveSidebarWin()->GetOutlinerView();
1549 : :
1550 : 0 : const SfxItemSet *pArgs = rReq.GetArgs();
1551 : 0 : const SfxPoolItem* pItem = 0;
1552 [ # # ]: 0 : if( pArgs )
1553 [ # # ][ # # ]: 0 : pArgs->GetItemState(GetPool().GetWhich(SID_CHARMAP), sal_False, &pItem);
1554 : :
1555 [ # # ]: 0 : String sSym;
1556 [ # # ]: 0 : String sFontName;
1557 [ # # ]: 0 : if ( pItem )
1558 : : {
1559 [ # # ]: 0 : sSym = ((const SfxStringItem*)pItem)->GetValue();
1560 : 0 : const SfxPoolItem* pFtItem = NULL;
1561 [ # # ][ # # ]: 0 : pArgs->GetItemState( GetPool().GetWhich(SID_ATTR_SPECIALCHAR), sal_False, &pFtItem);
1562 [ # # ][ # # ]: 0 : const SfxStringItem* pFontItem = PTR_CAST( SfxStringItem, pFtItem );
[ # # ][ # # ]
1563 [ # # ]: 0 : if ( pFontItem )
1564 [ # # ]: 0 : sFontName = pFontItem->GetValue();
1565 : : }
1566 : :
1567 [ # # ]: 0 : SfxItemSet aSet(pOLV->GetAttribs());
1568 [ # # ]: 0 : sal_uInt16 nScript = pOLV->GetSelectedScriptType();
1569 [ # # ]: 0 : SvxFontItem aSetDlgFont( RES_CHRATR_FONT );
1570 : : {
1571 [ # # ]: 0 : SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, *aSet.GetPool() );
1572 [ # # ]: 0 : aSetItem.GetItemSet().Put( aSet, sal_False );
1573 [ # # ]: 0 : const SfxPoolItem* pI = aSetItem.GetItemOfScript( nScript );
1574 [ # # ]: 0 : if( pI )
1575 [ # # ]: 0 : aSetDlgFont = *(SvxFontItem*)pI;
1576 : : else
1577 : : aSetDlgFont = (SvxFontItem&)aSet.Get( GetWhichOfScript(
1578 : : SID_ATTR_CHAR_FONT,
1579 [ # # ][ # # ]: 0 : GetI18NScriptTypeOfLanguage( (sal_uInt16)GetAppLanguage() ) ));
[ # # ][ # # ]
[ # # ]
1580 [ # # ]: 0 : if (!sFontName.Len())
1581 [ # # ][ # # ]: 0 : sFontName = aSetDlgFont.GetFamilyName();
1582 : : }
1583 : :
1584 [ # # ]: 0 : Font aFont(sFontName, Size(1,1));
1585 [ # # ]: 0 : if( !sSym.Len() )
1586 : : {
1587 [ # # ]: 0 : SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
1588 : :
1589 [ # # ]: 0 : SfxAllItemSet aAllSet( GetPool() );
1590 [ # # ][ # # ]: 0 : aAllSet.Put( SfxBoolItem( FN_PARAM_1, sal_False ) );
[ # # ]
1591 : :
1592 [ # # ]: 0 : SwViewOption aOpt(*rView.GetWrtShell().GetViewOptions());
1593 [ # # ]: 0 : String sSymbolFont = aOpt.GetSymbolFont();
1594 [ # # ]: 0 : if( sSymbolFont.Len() )
1595 [ # # ][ # # ]: 0 : aAllSet.Put( SfxStringItem( SID_FONT_NAME, sSymbolFont ) );
[ # # ]
1596 : : else
1597 [ # # ][ # # ]: 0 : aAllSet.Put( SfxStringItem( SID_FONT_NAME, aSetDlgFont.GetFamilyName() ) );
[ # # ]
1598 : :
1599 : : // Wenn Zeichen selektiert ist kann es angezeigt werden
1600 : : SfxAbstractDialog* pDlg = pFact->CreateSfxDialog( rView.GetWindow(), aAllSet,
1601 [ # # ][ # # ]: 0 : rView.GetViewFrame()->GetFrame().GetFrameInterface(), RID_SVXDLG_CHARMAP );
[ # # ]
1602 : :
1603 [ # # ]: 0 : sal_uInt16 nResult = pDlg->Execute();
1604 [ # # ]: 0 : if( nResult == RET_OK )
1605 : : {
1606 [ # # ][ # # ]: 0 : SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pCItem, SfxStringItem, SID_CHARMAP, sal_False );
[ # # ]
1607 [ # # ][ # # ]: 0 : SFX_ITEMSET_ARG( pDlg->GetOutputItemSet(), pFontItem, SvxFontItem, SID_ATTR_CHAR_FONT, sal_False );
[ # # ]
1608 [ # # ]: 0 : if ( pFontItem )
1609 : : {
1610 [ # # ][ # # ]: 0 : aFont.SetName( pFontItem->GetFamilyName() );
1611 [ # # ]: 0 : aFont.SetStyleName( pFontItem->GetStyleName() );
1612 [ # # ]: 0 : aFont.SetCharSet( pFontItem->GetCharSet() );
1613 [ # # ]: 0 : aFont.SetPitch( pFontItem->GetPitch() );
1614 : : }
1615 : :
1616 [ # # ]: 0 : if ( pCItem )
1617 : : {
1618 [ # # ]: 0 : sSym = pCItem->GetValue();
1619 [ # # ][ # # ]: 0 : aOpt.SetSymbolFont(aFont.GetName());
1620 [ # # ][ # # ]: 0 : SW_MOD()->ApplyUsrPref(aOpt, &rView);
1621 : : }
1622 : : }
1623 : :
1624 [ # # ][ # # ]: 0 : delete( pDlg );
[ # # ][ # # ]
[ # # ]
1625 : : }
1626 : :
1627 [ # # ]: 0 : if( sSym.Len() )
1628 : : {
1629 : : // nicht flackern
1630 [ # # ]: 0 : pOLV->HideCursor();
1631 : 0 : Outliner * pOutliner = pOLV->GetOutliner();
1632 [ # # ]: 0 : pOutliner->SetUpdateMode(sal_False);
1633 : :
1634 [ # # ]: 0 : SfxItemSet aOldSet( pOLV->GetAttribs() );
1635 : 0 : SfxItemSet aFontSet( *aOldSet.GetPool(),
1636 : : EE_CHAR_FONTINFO, EE_CHAR_FONTINFO,
1637 : : EE_CHAR_FONTINFO_CJK, EE_CHAR_FONTINFO_CJK,
1638 : : EE_CHAR_FONTINFO_CTL, EE_CHAR_FONTINFO_CTL,
1639 [ # # ]: 0 : 0 );
1640 [ # # ]: 0 : aFontSet.Set( aOldSet );
1641 : :
1642 : : // String einfuegen
1643 [ # # ]: 0 : pOLV->InsertText( sSym);
1644 : :
1645 : : // attributieren (Font setzen)
1646 [ # # ]: 0 : SfxItemSet aSetFont( *aFontSet.GetPool(), aFontSet.GetRanges() );
1647 [ # # ]: 0 : SvxFontItem aFontItem (aFont.GetFamily(), aFont.GetName(),
1648 [ # # ]: 0 : aFont.GetStyleName(), aFont.GetPitch(),
1649 [ # # ]: 0 : aFont.GetCharSet(),
1650 [ # # ][ # # ]: 0 : EE_CHAR_FONTINFO );
[ # # ]
1651 [ # # ][ # # ]: 0 : sal_uInt16 nScriptBreak = pBreakIt->GetAllScriptsOfText( sSym );
1652 [ # # ]: 0 : if( SCRIPTTYPE_LATIN & nScriptBreak )
1653 [ # # ]: 0 : aSetFont.Put( aFontItem, EE_CHAR_FONTINFO );
1654 [ # # ]: 0 : if( SCRIPTTYPE_ASIAN & nScriptBreak )
1655 [ # # ]: 0 : aSetFont.Put( aFontItem, EE_CHAR_FONTINFO_CJK );
1656 [ # # ]: 0 : if( SCRIPTTYPE_COMPLEX & nScriptBreak )
1657 [ # # ]: 0 : aSetFont.Put( aFontItem, EE_CHAR_FONTINFO_CTL );
1658 [ # # ]: 0 : pOLV->SetAttribs(aSetFont);
1659 : :
1660 : : // Selektion loeschen
1661 [ # # ]: 0 : ESelection aSel(pOLV->GetSelection());
1662 : 0 : aSel.nStartPara = aSel.nEndPara;
1663 : 0 : aSel.nStartPos = aSel.nEndPos;
1664 [ # # ]: 0 : pOLV->SetSelection(aSel);
1665 : :
1666 : : // Alten Font restaurieren
1667 [ # # ]: 0 : pOLV->SetAttribs( aFontSet );
1668 : :
1669 : : // ab jetzt wieder anzeigen
1670 [ # # ]: 0 : pOutliner->SetUpdateMode(sal_True);
1671 [ # # ]: 0 : pOLV->ShowCursor();
1672 : :
1673 [ # # ][ # # ]: 0 : rReq.AppendItem( SfxStringItem( GetPool().GetWhich(SID_CHARMAP), sSym ) );
[ # # ][ # # ]
1674 [ # # ][ # # ]: 0 : if(aFont.GetName().Len())
1675 [ # # ][ # # ]: 0 : rReq.AppendItem( SfxStringItem( SID_ATTR_SPECIALCHAR, aFont.GetName() ) );
[ # # ][ # # ]
1676 [ # # ][ # # ]: 0 : rReq.Done();
[ # # ][ # # ]
[ # # ]
1677 [ # # ][ # # ]: 0 : }
[ # # ][ # # ]
[ # # ]
1678 : : }
1679 : :
1680 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|