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