LibreOffice Module sw (master)  1
docst.cxx
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3  * This file is part of the LibreOffice project.
4  *
5  * This Source Code Form is subject to the terms of the Mozilla Public
6  * License, v. 2.0. If a copy of the MPL was not distributed with this
7  * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8  *
9  * This file incorporates work covered by the following license notice:
10  *
11  * Licensed to the Apache Software Foundation (ASF) under one or more
12  * contributor license agreements. See the NOTICE file distributed
13  * with this work for additional information regarding copyright
14  * ownership. The ASF licenses this file to you under the Apache
15  * License, Version 2.0 (the "License"); you may not use this file
16  * except in compliance with the License. You may obtain a copy of
17  * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18  */
19 
20 #include <memory>
21 
22 #include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/container/XNameAccess.hpp>
25 
26 #include <comphelper/flagguard.hxx>
27 
28 #include <sal/log.hxx>
29 #include <hintids.hxx>
30 #include <sfx2/app.hxx>
31 #include <sfx2/styledlg.hxx>
32 #include <svl/whiter.hxx>
33 #include <sfx2/templdlg.hxx>
34 #include <sfx2/tplpitem.hxx>
35 #include <sfx2/request.hxx>
36 #include <sfx2/dispatch.hxx>
37 #include <sfx2/newstyle.hxx>
38 #include <sfx2/printer.hxx>
39 #include <sfx2/viewfrm.hxx>
40 #include <svl/macitem.hxx>
41 #include <svl/stritem.hxx>
42 #include <svl/languageoptions.hxx>
43 #include <editeng/eeitem.hxx>
44 #include <sfx2/htmlmode.hxx>
45 #include <swmodule.hxx>
46 #include <wdocsh.hxx>
47 #include <fmtfsize.hxx>
48 #include <fchrfmt.hxx>
49 #include <svtools/htmlcfg.hxx>
50 #include <svx/xdef.hxx>
51 #include <SwStyleNameMapper.hxx>
52 #include <SwRewriter.hxx>
53 #include <numrule.hxx>
54 #include <swundo.hxx>
55 #include <svx/svdmodel.hxx>
56 #include <svx/drawitem.hxx>
57 #include <svx/svxids.hrc>
58 #include <view.hxx>
59 #include <wrtsh.hxx>
60 #include <docsh.hxx>
61 #include <uitool.hxx>
62 #include <cmdid.h>
63 #include <globals.hrc>
64 #include <viewopt.hxx>
65 #include <doc.hxx>
66 #include <drawdoc.hxx>
68 #include <IDocumentUndoRedo.hxx>
72 #include <IDocumentListsAccess.hxx>
73 #include <IDocumentState.hxx>
74 #include <frmfmt.hxx>
75 #include <charfmt.hxx>
76 #include <poolfmt.hxx>
77 #include <pagedesc.hxx>
78 #include <docstyle.hxx>
79 #include <uiitems.hxx>
80 #include <fmtcol.hxx>
81 #include <frmmgr.hxx>
82 #include <swevent.hxx>
83 #include <edtwin.hxx>
84 #include <unochart.hxx>
85 #include <app.hrc>
86 #include <swabstdlg.hxx>
87 #include <list.hxx>
88 #include <paratr.hxx>
89 #include <tblafmt.hxx>
90 #include <sfx2/watermarkitem.hxx>
91 #include <SwUndoFmt.hxx>
92 
93 using namespace ::com::sun::star;
94 
96 {
97  SfxWhichIter aIter(rSet);
98  sal_uInt16 nWhich = aIter.FirstWhich();
99  SfxStyleFamily nActualFamily = SfxStyleFamily(USHRT_MAX);
100 
101  SwWrtShell* pShell = pSh ? pSh : GetWrtShell();
102  if(!pShell)
103  {
104  while (nWhich)
105  {
106  rSet.DisableItem(nWhich);
107  nWhich = aIter.NextWhich();
108  }
109  return;
110  }
111  else
112  {
113  SfxViewFrame* pFrame = pShell->GetView().GetViewFrame();
114  std::unique_ptr<SfxPoolItem> pItem;
115  pFrame->GetBindings().QueryState(SID_STYLE_FAMILY, pItem);
116  SfxUInt16Item* pFamilyItem = dynamic_cast<SfxUInt16Item*>(pItem.get());
117  if (pFamilyItem)
118  {
119  nActualFamily = static_cast<SfxStyleFamily>(pFamilyItem->GetValue());
120  }
121  }
122 
123  while (nWhich)
124  {
125  // determine current template to every family
126  OUString aName;
127  SwTableAutoFormat aTableAutoFormat("dummy"); // needed to check if can take a table auto format at current cursor position
128  switch (nWhich)
129  {
130  case SID_STYLE_APPLY:
131  {// here the template and its family are passed to the StyleBox
132  // so that this family is being showed
133  if(pShell->IsFrameSelected())
134  {
135  SwFrameFormat* pFormat = pShell->GetSelectedFrameFormat();
136  if( pFormat )
137  aName = pFormat->GetName();
138  }
139  else
140  {
141  SwTextFormatColl* pColl = pShell->GetCurTextFormatColl();
142  if(pColl)
143  aName = pColl->GetName();
144  }
145  rSet.Put(SfxTemplateItem(nWhich, aName));
146  }
147  break;
148  case SID_STYLE_FAMILY1:
149  if( !pShell->IsFrameSelected() )
150  {
151  SwCharFormat* pFormat = pShell->GetCurCharFormat();
152  if(pFormat)
153  aName = pFormat->GetName();
154  else
157  rSet.Put(SfxTemplateItem(nWhich, aName));
158  }
159  break;
160 
161  case SID_STYLE_FAMILY2:
162  if(!pShell->IsFrameSelected())
163  {
164  SwTextFormatColl* pColl = pShell->GetCurTextFormatColl();
165  if(pColl)
166  aName = pColl->GetName();
167 
168  SfxTemplateItem aItem(nWhich, aName);
169 
170  SfxStyleSearchBits nMask = SfxStyleSearchBits::Auto;
171  if (m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE))
172  nMask = SfxStyleSearchBits::SwHtml;
173  else
174  {
175  const FrameTypeFlags nSelection = pShell->GetFrameType(nullptr,true);
176  if(pShell->GetCurTOX())
177  nMask = SfxStyleSearchBits::SwIndex ;
178  else if(nSelection & FrameTypeFlags::HEADER ||
179  nSelection & FrameTypeFlags::FOOTER ||
180  nSelection & FrameTypeFlags::TABLE ||
181  nSelection & FrameTypeFlags::FLY_ANY ||
182  nSelection & FrameTypeFlags::FOOTNOTE ||
183  nSelection & FrameTypeFlags::FTNPAGE)
184  nMask = SfxStyleSearchBits::SwExtra;
185  else
186  nMask = SfxStyleSearchBits::SwText;
187  }
188 
189  aItem.SetValue(nMask);
190  rSet.Put(aItem);
191  }
192 
193  break;
194 
195  case SID_STYLE_FAMILY3:
196 
197  if (m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE))
198  rSet.DisableItem( nWhich );
199  else
200  {
201  SwFrameFormat* pFormat = pShell->GetSelectedFrameFormat();
202  if(pFormat && pShell->IsFrameSelected())
203  {
204  aName = pFormat->GetName();
205  rSet.Put(SfxTemplateItem(nWhich, aName));
206  }
207  }
208  break;
209 
210  case SID_STYLE_FAMILY4:
211  {
212  SvxHtmlOptions& rHtmlOpt = SvxHtmlOptions::Get();
213  if (m_xDoc->getIDocumentSettingAccess().get(DocumentSettingId::HTML_MODE) && !rHtmlOpt.IsPrintLayoutExtension())
214  rSet.DisableItem( nWhich );
215  else
216  {
217  size_t n = pShell->GetCurPageDesc( false );
218  if( n < pShell->GetPageDescCnt() )
219  aName = pShell->GetPageDesc( n ).GetName();
220 
221  rSet.Put(SfxTemplateItem(nWhich, aName));
222  }
223  }
224  break;
225  case SID_STYLE_FAMILY5:
226  {
227  const SwNumRule* pRule = pShell->GetNumRuleAtCurrCursorPos();
228  if( pRule )
229  aName = pRule->GetName();
230 
231  rSet.Put(SfxTemplateItem(nWhich, aName));
232  }
233  break;
234  case SID_STYLE_FAMILY6:
235  {
236  const SwTableNode *pTableNd = pShell->IsCursorInTable();
237  if( pTableNd )
238  aName = pTableNd->GetTable().GetTableStyleName();
239 
240  rSet.Put(SfxTemplateItem(nWhich, aName));
241  }
242  break;
243 
244  case SID_STYLE_WATERCAN:
245  {
246  SwEditWin& rEdtWin = pShell->GetView().GetEditWin();
247  SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
248  rSet.Put(SfxBoolItem(nWhich, pApply && pApply->eType != SfxStyleFamily(0)));
249  }
250  break;
251  case SID_STYLE_UPDATE_BY_EXAMPLE:
252  if( pShell->IsFrameSelected()
253  ? SfxStyleFamily::Frame != nActualFamily
254  : ( SfxStyleFamily::Frame == nActualFamily ||
255  SfxStyleFamily::Page == nActualFamily ||
256  (SfxStyleFamily::Pseudo == nActualFamily && !pShell->GetNumRuleAtCurrCursorPos()) ||
257  (SfxStyleFamily::Table == nActualFamily && !pShell->GetTableAutoFormat(aTableAutoFormat))) )
258  {
259  rSet.DisableItem( nWhich );
260  }
261  break;
262 
263  case SID_STYLE_NEW_BY_EXAMPLE:
264  if( (pShell->IsFrameSelected()
265  ? SfxStyleFamily::Frame != nActualFamily
266  : SfxStyleFamily::Frame == nActualFamily) ||
267  (SfxStyleFamily::Pseudo == nActualFamily && !pShell->GetNumRuleAtCurrCursorPos()) ||
268  (SfxStyleFamily::Table == nActualFamily && !pShell->GetTableAutoFormat(aTableAutoFormat)) )
269  {
270  rSet.DisableItem( nWhich );
271  }
272  break;
273 
274  case SID_CLASSIFICATION_APPLY:
275  // Just trigger ClassificationCategoriesController::statusChanged().
276  rSet.InvalidateItem(nWhich);
277  break;
278  case SID_CLASSIFICATION_DIALOG:
279  rSet.InvalidateItem(nWhich);
280  break;
281  case SID_STYLE_EDIT:
282  break;
283  case SID_WATERMARK:
284  if (pSh)
285  {
286  SfxWatermarkItem aItem = pSh->GetWatermark();
287  rSet.Put(aItem);
288  }
289  break;
290  default:
291  OSL_FAIL("Invalid SlotId");
292  }
293  nWhich = aIter.NextWhich();
294  }
295 }
296 
297 // evaluate StyleSheet-Requests
299 {
300  sal_uInt16 nSlot = rReq.GetSlot();
301 
302  const SfxItemSet* pArgs = rReq.GetArgs();
303  const SfxPoolItem* pItem;
304  switch (nSlot)
305  {
306  case SID_STYLE_NEW:
307  if( pArgs && SfxItemState::SET == pArgs->GetItemState( SID_STYLE_FAMILY,
308  false, &pItem ))
309  {
310  const SfxStyleFamily nFamily = static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
311 
312  OUString sName;
313  SfxStyleSearchBits nMask = SfxStyleSearchBits::Auto;
314  if( SfxItemState::SET == pArgs->GetItemState( SID_STYLE_NEW,
315  false, &pItem ))
316  sName = static_cast<const SfxStringItem*>(pItem)->GetValue();
317  if( SfxItemState::SET == pArgs->GetItemState( SID_STYLE_MASK,
318  false, &pItem ))
319  nMask = static_cast<SfxStyleSearchBits>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
320  OUString sParent;
321  if( SfxItemState::SET == pArgs->GetItemState( SID_STYLE_REFERENCE,
322  false, &pItem ))
323  sParent = static_cast<const SfxStringItem*>(pItem)->GetValue();
324 
325  if (sName.isEmpty() && m_xBasePool.get())
327 
328  Edit(sName, sParent, nFamily, nMask, true, OString(), nullptr, &rReq, nSlot);
329  }
330  break;
331 
332  case SID_STYLE_APPLY:
333  if( !pArgs )
334  {
335  GetView()->GetViewFrame()->GetDispatcher()->Execute(SID_STYLE_DESIGNER);
336  break;
337  }
338  else
339  {
340  // convert internal StyleName to DisplayName (slot implementation uses the latter)
341  const SfxStringItem* pNameItem = rReq.GetArg<SfxStringItem>(SID_APPLY_STYLE);
342  const SfxStringItem* pFamilyItem = rReq.GetArg<SfxStringItem>(SID_STYLE_FAMILYNAME);
343  if ( pFamilyItem && pNameItem )
344  {
345  uno::Reference< style::XStyleFamiliesSupplier > xModel(GetModel(), uno::UNO_QUERY);
346  try
347  {
348  uno::Reference< container::XNameAccess > xStyles;
349  uno::Reference< container::XNameAccess > xCont = xModel->getStyleFamilies();
350  xCont->getByName(pFamilyItem->GetValue()) >>= xStyles;
351  uno::Reference< beans::XPropertySet > xInfo;
352  xStyles->getByName( pNameItem->GetValue() ) >>= xInfo;
353  OUString aUIName;
354  xInfo->getPropertyValue("DisplayName") >>= aUIName;
355  if ( !aUIName.isEmpty() )
356  rReq.AppendItem( SfxStringItem( SID_STYLE_APPLY, aUIName ) );
357  }
358  catch (const uno::Exception&)
359  {
360  }
361  }
362  }
363 
364  [[fallthrough]];
365 
366  case SID_STYLE_EDIT:
367  case SID_STYLE_DELETE:
368  case SID_STYLE_HIDE:
369  case SID_STYLE_SHOW:
370  case SID_STYLE_WATERCAN:
371  case SID_STYLE_FAMILY:
372  case SID_STYLE_UPDATE_BY_EXAMPLE:
373  case SID_STYLE_NEW_BY_EXAMPLE:
374  {
375  OUString aParam;
376  SfxStyleFamily nFamily = SfxStyleFamily::Para;
377  SfxStyleSearchBits nMask = SfxStyleSearchBits::Auto;
378  SwWrtShell* pActShell = nullptr;
379 
380  if( !pArgs )
381  {
382  nFamily = SfxStyleFamily::Para;
383 
384  switch (nSlot)
385  {
386  case SID_STYLE_NEW_BY_EXAMPLE:
387  {
389  if (aDlg.run() == RET_OK)
390  {
391  aParam = aDlg.GetName();
392  rReq.AppendItem(SfxStringItem(nSlot, aParam));
393  }
394  }
395  break;
396 
397  case SID_STYLE_UPDATE_BY_EXAMPLE:
398  case SID_STYLE_EDIT:
399  {
401  if(pColl)
402  {
403  aParam = pColl->GetName();
404  rReq.AppendItem(SfxStringItem(nSlot, aParam));
405  }
406  }
407  break;
408  }
409  }
410  else
411  {
412  SAL_WARN_IF( !pArgs->Count(), "sw.ui", "SfxBug ItemSet is empty" );
413 
414  SwWrtShell* pShell = GetWrtShell();
415  if( SfxItemState::SET == pArgs->GetItemState(nSlot, false, &pItem ))
416  aParam = static_cast<const SfxStringItem*>(pItem)->GetValue();
417 
418  if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_FAMILY,
419  false, &pItem ))
420  nFamily = static_cast<SfxStyleFamily>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
421 
422  if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_FAMILYNAME, false, &pItem ))
423  {
424  OUString aFamily = static_cast<const SfxStringItem*>(pItem)->GetValue();
425  if(aFamily == "CharacterStyles")
426  nFamily = SfxStyleFamily::Char;
427  else
428  if(aFamily == "ParagraphStyles")
429  nFamily = SfxStyleFamily::Para;
430  else
431  if(aFamily == "PageStyles")
432  nFamily = SfxStyleFamily::Page;
433  else
434  if(aFamily == "FrameStyles")
435  nFamily = SfxStyleFamily::Frame;
436  else
437  if(aFamily == "NumberingStyles")
438  nFamily = SfxStyleFamily::Pseudo;
439  else
440  if(aFamily == "TableStyles")
441  nFamily = SfxStyleFamily::Table;
442  }
443 
444  if( SfxItemState::SET == pArgs->GetItemState(SID_STYLE_MASK,
445  false, &pItem ))
446  nMask = static_cast<SfxStyleSearchBits>(static_cast<const SfxUInt16Item*>(pItem)->GetValue());
447  if( SfxItemState::SET == pArgs->GetItemState(FN_PARAM_WRTSHELL,
448  false, &pItem ))
449  pActShell = pShell = static_cast<SwWrtShell*>(static_cast<const SwPtrItem*>(pItem)->GetValue());
450 
451  if( nSlot == SID_STYLE_UPDATE_BY_EXAMPLE && aParam.isEmpty() )
452  {
453  switch( nFamily )
454  {
455  case SfxStyleFamily::Para:
456  {
457  SwTextFormatColl* pColl = pShell->GetCurTextFormatColl();
458  if(pColl)
459  aParam = pColl->GetName();
460  }
461  break;
462  case SfxStyleFamily::Frame:
463  {
465  if( pFrame )
466  aParam = pFrame->GetName();
467  }
468  break;
469  case SfxStyleFamily::Char:
470  {
472  if( pChar )
473  aParam = pChar->GetName();
474  }
475  break;
476  case SfxStyleFamily::Pseudo:
477  if(SfxItemState::SET == pArgs->GetItemState(SID_STYLE_UPD_BY_EX_NAME, false, &pItem))
478  {
479  aParam = static_cast<const SfxStringItem*>(pItem)->GetValue();
480  }
481  break;
482  case SfxStyleFamily::Table:
483  if(SfxItemState::SET == pArgs->GetItemState(SID_STYLE_UPD_BY_EX_NAME, false, &pItem))
484  {
485  aParam = static_cast<const SfxStringItem*>(pItem)->GetValue();
486  }
487  break;
488  default: break;
489  }
490  rReq.AppendItem(SfxStringItem(nSlot, aParam));
491  }
492  }
493  if (!aParam.isEmpty() || nSlot == SID_STYLE_WATERCAN )
494  {
495  sal_uInt16 nRet = 0xffff;
496  bool bReturns = false;
497 
498  switch(nSlot)
499  {
500  case SID_STYLE_EDIT:
501  Edit(aParam, OUString(), nFamily, nMask, false, OString(), pActShell);
502  break;
503  case SID_STYLE_DELETE:
504  Delete(aParam, nFamily);
505  break;
506  case SID_STYLE_HIDE:
507  case SID_STYLE_SHOW:
508  Hide(aParam, nFamily, nSlot == SID_STYLE_HIDE);
509  break;
510  case SID_STYLE_APPLY:
511  // Shell-switch in ApplyStyles
512  nRet = static_cast<sal_uInt16>(ApplyStyles(aParam, nFamily, pActShell, rReq.GetModifier() ));
513  bReturns = true;
514  break;
515  case SID_STYLE_WATERCAN:
516  nRet = static_cast<sal_uInt16>(DoWaterCan(aParam, nFamily));
517  bReturns = true;
518  break;
519  case SID_STYLE_UPDATE_BY_EXAMPLE:
520  UpdateStyle(aParam, nFamily, pActShell);
521  break;
522  case SID_STYLE_NEW_BY_EXAMPLE:
523  MakeByExample(aParam, nFamily, nMask, pActShell);
524  break;
525 
526  default:
527  OSL_FAIL("Invalid SlotId");
528  }
529 
530  if (bReturns)
531  {
532  if(rReq.IsAPI()) // Basic only gets TRUE or FALSE
533  rReq.SetReturnValue(SfxUInt16Item(nSlot, sal_uInt16(nRet !=0)));
534  else
535  rReq.SetReturnValue(SfxUInt16Item(nSlot, nRet));
536  }
537 
538  rReq.Done();
539  }
540 
541  break;
542  }
543  }
544 }
545 
547 {
548 public:
549  ApplyStyle(SwDocShell &rDocSh, bool bNew,
552  rtl::Reference< SfxStyleSheetBasePool > const & xBasePool,
553  bool bModified)
554  : m_pDlg(pDlg)
555  , m_rDocSh(rDocSh)
556  , m_bNew(bNew)
557  , m_xTmp(xTmp)
558  , m_nFamily(nFamily)
559  , m_xBasePool(xBasePool)
560  , m_bModified(bModified)
561  {
562  }
563  DECL_LINK( ApplyHdl, LinkParamNone*, void );
564  void apply()
565  {
566  ApplyHdl(nullptr);
567  }
569 private:
571  bool const m_bNew;
575  bool const m_bModified;
576 };
577 
579 {
580  SwWrtShell* pWrtShell = m_rDocSh.GetWrtShell();
581  SwDoc* pDoc = m_rDocSh.GetDoc();
582  SwView* pView = m_rDocSh.GetView();
583 
584  pWrtShell->StartAllAction();
585 
586  if( SfxStyleFamily::Para == m_nFamily )
587  {
588  SfxItemSet aSet( *m_pDlg->GetOutputItemSet() );
589  ::SfxToSwPageDescAttr( *pWrtShell, aSet );
590  // reset indent attributes at paragraph style, if a list style
591  // will be applied and no indent attributes will be applied.
592  m_xTmp->SetItemSet( aSet, true );
593  }
594  else
595  {
596  if(SfxStyleFamily::Page == m_nFamily)
597  {
598  static const sal_uInt16 aInval[] = {
599  SID_IMAGE_ORIENTATION,
600  SID_ATTR_CHAR_FONT,
602  pView->GetViewFrame()->GetBindings().Invalidate(aInval);
603  }
604  SfxItemSet aTmpSet( *m_pDlg->GetOutputItemSet() );
605  if( SfxStyleFamily::Char == m_nFamily )
606  {
607  ::ConvertAttrGenToChar(aTmpSet, m_xTmp->GetItemSet());
608  }
609 
610  m_xTmp->SetItemSet( aTmpSet );
611 
612  if( SfxStyleFamily::Page == m_nFamily && SvtLanguageOptions().IsCTLFontEnabled() )
613  {
614  const SfxPoolItem *pItem = nullptr;
615  if( aTmpSet.GetItemState( m_rDocSh.GetPool().GetTrueWhich( SID_ATTR_FRAMEDIRECTION, false ) , true, &pItem ) == SfxItemState::SET )
617  }
618  }
619 
620  if(m_bNew)
621  {
622  if(SfxStyleFamily::Frame == m_nFamily || SfxStyleFamily::Para == m_nFamily)
623  {
624  // clear FillStyle so that it works as a derived attribute
625  SfxItemSet aTmpSet(*m_pDlg->GetOutputItemSet());
626 
627  aTmpSet.ClearItem(XATTR_FILLSTYLE);
628  m_xTmp->SetItemSet(aTmpSet);
629  }
630  }
631 
632  if(SfxStyleFamily::Page == m_nFamily)
633  pView->InvalidateRulerPos();
634 
635  if( m_bNew )
636  m_xBasePool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *m_xTmp));
637  else
638  m_xBasePool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetModified, *m_xTmp));
639 
640  pDoc->getIDocumentState().SetModified();
641  if( !m_bModified )
642  {
644  }
645 
646  pWrtShell->EndAllAction();
647 }
648 
650  const OUString &rName,
651  const OUString &rParent,
652  const SfxStyleFamily nFamily,
653  SfxStyleSearchBits nMask,
654  const bool bNew,
655  const OString& sPage,
656  SwWrtShell* pActShell,
657  SfxRequest* pReq,
658  sal_uInt16 nSlot)
659 {
660  assert( GetWrtShell() );
661  const bool bBasic = pReq && pReq->IsAPI();
662  SfxStyleSheetBase *pStyle = nullptr;
663 
664  bool bModified = m_xDoc->getIDocumentState().IsModified();
665 
666  SwUndoId nNewStyleUndoId(SwUndoId::EMPTY);
667 
668  if( bNew )
669  {
670  if (!bBasic)
671  {
672  // start undo action in order to get only one undo action for the
673  // UI new style + change style operations
675  }
676 
677  if( SfxStyleSearchBits::All != nMask && SfxStyleSearchBits::AllVisible != nMask && SfxStyleSearchBits::Used != nMask )
678  nMask |= SfxStyleSearchBits::UserDefined;
679  else
680  nMask = SfxStyleSearchBits::UserDefined;
681 
682  if ( nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char || nFamily == SfxStyleFamily::Frame )
683  {
684  // Prevent undo append from being done during paragraph, character, and frame style Make
685  // Do it after ok return from style dialog when derived from style is known
686  ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
687  pStyle = &m_xBasePool->Make( rName, nFamily, nMask );
688  }
689  else
690  {
691  pStyle = &m_xBasePool->Make( rName, nFamily, nMask );
692  }
693 
694  // set the current one as Parent
695  SwDocStyleSheet* pDStyle = static_cast<SwDocStyleSheet*>(pStyle);
696  switch( nFamily )
697  {
698  case SfxStyleFamily::Para:
699  {
700  if(!rParent.isEmpty())
701  {
703  if(!pColl)
704  {
706  if(USHRT_MAX != nId)
707  pColl = m_pWrtShell->GetTextCollFromPool( nId );
708  }
709  pDStyle->GetCollection()->SetDerivedFrom( pColl );
710  pDStyle->PresetParent( rParent );
711 
712  /*When a new paragraph style is created based on a "to outline style
713  assigned" paragraph style, the outline level attribute and the list
714  style attribute of the new paragraph style have to be set to 0
715  respectively "".*/
716  if (pColl && pColl->IsAssignedToListLevelOfOutlineStyle())
717  {
718  SwNumRuleItem aItem;
719  pDStyle->GetCollection()->SetFormatAttr( aItem );
720  pDStyle->GetCollection()->SetAttrOutlineLevel( 0 );
721  }
722  }
723  else
724  {
726  pDStyle->GetCollection()->SetDerivedFrom( pColl );
727  if( pColl )
728  pDStyle->PresetParent( pColl->GetName() );
729  }
730  }
731  break;
732  case SfxStyleFamily::Char:
733  {
734  if(!rParent.isEmpty())
735  {
736  SwCharFormat* pCFormat = m_pWrtShell->FindCharFormatByName(rParent);
737  if(!pCFormat)
738  {
740  if(USHRT_MAX != nId)
741  pCFormat = m_pWrtShell->GetCharFormatFromPool( nId );
742  }
743 
744  pDStyle->GetCharFormat()->SetDerivedFrom( pCFormat );
745  pDStyle->PresetParent( rParent );
746  }
747  else
748  {
750  pDStyle->GetCharFormat()->SetDerivedFrom( pCFormat );
751  if( pCFormat )
752  pDStyle->PresetParent( pCFormat->GetName() );
753  }
754  }
755  break;
756  case SfxStyleFamily::Frame :
757  {
758  if(!rParent.isEmpty())
759  {
760  SwFrameFormat* pFFormat = m_pWrtShell->GetDoc()->FindFrameFormatByName( rParent );
761  if(!pFFormat)
762  {
764  if(USHRT_MAX != nId)
765  pFFormat = m_pWrtShell->GetFrameFormatFromPool( nId );
766  }
767  pDStyle->GetFrameFormat()->SetDerivedFrom( pFFormat );
768  pDStyle->PresetParent( rParent );
769  }
770  }
771  break;
772  default: break;
773  }
774 
775  if (!bBasic)
776  {
777  //Get the undo id for the type of style that was created in order to re-use that comment for the grouped
778  //create style + change style operations
779  m_pWrtShell->GetLastUndoInfo(nullptr, &nNewStyleUndoId);
780  }
781  }
782  else
783  {
784  pStyle = m_xBasePool->Find( rName, nFamily );
785  SAL_WARN_IF( !pStyle, "sw.ui", "Style not found" );
786  }
787 
788  if(!pStyle)
789  return;
790 
791  // put dialogues together
792  rtl::Reference< SwDocStyleSheet > xTmp( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pStyle) ) );
793  if( SfxStyleFamily::Para == nFamily )
794  {
795  SfxItemSet& rSet = xTmp->GetItemSet();
796  ::SwToSfxPageDescAttr( rSet );
797  // merge list level indent attributes into the item set if needed
798  xTmp->MergeIndentAttrsOfListStyle( rSet );
799  }
800  else if( SfxStyleFamily::Char == nFamily )
801  {
802  ::ConvertAttrCharToGen(xTmp->GetItemSet());
803  }
804 
805  if(SfxStyleFamily::Page == nFamily || SfxStyleFamily::Para == nFamily)
806  {
807  // create needed items for XPropertyList entries from the DrawModel so that
808  // the Area TabPage can access them
809  SfxItemSet& rSet = xTmp->GetItemSet();
810  const SwDrawModel* pDrawModel = GetDoc()->getIDocumentDrawModelAccess().GetDrawModel();
811 
812  rSet.Put(SvxColorListItem(pDrawModel->GetColorList(), SID_COLOR_TABLE));
813  rSet.Put(SvxGradientListItem(pDrawModel->GetGradientList(), SID_GRADIENT_LIST));
814  rSet.Put(SvxHatchListItem(pDrawModel->GetHatchList(), SID_HATCH_LIST));
815  rSet.Put(SvxBitmapListItem(pDrawModel->GetBitmapList(), SID_BITMAP_LIST));
816  rSet.Put(SvxPatternListItem(pDrawModel->GetPatternList(), SID_PATTERN_LIST));
817  }
818 
819  if (!bBasic)
820  {
821  // prior to the dialog the HtmlMode at the DocShell is being sunk
822  sal_uInt16 nHtmlMode = ::GetHtmlMode(this);
823 
824  // In HTML mode, we do not always have a printer. In order to show
825  // the correct page size in the Format - Page dialog, we have to
826  // get one here.
827  SwWrtShell* pCurrShell = pActShell ? pActShell : m_pWrtShell;
828  if( ( HTMLMODE_ON & nHtmlMode ) &&
829  !pCurrShell->getIDocumentDeviceAccess().getPrinter( false ) )
830  pCurrShell->InitPrt( pCurrShell->getIDocumentDeviceAccess().getPrinter( true ) );
831 
832  PutItem(SfxUInt16Item(SID_HTML_MODE, nHtmlMode));
833  FieldUnit eMetric = ::GetDfltMetric(0 != (HTMLMODE_ON&nHtmlMode));
834  SW_MOD()->PutItem(SfxUInt16Item(SID_ATTR_METRIC, static_cast< sal_uInt16 >(eMetric)));
837  *xTmp, nFamily, sPage, pCurrShell, bNew));
838  std::shared_ptr<ApplyStyle> pApplyStyleHelper(new ApplyStyle(*this, bNew, xTmp, nFamily, pDlg.get(), m_xBasePool, bModified));
839  pDlg->SetApplyHdl(LINK(pApplyStyleHelper.get(), ApplyStyle, ApplyHdl));
840 
841  std::shared_ptr<SfxRequest> pRequest;
842  if (pReq)
843  {
844  pRequest.reset(new SfxRequest(*pReq));
845  pReq->Ignore(); // the 'old' request is not relevant any more
846  }
847 
848  pDlg->StartExecuteAsync([bModified, bNew, nFamily, nSlot, nNewStyleUndoId, pApplyStyleHelper, pRequest, xTmp, this](sal_Int32 nResult){
849  if (RET_OK == nResult)
850  pApplyStyleHelper->apply();
851 
852  if (bNew)
853  {
854  switch( nFamily )
855  {
856  case SfxStyleFamily::Para:
857  {
858  if(!xTmp->GetParent().isEmpty())
859  {
860  SwTextFormatColl* pColl = m_pWrtShell->FindTextFormatCollByName(xTmp->GetParent());
862  {
864  std::make_unique<SwUndoTextFormatCollCreate>(xTmp->GetCollection(), pColl, GetDoc()));
865  }
866  }
867  }
868  break;
869  case SfxStyleFamily::Char:
870  {
871  if(!xTmp->GetParent().isEmpty())
872  {
873  SwCharFormat* pCFormat = m_pWrtShell->FindCharFormatByName(xTmp->GetParent());
875  {
877  std::make_unique<SwUndoCharFormatCreate>(xTmp->GetCharFormat(), pCFormat, GetDoc()));
878  }
879  }
880  }
881  break;
882  case SfxStyleFamily::Frame:
883  {
884  if(!xTmp->GetParent().isEmpty())
885  {
886  SwFrameFormat* pFFormat = m_pWrtShell->GetDoc()->FindFrameFormatByName(xTmp->GetParent());
888  {
890  std::make_unique<SwUndoFrameFormatCreate>(xTmp->GetFrameFormat(), pFFormat, GetDoc()));
891  }
892  }
893  }
894  break;
895  default: break;
896  }
897 
898  SwRewriter aRewriter;
899  aRewriter.AddRule(UndoArg1, xTmp->GetName());
900  //Group the create style and change style operations together under the
901  //one "create style" comment
902  m_pWrtShell->EndUndo(nNewStyleUndoId, &aRewriter);
903  }
904 
905  if (RET_OK != nResult)
906  {
907  if (bNew)
908  {
909  GetWrtShell()->Undo();
910  m_xDoc->GetIDocumentUndoRedo().ClearRedo();
911  }
912 
913  if (!bModified)
914  m_xDoc->getIDocumentState().ResetModified();
915  }
916 
917  // Update Watermark if new page style was created
918  if (nSlot == SID_STYLE_NEW && nFamily == SfxStyleFamily::Page)
919  {
920  SwWrtShell* pShell = GetWrtShell();
921  const SfxWatermarkItem aWatermark = pShell->GetWatermark();
922  pShell->SetWatermark(aWatermark);
923  }
924 
925  pApplyStyleHelper->m_pDlg.disposeAndClear();
926  if (pRequest)
927  pRequest->Done();
928  });
929  }
930  else
931  {
932  // prior to the dialog the HtmlMode at the DocShell is being sunk
933  PutItem(SfxUInt16Item(SID_HTML_MODE, ::GetHtmlMode(this)));
934 
936 
937  if( SfxStyleFamily::Para == nFamily )
938  ::SfxToSwPageDescAttr( *GetWrtShell(), xTmp->GetItemSet() );
939  else
940  {
941  ::ConvertAttrGenToChar(xTmp->GetItemSet(), xTmp->GetItemSet());
942  }
943  if(SfxStyleFamily::Page == nFamily)
945 
946  if( bNew )
947  m_xBasePool->Broadcast(SfxStyleSheetHint(SfxHintId::StyleSheetCreated, *xTmp));
948 
949  m_xDoc->getIDocumentState().SetModified();
950  if( !bModified ) // Bug 57028
951  {
952  m_xDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
953  }
955  }
956 }
957 
958 void SwDocShell::Delete(const OUString &rName, SfxStyleFamily nFamily)
959 {
960  SfxStyleSheetBase *pStyle = m_xBasePool->Find(rName, nFamily);
961 
962  if(pStyle)
963  {
964  assert( GetWrtShell() );
965 
967  m_xBasePool->Remove(pStyle);
969  }
970 }
971 
972 void SwDocShell::Hide(const OUString &rName, SfxStyleFamily nFamily, bool bHidden)
973 {
974  SfxStyleSheetBase *pStyle = m_xBasePool->Find(rName, nFamily);
975 
976  if(pStyle)
977  {
978  assert( GetWrtShell() );
979 
981  rtl::Reference< SwDocStyleSheet > xTmp( new SwDocStyleSheet( *static_cast<SwDocStyleSheet*>(pStyle) ) );
982  xTmp->SetHidden( bHidden );
984  }
985 }
986 
987 // apply template
989  SwWrtShell* pShell, const sal_uInt16 nMode )
990 {
991  SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>( m_xBasePool->Find( rName, nFamily ) );
992 
993  SAL_WARN_IF( !pStyle, "sw.ui", "Style not found" );
994 
995  if(!pStyle)
996  return SfxStyleFamily::None;
997 
998  SwWrtShell *pSh = pShell ? pShell : GetWrtShell();
999 
1000  assert( pSh );
1001 
1002  pSh->StartAllAction();
1003 
1004  switch (nFamily)
1005  {
1006  case SfxStyleFamily::Char:
1007  {
1008  SwFormatCharFormat aFormat(pStyle->GetCharFormat());
1009  pSh->SetAttrItem( aFormat, (nMode & KEY_SHIFT) ?
1011  break;
1012  }
1013  case SfxStyleFamily::Para:
1014  {
1015  // #i62675#
1016  // clear also list attributes at affected text nodes, if paragraph
1017  // style has the list style attribute set.
1018  pSh->SetTextFormatColl( pStyle->GetCollection(), true );
1019  break;
1020  }
1021  case SfxStyleFamily::Frame:
1022  {
1023  if ( pSh->IsFrameSelected() )
1024  pSh->SetFrameFormat( pStyle->GetFrameFormat() );
1025  break;
1026  }
1027  case SfxStyleFamily::Page:
1028  {
1029  pSh->SetPageStyle(pStyle->GetPageDesc()->GetName());
1030  break;
1031  }
1032  case SfxStyleFamily::Pseudo:
1033  {
1034  // reset indent attribute on applying list style
1035  // continue list of list style
1036  const SwNumRule* pNumRule = pStyle->GetNumRule();
1037  const OUString sListIdForStyle =pNumRule->GetDefaultListId();
1038  pSh->SetCurNumRule( *pNumRule, false, sListIdForStyle, true );
1039  break;
1040  }
1041  case SfxStyleFamily::Table:
1042  {
1043  pSh->SetTableStyle(pStyle->GetName());
1044  break;
1045  }
1046  default:
1047  OSL_FAIL("Unknown family");
1048  }
1049  pSh->EndAllAction();
1050 
1051  return nFamily;
1052 }
1053 
1054 // start watering-can
1056 {
1057  assert( GetWrtShell() );
1058 
1059  SwEditWin& rEdtWin = m_pView->GetEditWin();
1060  SwApplyTemplate* pApply = rEdtWin.GetApplyTemplate();
1061  bool bWaterCan = !(pApply && pApply->eType != SfxStyleFamily(0));
1062 
1063  if( rName.isEmpty() )
1064  bWaterCan = false;
1065 
1066  SwApplyTemplate aTemplate;
1067  aTemplate.eType = nFamily;
1068 
1069  if(bWaterCan)
1070  {
1071  SwDocStyleSheet* pStyle =
1072  static_cast<SwDocStyleSheet*>( m_xBasePool->Find(rName, nFamily) );
1073 
1074  SAL_WARN_IF( !pStyle, "sw.ui", "Where's the StyleSheet" );
1075 
1076  if(!pStyle) return nFamily;
1077 
1078  switch(nFamily)
1079  {
1080  case SfxStyleFamily::Char:
1081  aTemplate.aColl.pCharFormat = pStyle->GetCharFormat();
1082  break;
1083  case SfxStyleFamily::Para:
1084  aTemplate.aColl.pTextColl = pStyle->GetCollection();
1085  break;
1086  case SfxStyleFamily::Frame:
1087  aTemplate.aColl.pFrameFormat = pStyle->GetFrameFormat();
1088  break;
1089  case SfxStyleFamily::Page:
1090  aTemplate.aColl.pPageDesc = const_cast<SwPageDesc*>(pStyle->GetPageDesc());
1091  break;
1092  case SfxStyleFamily::Pseudo:
1093  aTemplate.aColl.pNumRule = const_cast<SwNumRule*>(pStyle->GetNumRule());
1094  break;
1095 
1096  default:
1097  OSL_FAIL("Unknown family");
1098  }
1099  }
1100  else
1101  aTemplate.eType = SfxStyleFamily(0);
1102 
1103  m_pView->GetEditWin().SetApplyTemplate(aTemplate);
1104 
1105  return nFamily;
1106 }
1107 
1108 // update template
1109 void SwDocShell::UpdateStyle(const OUString &rName, SfxStyleFamily nFamily, SwWrtShell* pShell)
1110 {
1111  SwWrtShell* pCurrWrtShell = pShell ? pShell : GetWrtShell();
1112  assert( pCurrWrtShell );
1113 
1114  SwDocStyleSheet* pStyle =
1115  static_cast<SwDocStyleSheet*>( m_xBasePool->Find(rName, nFamily) );
1116 
1117  if (!pStyle)
1118  return;
1119 
1120  switch(nFamily)
1121  {
1122  case SfxStyleFamily::Para:
1123  {
1124  SwTextFormatColl* pColl = pStyle->GetCollection();
1125  if(pColl && !pColl->IsDefault())
1126  {
1128 
1129  SwRewriter aRewriter;
1130  aRewriter.AddRule(UndoArg1, pColl->GetName());
1131 
1132  GetWrtShell()->StartUndo(SwUndoId::INSFMTATTR, &aRewriter);
1133  GetWrtShell()->FillByEx(pColl);
1134  // also apply template to remove hard set attributes
1135  GetWrtShell()->SetTextFormatColl( pColl );
1136  GetWrtShell()->EndUndo();
1138  }
1139  break;
1140  }
1141  case SfxStyleFamily::Frame:
1142  {
1143  SwFrameFormat* pFrame = pStyle->GetFrameFormat();
1144  if( pCurrWrtShell->IsFrameSelected() && pFrame && !pFrame->IsDefault() )
1145  {
1147  pCurrWrtShell->StartAllAction();
1148  pCurrWrtShell->GetFlyFrameAttr( aSet );
1149 
1150  // #i105535#
1151  // no update of anchor attribute
1152  aSet.ClearItem( RES_ANCHOR );
1153 
1154  pFrame->SetFormatAttr( aSet );
1155 
1156  // also apply template to remove hard set attributes
1157  pCurrWrtShell->SetFrameFormat( pFrame, true );
1158  pCurrWrtShell->EndAllAction();
1159  }
1160  }
1161  break;
1162  case SfxStyleFamily::Char:
1163  {
1164  SwCharFormat* pChar = pStyle->GetCharFormat();
1165  if( pChar && !pChar->IsDefault() )
1166  {
1167  pCurrWrtShell->StartAllAction();
1168  pCurrWrtShell->FillByEx(pChar);
1169  // also apply template to remove hard set attributes
1170  pCurrWrtShell->EndAllAction();
1171  }
1172 
1173  }
1174  break;
1175  case SfxStyleFamily::Pseudo:
1176  {
1177  const SwNumRule* pCurRule;
1178  if( pStyle->GetNumRule() &&
1179  nullptr != ( pCurRule = pCurrWrtShell->GetNumRuleAtCurrCursorPos() ))
1180  {
1181  SwNumRule aRule( *pCurRule );
1182  // #i91400#
1183  aRule.SetName( pStyle->GetNumRule()->GetName(),
1184  pCurrWrtShell->GetDoc()->getIDocumentListsAccess() );
1185  pCurrWrtShell->ChgNumRuleFormats( aRule );
1186  }
1187  }
1188  break;
1189  case SfxStyleFamily::Table:
1190  {
1191 
1192  SwTableAutoFormat aFormat(rName);
1193  if (pCurrWrtShell->GetTableAutoFormat(aFormat))
1194  {
1195  pCurrWrtShell->StartAllAction();
1196  pCurrWrtShell->GetDoc()->ChgTableStyle(rName, aFormat);
1197  pCurrWrtShell->EndAllAction();
1198  }
1199 
1200  }
1201  break;
1202  default: break;
1203  }
1204 }
1205 
1206 // NewByExample
1207 void SwDocShell::MakeByExample( const OUString &rName, SfxStyleFamily nFamily,
1208  SfxStyleSearchBits nMask, SwWrtShell* pShell )
1209 {
1210  SwWrtShell* pCurrWrtShell = pShell ? pShell : GetWrtShell();
1211  SwDocStyleSheet* pStyle = static_cast<SwDocStyleSheet*>( m_xBasePool->Find(
1212  rName, nFamily ) );
1213  if(!pStyle)
1214  {
1215  // preserve the current mask of PI, then the new one is
1216  // immediately merged with the viewable area
1217  if( SfxStyleSearchBits::All == nMask || SfxStyleSearchBits::Used == nMask )
1218  nMask = SfxStyleSearchBits::UserDefined;
1219  else
1220  nMask |= SfxStyleSearchBits::UserDefined;
1221 
1222  if (nFamily == SfxStyleFamily::Para || nFamily == SfxStyleFamily::Char || nFamily == SfxStyleFamily::Frame)
1223  {
1224  // Prevent undo append from being done during paragraph, character, and frame style Make. Do it later
1225  ::sw::UndoGuard const undoGuard(GetDoc()->GetIDocumentUndoRedo());
1226  pStyle = static_cast<SwDocStyleSheet*>(&m_xBasePool->Make(rName, nFamily, nMask));
1227  }
1228  else
1229  {
1230  pStyle = static_cast<SwDocStyleSheet*>(&m_xBasePool->Make(rName, nFamily, nMask));
1231  }
1232  }
1233 
1234  switch(nFamily)
1235  {
1236  case SfxStyleFamily::Para:
1237  {
1238  SwTextFormatColl* pColl = pStyle->GetCollection();
1239  if(pColl && !pColl->IsDefault())
1240  {
1241  pCurrWrtShell->StartAllAction();
1242  pCurrWrtShell->FillByEx(pColl);
1243  // also apply template to remove hard set attributes
1244  SwTextFormatColl * pDerivedFrom = pCurrWrtShell->GetCurTextFormatColl();
1245  pColl->SetDerivedFrom(pDerivedFrom);
1246 
1247  // set the mask at the Collection:
1248  sal_uInt16 nId = pColl->GetPoolFormatId() & 0x87ff;
1249  switch( nMask & static_cast<SfxStyleSearchBits>(0x0fff) )
1250  {
1251  case SfxStyleSearchBits::SwText:
1252  nId |= COLL_TEXT_BITS;
1253  break;
1254  case SfxStyleSearchBits::SwChapter:
1255  nId |= COLL_DOC_BITS;
1256  break;
1257  case SfxStyleSearchBits::SwList:
1258  nId |= COLL_LISTS_BITS;
1259  break;
1260  case SfxStyleSearchBits::SwIndex:
1261  nId |= COLL_REGISTER_BITS;
1262  break;
1263  case SfxStyleSearchBits::SwExtra:
1264  nId |= COLL_EXTRA_BITS;
1265  break;
1266  case SfxStyleSearchBits::SwHtml:
1267  nId |= COLL_HTML_BITS;
1268  break;
1269  default: break;
1270  }
1271  pColl->SetPoolFormatId(nId);
1272 
1273  if (GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1274  {
1276  std::make_unique<SwUndoTextFormatCollCreate>(pColl, pDerivedFrom, GetDoc()));
1277  }
1278  pCurrWrtShell->SetTextFormatColl(pColl);
1279  pCurrWrtShell->EndAllAction();
1280  }
1281  }
1282  break;
1283  case SfxStyleFamily::Frame:
1284  {
1285  SwFrameFormat* pFrame = pStyle->GetFrameFormat();
1286  if(pCurrWrtShell->IsFrameSelected() && pFrame && !pFrame->IsDefault())
1287  {
1288  pCurrWrtShell->StartAllAction();
1289 
1291  pCurrWrtShell->GetFlyFrameAttr( aSet );
1292  aSet.ClearItem(RES_ANCHOR); // tdf#112574 no anchor in styles
1293 
1294  SwFrameFormat* pFFormat = pCurrWrtShell->GetSelectedFrameFormat();
1295  pFrame->SetDerivedFrom( pFFormat );
1296  pFrame->SetFormatAttr( aSet );
1297  if (GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1298  {
1300  std::make_unique<SwUndoFrameFormatCreate>(pFrame, pFFormat, GetDoc()));
1301  }
1302  // also apply template to remove hard set attributes
1303  pCurrWrtShell->SetFrameFormat(pFrame);
1304  pCurrWrtShell->EndAllAction();
1305  }
1306  }
1307  break;
1308  case SfxStyleFamily::Char:
1309  {
1310  SwCharFormat* pChar = pStyle->GetCharFormat();
1311  if(pChar && !pChar->IsDefault())
1312  {
1313  pCurrWrtShell->StartAllAction();
1314  pCurrWrtShell->FillByEx( pChar );
1315  SwCharFormat * pDerivedFrom = pCurrWrtShell->GetCurCharFormat();
1316  pChar->SetDerivedFrom( pDerivedFrom );
1317  SwFormatCharFormat aFormat( pChar );
1318 
1319  if (GetDoc()->GetIDocumentUndoRedo().DoesUndo())
1320  {
1321  // Looks like sometimes pDerivedFrom can be null and this is not supported by redo code
1322  // So use default format as a derived from in such situations
1324  std::make_unique<SwUndoCharFormatCreate>(
1325  pChar, pDerivedFrom ? pDerivedFrom : GetDoc()->GetDfltCharFormat(),
1326  GetDoc()));
1327  }
1328  pCurrWrtShell->SetAttrItem(aFormat);
1329  pCurrWrtShell->EndAllAction();
1330  }
1331  }
1332  break;
1333 
1334  case SfxStyleFamily::Page:
1335  {
1336  pCurrWrtShell->StartAllAction();
1337  size_t nPgDsc = pCurrWrtShell->GetCurPageDesc();
1338  SwPageDesc& rSrc = const_cast<SwPageDesc&>(pCurrWrtShell->GetPageDesc( nPgDsc ));
1339  SwPageDesc& rDest = *const_cast<SwPageDesc*>(pStyle->GetPageDesc());
1340 
1341  sal_uInt16 nPoolId = rDest.GetPoolFormatId();
1342  sal_uInt16 nHId = rDest.GetPoolHelpId();
1343  sal_uInt8 nHFId = rDest.GetPoolHlpFileId();
1344 
1345  pCurrWrtShell->GetDoc()->CopyPageDesc( rSrc, rDest );
1346 
1347  // PoolId must NEVER be copied!
1348  rDest.SetPoolFormatId( nPoolId );
1349  rDest.SetPoolHelpId( nHId );
1350  rDest.SetPoolHlpFileId( nHFId );
1351 
1352  // when Headers/Footers are created, there is no Undo anymore!
1353  pCurrWrtShell->GetDoc()->GetIDocumentUndoRedo().DelAllUndoObj();
1354 
1355  pCurrWrtShell->EndAllAction();
1356  }
1357  break;
1358 
1359  case SfxStyleFamily::Pseudo:
1360  {
1361  const SwNumRule* pCurRule = pCurrWrtShell->GetNumRuleAtCurrCursorPos();
1362 
1363  if (pCurRule)
1364  {
1365  pCurrWrtShell->StartAllAction();
1366 
1367  SwNumRule aRule( *pCurRule );
1368  OUString sOrigRule( aRule.GetName() );
1369  // #i91400#
1370  aRule.SetName( pStyle->GetNumRule()->GetName(),
1371  pCurrWrtShell->GetDoc()->getIDocumentListsAccess() );
1372  pCurrWrtShell->ChgNumRuleFormats( aRule );
1373 
1374  pCurrWrtShell->ReplaceNumRule( sOrigRule, aRule.GetName() );
1375 
1376  pCurrWrtShell->EndAllAction();
1377  }
1378  }
1379  break;
1380 
1381  case SfxStyleFamily::Table:
1382  {
1383  SwTableAutoFormat* pFormat = pStyle->GetTableFormat();
1384  if (pCurrWrtShell->GetTableAutoFormat(*pFormat))
1385  {
1386  pCurrWrtShell->StartAllAction();
1387 
1388  pCurrWrtShell->SetTableStyle(rName);
1389 
1390  pCurrWrtShell->EndAllAction();
1391  }
1392  }
1393  break;
1394 
1395  default: break;
1396  }
1397 }
1398 
1399 std::set<Color> SwDocShell::GetDocColors()
1400 {
1401  return m_xDoc->GetDocColors();
1402 }
1403 
1405 {
1406  LoadStyles_(rSource, false);
1407 }
1408 
1409 // bPreserveCurrentDocument determines whether SetFixFields() is called
1410 // This call modifies the source document. This mustn't happen when the source
1411 // is a document the user is working on.
1412 // Calls of ::LoadStyles() normally use files especially loaded for the purpose
1413 // of importing styles.
1414 void SwDocShell::LoadStyles_( SfxObjectShell& rSource, bool bPreserveCurrentDocument )
1415 {
1416 /* [Description]
1417 
1418  This method is called by SFx if Styles have to be reloaded from a
1419  document-template. Existing Styles should be overwritten by that.
1420  That's why the document has to be reformatted. Therefore applications
1421  will usually override this method and call the baseclass' implementation
1422  in their implementation.
1423 */
1424  // When the source is our document, we do the checking ourselves
1425  // (much quicker and doesn't use the crutch StxStylePool).
1426  if( dynamic_cast<const SwDocShell*>( &rSource) != nullptr)
1427  {
1428  // in order for the Headers/Footers not to get the fixed content
1429  // of the template, update all the Source's
1430  // FixFields once.
1431  if(!bPreserveCurrentDocument)
1432  static_cast<SwDocShell&>(rSource).m_xDoc->getIDocumentFieldsAccess().SetFixFields(nullptr);
1433  if (m_pWrtShell)
1434  {
1435  // rhbz#818557, fdo#58893: EndAllAction will call SelectShell(),
1436  // which pushes a bunch of SfxShells that are not cleared
1437  // (for unknown reasons) when closing the document, causing crash;
1438  // setting g_bNoInterrupt appears to avoid the problem.
1441  m_xDoc->ReplaceStyles( *static_cast<SwDocShell&>(rSource).m_xDoc );
1443  }
1444  else
1445  {
1446  bool bModified = m_xDoc->getIDocumentState().IsModified();
1447  m_xDoc->ReplaceStyles( *static_cast<SwDocShell&>(rSource).m_xDoc );
1448  if (!bModified && m_xDoc->getIDocumentState().IsModified() && !m_pView)
1449  {
1450  // the View is created later, but overwrites the Modify-Flag.
1451  // Undo doesn't work anymore anyways.
1452  m_xDoc->GetIDocumentUndoRedo().SetUndoNoResetModified();
1453  }
1454  }
1455  }
1456  else
1457  SfxObjectShell::LoadStyles( rSource );
1458 }
1459 
1461  const OUString& rPage,
1462  const OString& rPageId,
1463  SwWrtShell& rActShell,
1464  SfxRequest* pRequest)
1465 {
1466  Edit(rPage, OUString(), SfxStyleFamily::Page, SfxStyleSearchBits::Auto, false, rPageId, &rActShell, pRequest);
1467 }
1468 
1469 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxViewFrame * GetViewFrame() const
const sal_Char * pChar
bool IsPrintLayoutExtension() const
FieldUnit
SwTextFormatColl * GetCurTextFormatColl() const
Get the named paragraph format of the current selection.
Definition: edattr.cxx:250
const sal_uInt16 COLL_LISTS_BITS
Definition: poolfmt.hxx:67
const sal_uInt16 COLL_DOC_BITS
Definition: poolfmt.hxx:70
static OUString GenerateUnusedName(SfxStyleSheetBasePool &rPool)
IMPL_LINK_NOARG(ApplyStyle, ApplyHdl, LinkParamNone *, void)
Definition: docst.cxx:578
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
Definition: edfmt.cxx:125
void SwToSfxPageDescAttr(SfxItemSet &rSet)
Definition: uitool.cxx:671
bool IsDefault() const
Definition: format.hxx:109
SwTableAutoFormat * GetTableFormat()
Definition: docstyle.cxx:2186
SfxStyleFamily eType
Definition: view.hxx:118
SW_DLLPUBLIC void ConvertAttrCharToGen(SfxItemSet &rSet)
Convert character specific attributes to general ones used by tab pages.
Definition: uitool.cxx:128
SwUndoId
Definition: swundo.hxx:29
void SetPoolHelpId(sal_uInt16 const nId)
Definition: pagedesc.hxx:256
std::string GetValue
const SwNumRule * GetNumRuleAtCurrCursorPos() const
Definition: ednumber.cxx:727
SwCharFormat * GetCharFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:358
SfxDispatcher * GetDispatcher()
virtual void SetModified()=0
Must be called manually at changes of format.
bool GetLastUndoInfo(OUString *const o_pStr, SwUndoId *const o_pId, const SwView *pView=nullptr) const
Definition: edws.cxx:236
#define KEY_SHIFT
const OUString & GetDefaultListId() const
Definition: numrule.hxx:192
const sal_uInt16 COLL_HTML_BITS
Definition: poolfmt.hxx:71
Definition: doc.hxx:185
SAL_DLLPRIVATE void UpdateStyle(const OUString &rName, SfxStyleFamily nFamily, SwWrtShell *pShell)
Definition: docst.cxx:1109
sal_uInt16 GetValue() const
void InvalidateItem(sal_uInt16 nWhich)
sal_Int16 nId
sal_uInt16 FirstWhich()
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:233
rtl::Reference< SfxStyleSheetBasePool > m_xBasePool
Definition: docst.cxx:574
const OUString & GetName() const
Definition: numrule.hxx:222
SwEditWin & GetEditWin()
Definition: view.hxx:403
void Done(bool bRemove=false)
void SetPageStyle(const OUString &rCollName)
Definition: wrtsh1.cxx:1550
IDocumentUndoRedo & GetIDocumentUndoRedo()
Definition: doc.cxx:176
css::uno::Reference< css::frame::XModel > GetModel() const
const SfxItemSet * GetArgs() const
void Invalidate(sal_uInt16 nId)
void SfxToSwPageDescAttr(const SwWrtShell &rShell, SfxItemSet &rSet)
Definition: uitool.cxx:611
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the and register/unregister the paragragh style at t...
Definition: fmtcol.cxx:330
SwFrameFormat * GetFrameFormatFromPool(sal_uInt16 nId)
Definition: editsh.hxx:356
void PutItem(const SfxPoolItem &rItem)
void SetValue(SfxStyleSearchBits n)
void EndAllAction()
Definition: edws.cxx:96
void SetApplyTemplate(const SwApplyTemplate &)
Apply template.
Definition: edtwin.cxx:4936
SwPageDesc * pPageDesc
Definition: view.hxx:112
sal_uInt16 NextWhich()
XPatternListRef GetPatternList() const
const OUString & GetName() const
Definition: pagedesc.hxx:186
IDocumentDrawModelAccess const & getIDocumentDrawModelAccess() const
Definition: doc.cxx:187
void SetCurNumRule(const SwNumRule &, const bool bCreateNewList, const OUString &sContinuedListId=OUString(), const bool bResetIndentAttrs=false)
Optional parameter (default value false).
Definition: ednumber.cxx:771
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
void SetWatermark(const SfxWatermarkItem &rText)
Definition: edfcol.cxx:1608
SfxWatermarkItem GetWatermark()
Definition: edfcol.cxx:1383
void FillByEx(SwCharFormat *)
Definition: edfmt.cxx:55
bool IsAssignedToListLevelOfOutlineStyle() const
Definition: fmtcol.hxx:109
const SwView & GetView() const
Definition: wrtsh.hxx:426
const OUString & GetName() const
ApplyStyle(SwDocShell &rDocSh, bool bNew, rtl::Reference< SwDocStyleSheet > const &xTmp, SfxStyleFamily nFamily, SfxAbstractApplyTabDialog *pDlg, rtl::Reference< SfxStyleSheetBasePool > const &xBasePool, bool bModified)
Definition: docst.cxx:549
void SetPoolFormatId(sal_uInt16 nId)
Definition: format.hxx:144
sal_uInt16 GetPoolFormatId() const
Query and set PoolFormat-Id.
Definition: pagedesc.hxx:253
void ExecStyleSheet(SfxRequest &)
Definition: docst.cxx:298
SAL_DLLPRIVATE void Edit(const OUString &rName, const OUString &rParent, const SfxStyleFamily nFamily, SfxStyleSearchBits nMask, const bool bNew, const OString &sPageId, SwWrtShell *pActShell, SfxRequest *pRequest=nullptr, sal_uInt16 nSlot=0)
Methods for StyleSheets.
Definition: docst.cxx:649
bool SetTableStyle(const OUString &rStyleName)
Set table style of the current table.
Definition: fetab.cxx:1180
const OUString & GetName() const
Definition: format.hxx:111
virtual void DelAllUndoObj()=0
Delete all Undo actions.
void InitPrt(OutputDevice *pOutDev)
Definition: vprint.cxx:196
SwFrameFormat * GetFrameFormat()
Definition: docstyle.cxx:2225
static SW_DLLPUBLIC sal_uInt16 GetPoolIdFromUIName(const OUString &rName, SwGetPoolIdFromName)
OUString GetName() const
const SwTable & GetTable() const
Definition: node.hxx:497
void SetPoolHlpFileId(sal_uInt8 const nId)
Definition: pagedesc.hxx:258
SwDoc * GetDoc() const
Definition: viewsh.hxx:284
const SwPageDesc * GetPageDesc()
Definition: docstyle.cxx:2165
const OUString & GetTableStyleName() const
Return the table style name of this table.
Definition: swtable.hxx:188
SfxStyleFamily
const SwTOXBase * GetCurTOX() const
Get current listing before or at the Cursor.
Definition: edtox.cxx:195
virtual void LoadStyles(SfxObjectShell &rSource) override
Definition: docst.cxx:1404
const sal_uInt16 COLL_REGISTER_BITS
Definition: poolfmt.hxx:69
SwCharFormat * GetCharFormat()
Definition: docstyle.cxx:2151
virtual bool DoesUndo() const =0
Is Undo enabled?
bool SetDerivedFrom(SwFormat *pDerivedFrom=nullptr)
0 is Default.
Definition: format.cxx:326
void PresetParent(const OUString &rName)
Definition: docstyle.hxx:119
sal_uInt16 GetPoolFormatId() const
Get and set Pool style IDs.
Definition: format.hxx:143
SfxItemPool & GetPool() const
bool const m_bModified
Definition: docst.cxx:575
SwFrameFormat * FindFrameFormatByName(const OUString &rName) const
Definition: doc.hxx:760
static SvxHtmlOptions & Get()
void ChgNumRuleFormats(const SwNumRule &rRule)
Definition: ednumber.cxx:821
bool GetFlyFrameAttr(SfxItemSet &rSet) const
Definition: fefly1.cxx:1023
SwDocShell & m_rDocSh
Definition: docst.cxx:570
SwDoc * GetDoc()
returns Doc. But be careful!
Definition: docsh.hxx:203
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2589
virtual void AppendUndo(std::unique_ptr< SwUndo > pUndo)=0
Add new Undo action.
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:888
sal_uInt16 ClearItem(sal_uInt16 nWhich=0)
void SetTextFormatColl(SwTextFormatColl *, const bool bResetListAttrs=false)
Add 2nd optional parameter - see also
Definition: edfcol.cxx:2188
Style of a layout element.
Definition: frmfmt.hxx:57
DECL_LINK(ApplyHdl, LinkParamNone *, void)
SwApplyTemplate * GetApplyTemplate() const
Definition: edtwin.hxx:230
#define SW_MOD()
Definition: swmodule.hxx:256
SwCharFormat * FindCharFormatByName(const OUString &rName) const
Definition: edfmt.cxx:151
#define RES_ANCHOR
Definition: hintids.hxx:209
#define FN_INSERT_CTRL
Definition: cmdid.h:245
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
SW_DLLPUBLIC FieldUnit GetDfltMetric(bool bWeb)
Definition: uitool.cxx:710
SwTextFormatColl * pTextColl
Definition: view.hxx:111
SwNumRule * pNumRule
Definition: view.hxx:115
virtual void SetUndoNoResetModified()=0
Disable (re)setting the document modified flag on Undo/Redo.
sal_uInt16 GetModifier() const
Window class for the Writer edit area, this is the one handling mouse and keyboard events and doing t...
Definition: edtwin.hxx:58
void LoadStyles_(SfxObjectShell &rSource, bool bPreserveCurrentDocument)
Definition: docst.cxx:1414
virtual std::set< Color > GetDocColors() override
Definition: docst.cxx:1399
OUString sName
SfxBindings & GetBindings()
#define FN_PARAM_WRTSHELL
Definition: cmdid.h:771
bool const m_bNew
Definition: docst.cxx:571
void SetAttrItem(const SfxPoolItem &, SetAttrMode nFlags=SetAttrMode::DEFAULT, const bool bParagraphSetting=false)
Definition: edatmisc.cxx:113
const OUString & GetValue() const
sal_uInt16 Count() const
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:127
HTMLMODE_ON
FrameTypeFlags
values can be combined via logical or
Definition: fesh.hxx:62
sal_uInt16 GetHtmlMode(const SwDocShell *pShell)
Definition: viewopt.cxx:340
const T * GetArg(sal_uInt16 nSlotId) const
void ChgTableStyle(const OUString &rName, const SwTableAutoFormat &rNewFormat)
Definition: ndtbl.cxx:4587
virtual const SwDrawModel * GetDrawModel() const =0
Draw Model and id accessors.
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:222
virtual SfxStyleSheetBasePool * GetStyleSheetPool() override
For Style PI.
Definition: docsh.cxx:1159
XGradientListRef GetGradientList() const
void AddRule(SwUndoArg eWhat, const OUString &rWith)
Definition: SwRewriter.cxx:29
weld::Window * GetFrameWeld(SfxFrame *pFrame)
Definition: dialoghelp.cxx:20
IDocumentState const & getIDocumentState() const
Definition: doc.cxx:426
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:224
SwFrameFormat * pFrameFormat
Definition: view.hxx:113
const SwNumRule * GetNumRule()
Definition: docstyle.cxx:2172
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
SfxItemState QueryState(sal_uInt16 nSID, std::unique_ptr< SfxPoolItem > &rpState)
rtl::Reference< SwDoc > m_xDoc
Document.
Definition: docsh.hxx:71
void SetPoolFormatId(sal_uInt16 const nId)
Definition: pagedesc.hxx:254
#define XATTR_FILLSTYLE
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
rtl::Reference< SwDocStyleSheet > m_xTmp
Definition: docst.cxx:572
virtual void LoadStyles(SfxObjectShell &rSource)
SwFrameFormat * GetSelectedFrameFormat() const
If frame then frame style, else 0.
Definition: fefly1.cxx:1178
rtl::Reference< SfxStyleSheetBasePool > m_xBasePool
Passing through for formats.
Definition: docsh.hxx:72
sal_uInt16 const aFrameFormatSetRange[]
Definition: init.cxx:234
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:458
void SetReturnValue(const SfxPoolItem &)
SwCharFormat * pCharFormat
Definition: view.hxx:114
SAL_DLLPRIVATE void MakeByExample(const OUString &rName, SfxStyleFamily nFamily, SfxStyleSearchBits nMask, SwWrtShell *pShell)
Definition: docst.cxx:1207
SAL_DLLPRIVATE void Hide(const OUString &rName, SfxStyleFamily nFamily, bool bHidden)
Definition: docst.cxx:972
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
sal_uInt16 GetSlot() const
void CopyPageDesc(const SwPageDesc &rSrcDesc, SwPageDesc &rDstDesc, bool bCopyPoolIds=true)
Copy the complete PageDesc - beyond document and "deep"! Optionally copying of PoolFormatId, -HlpId can be prevented.
Definition: docfmt.cxx:1427
XHatchListRef GetHatchList() const
SwTextFormatColl * GetCollection()
Definition: docstyle.cxx:2158
void DisableItem(sal_uInt16 nWhich)
SwView * m_pView
For "historical reasons" nothing can be done without the WrtShell.
Definition: docsh.hxx:83
void ReplaceNumRule(const OUString &rOldRule, const OUString &rNewRule)
Definition: ednumber.cxx:828
#define SAL_WARN_IF(condition, area, stream)
unsigned char sal_uInt8
union SwApplyTemplate::@33 aColl
const o3tl::enumarray< SvxAdjust, unsigned short > aSvxToUnoAdjust USHRT_MAX
Definition: unosett.cxx:261
SwTextFormatColl * FindTextFormatCollByName(const OUString &rName) const
Definition: edfmt.cxx:156
RET_OK
SwWrtShell * m_pWrtShell
Definition: docsh.hxx:84
sal_uInt16 GetPoolHelpId() const
Definition: pagedesc.hxx:255
void SetAttrOutlineLevel(int)
Definition: fmtcol.cxx:576
void InvalidateRulerPos()
Definition: viewport.cxx:118
void SetFrameFormat(SwFrameFormat *pFormat, bool bKeepOrient=false, Point const *pDocPos=nullptr)
If frame then set frame style.
Definition: fefly1.cxx:1188
XBitmapListRef GetBitmapList() const
OString const aName
sal_uInt8 GetPoolHlpFileId() const
Definition: pagedesc.hxx:257
reference_type * get() const
SAL_DLLPRIVATE SfxStyleFamily ApplyStyles(const OUString &rName, const SfxStyleFamily nFamily, SwWrtShell *pShell, sal_uInt16 nMode)
Definition: docst.cxx:988
SwCharFormat * GetCurCharFormat() const
Definition: edfmt.cxx:42
bool g_bNoInterrupt
Definition: swmodule.cxx:138
void AppendItem(const SfxPoolItem &)
Reference< XModel > xModel
SAL_DLLPRIVATE SfxStyleFamily DoWaterCan(const OUString &rName, SfxStyleFamily nFamily)
Definition: docst.cxx:1055
bool IsAPI() const
const SwView * GetView() const
Definition: docsh.hxx:220
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
#define FN_INSERT_OBJ_CTRL
Definition: cmdid.h:246
const sal_uInt16 COLL_TEXT_BITS
Definition: poolfmt.hxx:66
XColorListRef GetColorList() const
void FormatPage(const OUString &rPage, const OString &rPageId, SwWrtShell &rActShell, SfxRequest *pRequest=nullptr)
Show page style format dialog.
Definition: docst.cxx:1460
void SetName(const OUString &rNm, IDocumentListsAccess &rDocListAccess)
Definition: number.cxx:107
void apply()
Definition: docst.cxx:564
void StartAllAction()
For all views of this document.
Definition: edws.cxx:85
SAL_DLLPRIVATE void Delete(const OUString &rName, SfxStyleFamily nFamily)
Definition: docst.cxx:958
IDocumentListsAccess const & getIDocumentListsAccess() const
Definition: doc.cxx:325
void Ignore()
size_t GetCurPageDesc(const bool bCalcFrame=true) const
Definition: fedesc.cxx:168
static const std::vector< OUString > & GetTextUINameArray()
void StateStyleSheet(SfxItemSet &, SwWrtShell *pSh=nullptr)
Definition: docst.cxx:95
SW_DLLPUBLIC void ConvertAttrGenToChar(SfxItemSet &rSet, const SfxItemSet &rOrigSet)
Convert general attributes to the corresponding character attributes.
Definition: uitool.cxx:162
void Undo(sal_uInt16 const nCount=1)
Definition: edundo.cxx:101
FrameTypeFlags GetFrameType(const Point *pPt, bool bStopAtFly) const
For return values see above FrameType.
Definition: fews.cxx:238
bool IsFrameSelected() const
Definition: feshview.cxx:1175
SfxStyleSearchBits
Definition: view.hxx:146
const sal_uInt16 COLL_EXTRA_BITS
Definition: poolfmt.hxx:68
VclPtr< SfxAbstractApplyTabDialog > m_pDlg
Definition: docst.cxx:568
SfxStyleFamily const m_nFamily
Definition: docst.cxx:573
static void DoUpdateAllCharts(SwDoc *pDoc)
Definition: unochart.cxx:54
bool GetTableAutoFormat(SwTableAutoFormat &rGet)
Definition: fetab.cxx:1256
virtual VclPtr< SfxAbstractApplyTabDialog > CreateTemplateDialog(weld::Window *pParent, SfxStyleSheetBase &rBase, SfxStyleFamily nRegion, const OString &sPage, SwWrtShell *pActShell, bool bNew)=0