LibreOffice Module sw (master)  1
appenv.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 <cstdarg>
21 
22 #include <hintids.hxx>
23 
24 #include <comphelper/string.hxx>
25 #include <sfx2/request.hxx>
26 #include <svx/svxids.hrc>
27 
28 #include <vcl/svapp.hxx>
29 #include <vcl/wrkwin.hxx>
30 #include <sfx2/app.hxx>
31 #include <sfx2/docfac.hxx>
32 #include <sfx2/printer.hxx>
33 #include <sfx2/dispatch.hxx>
34 #include <sfx2/viewfrm.hxx>
35 #include <editeng/boxitem.hxx>
36 #include <editeng/lrspitem.hxx>
37 #include <editeng/ulspitem.hxx>
38 #include <editeng/pbinitem.hxx>
39 #include <editeng/paperinf.hxx>
41 #include <fmthdft.hxx>
42 #include <swwait.hxx>
43 #include <paratr.hxx>
44 #include <swmodule.hxx>
45 #include <wrtsh.hxx>
46 #include <view.hxx>
47 #include <docsh.hxx>
48 #include <frmatr.hxx>
49 #include <fldbas.hxx>
50 #include <swundo.hxx>
52 #include <dbmgr.hxx>
53 #include <fmtcol.hxx>
54 #include <frmmgr.hxx>
55 #include <fldmgr.hxx>
56 #include <pagedesc.hxx>
57 #include <poolfmt.hxx>
58 #include <expfld.hxx>
59 #include <SwStyleNameMapper.hxx>
60 #include <fmtpdsc.hxx>
61 
62 #include <cmdid.h>
63 #include <globals.hrc>
64 #include <app.hrc>
65 #include <strings.hrc>
66 #include <swabstdlg.hxx>
67 #include <envimg.hxx>
68 #include "appenv.hxx"
69 
70 #include <memory>
71 
72 #define ENV_NEWDOC RET_OK
73 #define ENV_INSERT RET_USER
74 
75 // Function used for labels and envelopes in applab.cxx and appenv.cxx
76 OUString InsertLabEnvText( SwWrtShell& rSh, SwFieldMgr& rFieldMgr, const OUString& rText )
77 {
78  OUString sRet;
79  OUString aText = rText.replaceAll("\r", "");
80 
81  sal_Int32 nTokenPos = 0;
82  while( -1 != nTokenPos )
83  {
84  OUString aLine = aText.getToken( 0, '\n', nTokenPos );
85  while ( !aLine.isEmpty() )
86  {
87  OUString sTmpText;
88  bool bField = false;
89 
90  sal_Int32 nPos = aLine.indexOf( '<' );
91  if (0 != nPos)
92  {
93  sal_Int32 const nCopy((nPos != -1) ? nPos : aLine.getLength());
94  sTmpText = aLine.copy(0, nCopy);
95  aLine = aLine.copy(nCopy);
96  }
97  else
98  {
99  nPos = aLine.indexOf( '>' );
100  if ( nPos == -1 )
101  {
102  sTmpText = aLine;
103  aLine.clear();
104  }
105  else
106  {
107  sTmpText = aLine.copy( 0, nPos + 1);
108  aLine = aLine.copy( nPos + 1);
109 
110  // Database fields must contain at least 3 points!
111  OUString sDBName( sTmpText.copy( 1, sTmpText.getLength() - 2));
112  if (comphelper::string::getTokenCount(sDBName, '.') >= 3)
113  {
114  sDBName = ::ReplacePoint(sDBName, true);
115  SwInsertField_Data aData(TYP_DBFLD, 0, sDBName, OUString(), 0, &rSh);
116  rFieldMgr.InsertField( aData );
117  sRet = sDBName;
118  bField = true;
119  }
120  }
121  }
122  if ( !bField )
123  rSh.Insert( sTmpText );
124  }
125  rSh.SplitNode();
126  }
127  rSh.DelLeft(); // Again remove last linebreak
128 
129  return sRet;
130 }
131 
132 static void lcl_CopyCollAttr(SwWrtShell const * pOldSh, SwWrtShell* pNewSh, sal_uInt16 nCollId)
133 {
134  sal_uInt16 nCollCnt = pOldSh->GetTextFormatCollCount();
135  for( sal_uInt16 nCnt = 0; nCnt < nCollCnt; ++nCnt )
136  {
137  SwTextFormatColl* pColl = &pOldSh->GetTextFormatColl(nCnt);
138  if(nCollId == pColl->GetPoolFormatId())
139  pNewSh->GetTextCollFromPool(nCollId)->SetFormatAttr(pColl->GetAttrSet());
140  }
141 }
142 
144 {
145  static sal_uInt16 nTitleNo = 0;
146 
147  SwDocShell *pMyDocSh;
148  SfxViewFrame *pFrame;
149  SwView *pNewView;
150  SwWrtShell *pOldSh,
151  *pSh;
152 
153  // Get current shell
154  pMyDocSh = static_cast<SwDocShell*>( SfxObjectShell::Current());
155  pOldSh = pMyDocSh ? pMyDocSh->GetWrtShell() : nullptr;
156 
157  // Create new document (don't show!)
158  SfxObjectShellLock xDocSh( new SwDocShell( SfxObjectCreateMode::STANDARD ) );
159  xDocSh->DoInitNew();
161  pNewView = static_cast<SwView*>( pFrame->GetViewShell());
162  pNewView->AttrChangedNotify( &pNewView->GetWrtShell() ); // so that SelectShell is being called
163  pSh = pNewView->GetWrtShellPtr();
164 
165  OUString aTmp( SwResId(STR_ENV_TITLE) );
166  aTmp += OUString::number( ++nTitleNo );
167  xDocSh->SetTitle( aTmp );
168 
169  // if applicable, copy the old Collections "Sender" and "Receiver" to
170  // a new document
171  if ( pOldSh )
172  {
175  }
176 
177  // Read SwEnvItem from config
178  SwEnvCfgItem aEnvCfg;
179 
180  // Check if there's already an envelope.
181  bool bEnvChange = false;
182 
184  aSet.Put(aEnvCfg.GetItem());
185 
186  SfxPrinter* pTempPrinter = pSh->getIDocumentDeviceAccess().getPrinter( true );
187  if(pOldSh )
188  {
189  const SwPageDesc& rCurPageDesc = pOldSh->GetPageDesc(pOldSh->GetCurPageDesc());
190  OUString sJacket;
192  bEnvChange = rCurPageDesc.GetName() == sJacket;
193 
194  IDocumentDeviceAccess& rIDDA_old = pOldSh->getIDocumentDeviceAccess();
195  if( rIDDA_old.getPrinter( false ) )
196  {
198  rIDDA.setJobsetup( *rIDDA_old.getJobsetup() );
199  //#69563# if it isn't the same printer then the pointer has been invalidated!
200  pTempPrinter = rIDDA.getPrinter( true );
201  }
202  pTempPrinter->SetPaperBin(rCurPageDesc.GetMaster().GetPaperBin().GetValue());
203 
204  }
205 
206  vcl::Window *pParent = pOldSh ? pOldSh->GetWin() : nullptr;
208  short nMode = ENV_INSERT;
209 
210  const SwEnvItem* pItem = rReq.GetArg<SwEnvItem>(FN_ENVELOP);
211  if ( !pItem )
212  {
214  pDlg.disposeAndReset(pFact->CreateSwEnvDlg(pParent ? pParent->GetFrameWeld() : nullptr, aSet, pOldSh, pTempPrinter, !bEnvChange));
215  nMode = pDlg->Execute();
216  }
217  else
218  {
219  const SfxBoolItem* pBoolItem = rReq.GetArg<SfxBoolItem>(FN_PARAM_1);
220  if ( pBoolItem && pBoolItem->GetValue() )
221  nMode = ENV_NEWDOC;
222  }
223 
224  if (nMode == ENV_NEWDOC || nMode == ENV_INSERT)
225  {
226  SwWait aWait( static_cast<SwDocShell&>(*xDocSh), true );
227 
228  // Read dialog and save item to config
229  const SwEnvItem& rItem = pItem ? *pItem : static_cast<const SwEnvItem&>( pDlg->GetOutputItemSet()->Get(FN_ENVELOP) );
230  aEnvCfg.GetItem() = rItem;
231  aEnvCfg.Commit();
232 
233  // When we print we take the Jobsetup that is set up in the dialog.
234  // Information has to be set here, before a possible destruction of
235  // the new shell because the shell's printer has been handed to the
236  // dialog.
237  if ( nMode != ENV_NEWDOC )
238  {
239  OSL_ENSURE(pOldSh, "No document - wasn't 'Insert' disabled???");
241  aItem.SetValue(static_cast<sal_uInt8>(pSh->getIDocumentDeviceAccess().getPrinter(true)->GetPaperBin()));
243  }
244 
245  SwWrtShell *pTmp = nMode == ENV_INSERT ? pOldSh : pSh;
246  const SwPageDesc* pFollow = nullptr;
249  const OUString sSendMark = pSend->GetName();
250  const OUString sAddrMark = pAddr->GetName();
251 
252  if (nMode == ENV_INSERT)
253  {
254 
255  SetView(&pOldSh->GetView()); // Set pointer to top view
256 
257  // Delete new document
258  xDocSh->DoClose();
259  pSh = pOldSh;
260  //#i4251# selected text or objects in the document should
261  //not be deleted on inserting envelopes
262  pSh->EnterStdMode();
263  // Here it goes (insert)
265  pSh->StartAllAction();
266  pSh->SttEndDoc(true);
267 
268  if (bEnvChange)
269  {
270  // followup template: page 2
271  pFollow = pSh->GetPageDesc(pSh->GetCurPageDesc()).GetFollow();
272 
273  // Delete text from the first page
274  if ( !pSh->SttNxtPg(true) )
275  pSh->EndPg(true);
276  pSh->DelRight();
277  // Delete frame of the first page
278  if ( pSh->GotoFly(sSendMark) )
279  {
280  pSh->EnterSelFrameMode();
281  pSh->DelRight();
282  }
283  if ( pSh->GotoFly(sAddrMark) )
284  {
285  pSh->EnterSelFrameMode();
286  pSh->DelRight();
287  }
288  pSh->SttEndDoc(true);
289  }
290  else
291  // Followup template: page 1
292  pFollow = &pSh->GetPageDesc(pSh->GetCurPageDesc());
293 
294  // Insert page break
295  if ( pSh->IsCursorInTable() )
296  {
297  pSh->SplitNode();
298  pSh->Right( CRSR_SKIP_CHARS, false, 1, false );
300  aBreakSet.Put( SwFormatPageDesc( pFollow ) );
301  pSh->SetTableAttr( aBreakSet );
302  }
303  else
304  {
305  OUString sFollowName(pFollow->GetName());
306  pSh->InsertPageBreak(&sFollowName, boost::none);
307  }
308  pSh->SttEndDoc(true);
309  }
310  else
311  {
312  pFollow = &pSh->GetPageDesc(pSh->GetCurPageDesc());
313  // Let's go (print)
314  pSh->StartAllAction();
315  pSh->DoUndo(false);
316 
317  // Again, copy the new collections "Sender" and "Receiver" to
318  // a new document
319  if ( pOldSh )
320  {
323  }
324  }
325 
326  SET_CURR_SHELL(pSh);
327  pSh->SetNewDoc(); // Avoid performance problems
328 
329  // Remember Flys of this site
330  std::vector<SwFrameFormat*> aFlyArr;
331  if( ENV_NEWDOC != nMode && !bEnvChange )
332  pSh->GetPageObjs( aFlyArr );
333 
334  // Get page description
336  SwFrameFormat& rFormat = pDesc->GetMaster();
337 
338  Printer *pPrt = pSh->getIDocumentDeviceAccess().getPrinter( true );
339 
340  // Borders (are put together by Shift-Offset and alignment)
341  Size aPaperSize = pPrt->PixelToLogic( pPrt->GetPaperSizePixel(),
342  MapMode(MapUnit::MapTwip));
343  if ( !aPaperSize.Width() && !aPaperSize.Height() )
344  aPaperSize = SvxPaperInfo::GetPaperSize(PAPER_A4);
345  if ( aPaperSize.Width() > aPaperSize.Height() )
346  Swap( aPaperSize );
347 
348  long lLeft = rItem.m_nShiftRight,
349  lUpper = rItem.m_nShiftDown;
350 
351  sal_uInt16 nPageW = static_cast<sal_uInt16>(std::max(rItem.m_nWidth, rItem.m_nHeight)),
352  nPageH = static_cast<sal_uInt16>(std::min(rItem.m_nWidth, rItem.m_nHeight));
353 
354  switch (rItem.m_eAlign)
355  {
356  case ENV_HOR_LEFT: break;
357  case ENV_HOR_CNTR: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW)) / 2;
358  break;
359  case ENV_HOR_RGHT: lLeft += std::max(0L, long(aPaperSize.Width() - nPageW));
360  break;
361  case ENV_VER_LEFT: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH));
362  break;
363  case ENV_VER_CNTR: lUpper += std::max(0L, long(aPaperSize.Width() - nPageH)) / 2;
364  break;
365  case ENV_VER_RGHT: break;
366  }
367  SvxLRSpaceItem aLRMargin( RES_LR_SPACE );
368  SvxULSpaceItem aULMargin( RES_UL_SPACE );
369  aLRMargin.SetLeft (static_cast<sal_uInt16>(lLeft) );
370  aULMargin.SetUpper(static_cast<sal_uInt16>(lUpper));
371  aLRMargin.SetRight(0);
372  aULMargin.SetLower(0);
373  rFormat.SetFormatAttr(aLRMargin);
374  rFormat.SetFormatAttr(aULMargin);
375 
376  // Header and footer
377  rFormat.SetFormatAttr(SwFormatHeader(false));
378  pDesc->ChgHeaderShare(false);
379  rFormat.SetFormatAttr(SwFormatFooter(false));
380  pDesc->ChgFooterShare(false);
381 
382  // Page numbering
383  pDesc->SetUseOn(UseOnPage::All);
384 
385  // Page size
387  nPageW + lLeft, nPageH + lUpper));
388 
389  // Set type of page numbering
390  SvxNumberType aType;
392  pDesc->SetNumType(aType);
393 
394  // Followup template
395  if (pFollow)
396  pDesc->SetFollow(pFollow);
397 
398  // Landscape
399  pDesc->SetLandscape( rItem.m_eAlign >= ENV_VER_LEFT &&
400  rItem.m_eAlign <= ENV_VER_RGHT);
401 
402  // Apply page description
403 
404  size_t nPos;
405  pSh->FindPageDescByName( pDesc->GetName(),
406  false,
407  &nPos );
408 
409  pSh->ChgPageDesc( nPos, *pDesc);
410  pSh->ChgCurPageDesc(*pDesc);
411 
412  // Insert Frame
413  SwFlyFrameAttrMgr aMgr(false, pSh, Frmmgr_Type::ENVELP);
414  SwFieldMgr aFieldMgr;
416 
417  // Overwrite defaults!
418  aMgr.GetAttrSet().Put( SvxBoxItem(RES_BOX) );
419  aMgr.SetULSpace( 0, 0 );
420  aMgr.SetLRSpace( 0, 0 );
421 
422  // Sender
423  if (rItem.m_bSend)
424  {
425  pSh->SttEndDoc(true);
426  aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PAGE,
427  Point(rItem.m_nSendFromLeft + lLeft, rItem.m_nSendFromTop + lUpper),
428  Size (rItem.m_nAddrFromLeft - rItem.m_nSendFromLeft, 0));
429 
430  pSh->EnterSelFrameMode();
431  pSh->SetFlyName(sSendMark);
432  pSh->UnSelectFrame();
433  pSh->LeaveSelFrameMode();
434  pSh->SetTextFormatColl( pSend );
435  InsertLabEnvText( *pSh, aFieldMgr, rItem.m_aSendText );
436  aMgr.UpdateAttrMgr();
437  }
438 
439  // Addressee
440  pSh->SttEndDoc(true);
441 
442  aMgr.InsertFlyFrame(RndStdIds::FLY_AT_PAGE,
443  Point(rItem.m_nAddrFromLeft + lLeft, rItem.m_nAddrFromTop + lUpper),
444  Size (nPageW - rItem.m_nAddrFromLeft - 566, 0));
445  pSh->EnterSelFrameMode();
446  pSh->SetFlyName(sAddrMark);
447  pSh->UnSelectFrame();
448  pSh->LeaveSelFrameMode();
449  pSh->SetTextFormatColl( pAddr );
450  InsertLabEnvText(*pSh, aFieldMgr, rItem.m_aAddrText);
451 
452  // Move Flys to the "old" pages
453  if (!aFlyArr.empty())
454  pSh->SetPageObjsNewPage(aFlyArr);
455 
456  // Finished
457  pSh->SttEndDoc(true);
458 
459  pSh->EndAllAction();
460 
461  if (nMode == ENV_NEWDOC)
462  pSh->DoUndo();
463  else
465 
466  if (nMode == ENV_NEWDOC)
467  {
468  pFrame->GetFrame().Appear();
469 
470  if ( rItem.m_aAddrText.indexOf('<') >= 0 )
471  {
472  static sal_uInt16 const aInva[] =
473  {
474  SID_SBA_BRW_UPDATE,
475  SID_SBA_BRW_INSERT,
476  SID_SBA_BRW_MERGE,
477  0
478  };
479  pFrame->GetBindings().Invalidate( aInva );
480 
481  // Open database beamer
482  ShowDBObj(*pNewView, pSh->GetDBData());
483  }
484  }
485 
486  if ( !pItem )
487  {
488  rReq.AppendItem( rItem );
489  if ( nMode == ENV_NEWDOC )
490  rReq.AppendItem( SfxBoolItem( FN_PARAM_1, true ) );
491  }
492 
493  rReq.Done();
494  }
495  else // Abort
496  {
497  rReq.Ignore();
498 
499  xDocSh->DoClose();
500  --nTitleNo;
501 
502  // Set pointer to top view
503  if (pOldSh)
504  SetView(&pOldSh->GetView());
505  }
506 }
507 
508 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool GetValue() const
long Width() const
void GetPageObjs(std::vector< SwFrameFormat * > &rFillArr)
SS for envelopes: get all page-bound objects and set them to new page.
Definition: fefly1.cxx:965
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
Definition: swmodul1.cxx:373
void SetFlyName(const OUString &rName)
Set name at selected FlyFrame.
Definition: fefly1.cxx:1436
void Appear()
bool Right(sal_uInt16 nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
Definition: move.cxx:119
void SetUseOn(UseOnPage eNew)
Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
Definition: pagedesc.hxx:317
void SplitNode(bool bAutoFormat=false)
Definition: wrtsh1.cxx:973
bool EndPg(bool bSelect=false)
Definition: move.cxx:342
Represents the style of a paragraph.
Definition: fmtcol.hxx:55
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
Definition: edfmt.cxx:125
Size & Swap(Size &rSize)
SwEnvAlign m_eAlign
Definition: envimg.hxx:51
#define ENV_INSERT
Definition: appenv.cxx:73
OUString m_aSendText
Definition: envimg.hxx:44
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
Definition: fmtpdsc.hxx:35
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::boost::optional< sal_uInt16 > &rPgNum=boost::none)
Definition: wrtsh1.cxx:863
void ChgHeaderShare(bool bNew)
Definition: pagedesc.hxx:303
#define FN_ENVELOP
Definition: cmdid.h:721
void UpdateAttrMgr()
Definition: frmmgr.cxx:119
bool SttEndDoc(bool bStt)
Definition: crsrsh.cxx:563
virtual const SfxItemSet * GetOutputItemSet() const =0
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
long Height() const
sal_uInt16 GetTextFormatCollCount() const
Definition: edfcol.cxx:694
sal_Int32 m_nHeight
Definition: envimg.hxx:50
SVX_NUM_NUMBER_NONE
bool SttNxtPg(bool bSelect=false)
Definition: move.cxx:312
sal_Int32 m_nWidth
Definition: envimg.hxx:49
sal_uInt16 sal_Char sal_Char * pDesc
sal_Int32 m_nAddrFromLeft
Definition: envimg.hxx:45
static void lcl_CopyCollAttr(SwWrtShell const *pOldSh, SwWrtShell *pNewSh, sal_uInt16 nCollId)
Definition: appenv.cxx:132
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
Definition: edws.cxx:233
void EnterStdMode()
Definition: select.cxx:552
void Done(bool bRemove=false)
void DoUndo(bool bOn=true)
Undo.
Definition: edws.cxx:199
void SetULSpace(long nTop, long nBottom)
Definition: frmmgr.cxx:535
static SfxObjectShell * Current()
void Invalidate(sal_uInt16 nId)
sal_Int32 m_nSendFromLeft
Definition: envimg.hxx:47
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
bool InsertField(const SwInsertField_Data &rData)
Definition: fldmgr.cxx:895
Frame cannot be moved in Var-direction.
Definition: fmtfsize.hxx:38
void EndAllAction()
Definition: edws.cxx:96
void SetFollow(const SwPageDesc *pNew)
Definition: pagedesc.hxx:290
bool DelRight()
Definition: delete.cxx:282
const OUString & GetName() const
Definition: pagedesc.hxx:186
SwWrtShell & GetWrtShell() const
Definition: view.hxx:400
Used by the UI to modify the document model.
Definition: wrtsh.hxx:88
weld::Window * GetFrameWeld() const
SwTextFormatColl & GetTextFormatColl(sal_uInt16 nTextFormatColl) const
Definition: edfcol.cxx:699
void disposeAndReset(reference_type *pBody)
bool GotoFly(const OUString &rName, FlyCntType eType=FLYCNTTYPE_ALL, bool bSelFrame=true)
Definition: move.cxx:590
constexpr auto SFX_INTERFACE_NONE
OUString ReplacePoint(const OUString &rTmpName, bool bWithCommandType)
Definition: expfld.cxx:107
void SetLeft(const long nL, const sal_uInt16 nProp=100)
const SwView & GetView() const
Definition: wrtsh.hxx:426
void SetPageObjsNewPage(std::vector< SwFrameFormat * > &rFillArr)
Definition: fefly1.cxx:978
void InsertEnv(SfxRequest &)
Definition: appenv.cxx:143
void SetLandscape(bool bNew)
Definition: pagedesc.hxx:190
const OUString & GetName() const
Definition: format.hxx:111
Footer, for pageformats Client of FrameFormat describing the footer.
Definition: fmthdft.hxx:64
SfxFrame & GetFrame() const
sal_Int32 m_nAddrFromTop
Definition: envimg.hxx:46
PAPER_A4
#define RES_PAPER_BIN
Definition: hintids.hxx:195
const SfxItemSet & GetAttrSet() const
Definition: frmmgr.hxx:123
#define RES_UL_SPACE
Definition: hintids.hxx:197
const Size & GetPaperSizePixel() const
void Insert(SwField const &, SwPaM *pAnnotationRange=nullptr)
Definition: wrtsh2.cxx:71
sal_uInt16 GetPoolFormatId() const
Get and set Pool style IDs.
Definition: format.hxx:143
void InsertFlyFrame()
Definition: frmmgr.cxx:174
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
SfxItemPool & GetPool() const
void SetHeightSizeType(SwFrameSize eType)
Definition: frmmgr.cxx:576
bool m_bSend
Definition: envimg.hxx:43
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
Definition: viewsh.cxx:2590
const SfxItemPool & GetAttrPool() const
Definition: viewsh.hxx:614
void SetRight(const long nR, const sal_uInt16 nProp=100)
const SwTableNode * IsCursorInTable() const
Definition: crsrsh.hxx:887
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
void SetNumType(const SvxNumberType &rNew)
Definition: pagedesc.hxx:193
void ChgFooterShare(bool bNew)
Definition: pagedesc.hxx:310
SfxBindings & GetBindings()
void SetTitle(const OUString &rTitle)
const SwPageDesc & GetPageDesc(size_t i) const
Definition: fedesc.cxx:127
const T * GetArg(sal_uInt16 nSlotId) const
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
Definition: edws.cxx:222
SwDBData const & GetDBData() const
Database information.
Definition: edfld.cxx:298
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
Definition: docsh.hxx:224
#define SET_CURR_SHELL(shell)
Definition: swtypes.hxx:101
static SwAbstractDialogFactory * Create()
Definition: swabstdlg.cxx:36
virtual void setJobsetup(const JobSetup &rJobSetup)=0
Sets the Jobsetup.
GUIDCNamePair const aData
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
OUString SwResId(const char *pId)
Definition: swmodule.cxx:191
bool DelLeft()
Definition: delete.cxx:129
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
SfxViewShell * GetViewShell() const
sal_Int32 m_nShiftDown
Definition: envimg.hxx:54
virtual const JobSetup * getJobsetup() const =0
Returns the Jobsetup.
OUString InsertLabEnvText(SwWrtShell &rSh, SwFieldMgr &rFieldMgr, const OUString &rText)
Definition: appenv.cxx:76
#define RES_LR_SPACE
Definition: hintids.hxx:196
Point PixelToLogic(const Point &rDevicePt) const
virtual bool SetFormatAttr(const SfxPoolItem &rAttr)
Definition: format.cxx:460
Provides access to the formatting devices of a document.
SwFrameFormat & GetMaster()
Definition: pagedesc.hxx:216
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
SwEnvItem & GetItem()
Definition: envimg.hxx:82
SwWrtShell * GetWrtShellPtr() const
Definition: view.hxx:401
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
static SfxViewFrame * LoadHiddenDocument(SfxObjectShell const &i_rDoc, SfxInterfaceId i_nViewId)
OUString m_aAddrText
Definition: envimg.hxx:42
vcl::Window * GetWin() const
Definition: viewsh.hxx:340
void SetTableAttr(const SfxItemSet &)
Definition: fetab.cxx:2134
virtual VclPtr< SfxAbstractTabDialog > CreateSwEnvDlg(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell *pWrtSh, Printer *pPrt, bool bInsert)=0
bool DoInitNew(SfxMedium *pMedium=nullptr)
void ChgPageDesc(size_t i, const SwPageDesc &)
Definition: fedesc.cxx:112
const SvxPaperBinItem & GetPaperBin(bool=true) const
Definition: frmatr.hxx:72
SwPageDesc * GetPageDescFromPool(sal_uInt16 nId)
Definition: edfmt.cxx:136
void UnSelectFrame()
Definition: select.cxx:327
Header, for PageFormats Client of FrameFormat describing the header.
Definition: fmthdft.hxx:33
void SetNewDoc()
Optimizing UI.
Definition: edws.cxx:277
void LeaveSelFrameMode()
Definition: select.cxx:721
void SetView(SwView *pVw)
Definition: swmodule.hxx:145
SwPageDesc * FindPageDescByName(const OUString &rName, bool bGetFromPool=false, size_t *pPos=nullptr)
Definition: fedesc.cxx:132
#define RES_BOX
Definition: hintids.hxx:211
const sal_uInt16 CRSR_SKIP_CHARS
Definition: swcrsr.hxx:63
void AppendItem(const SfxPoolItem &)
#define ENV_NEWDOC
Definition: appenv.cxx:72
void SetLRSpace(long nLeft, long nRight)
Definition: frmmgr.cxx:523
sal_Int32 getTokenCount(const OString &rIn, sal_Char cTok)
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
Definition: select.cxx:703
const SwAttrSet & GetAttrSet() const
For querying the attribute array.
Definition: format.hxx:116
void SetNumberingType(SvxNumType nSet)
sal_Int32 m_nSendFromTop
Definition: envimg.hxx:48
void ChgCurPageDesc(const SwPageDesc &)
PageDescriptor-interface.
Definition: fedesc.cxx:44
void StartAllAction()
For all views of this document.
Definition: edws.cxx:85
Envelope.
Definition: poolfmt.hxx:175
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
sal_Int32 nPos
void Ignore()
size_t GetCurPageDesc(const bool bCalcFrame=true) const
Definition: fedesc.cxx:168
Frame is variable in Var-direction.
Definition: fmtfsize.hxx:37
sal_Int32 m_nShiftRight
Definition: envimg.hxx:53
Definition: view.hxx:146