33#include <osl/diagnose.h>
60#define ENV_NEWDOC RET_OK
61#define ENV_INSERT RET_USER
67 OUString aText = rText.replaceAll(
"\r",
"");
69 sal_Int32 nTokenPos = 0;
70 while( -1 != nTokenPos )
72 OUString aLine = aText.getToken( 0,
'\n', nTokenPos );
73 while ( !aLine.isEmpty() )
78 sal_Int32
nPos = aLine.indexOf(
'<' );
81 sal_Int32
const nCopy((
nPos != -1) ?
nPos : aLine.getLength());
82 sTmpText = aLine.copy(0, nCopy);
83 aLine = aLine.copy(nCopy);
87 nPos = aLine.indexOf(
'>' );
95 sTmpText = aLine.copy( 0,
nPos + 1);
96 aLine = aLine.copy(
nPos + 1);
99 OUString sDBName( sTmpText.copy( 1, sTmpText.getLength() - 2));
123 for( sal_uInt16 nCnt = 0; nCnt < nCollCnt; ++nCnt )
133 static sal_uInt16 nTitleNo = 0;
143 pOldSh = pMyDocSh ? pMyDocSh->
GetWrtShell() :
nullptr;
150 pNewView->AttrChangedNotify(
nullptr);
156 OUString aTmp =
SwResId(STR_ENV_TITLE) + OUString::number( ++nTitleNo );
171 bool bEnvChange =
false;
182 bEnvChange = rCurPageDesc.
GetName() == sEnvelope;
204 nMode = pDlg->Execute();
209 if ( pBoolItem && pBoolItem->
GetValue() )
228 OSL_ENSURE(pOldSh,
"No document - wasn't 'Insert' disabled???");
238 const OUString sSendMark = pSend->
GetName();
239 const OUString sAddrMark = pAddr->GetName();
294 OUString sFollowName(pFollow->
GetName());
319 std::vector<SwFrameFormat*> aFlyArr;
340 sal_uInt16 nPageW = o3tl::narrowing<sal_uInt16>(std::max(rItem.
m_nWidth, rItem.
m_nHeight)),
358 aLRMargin.
SetLeft (o3tl::narrowing<sal_uInt16>(lLeft) );
359 aULMargin.
SetUpper(o3tl::narrowing<sal_uInt16>(lUpper));
376 nPageW + lLeft, nPageH + lUpper));
442 if (!aFlyArr.empty())
461 static sal_uInt16
const aInva[] =
static void lcl_CopyCollAttr(SwWrtShell const *pOldSh, SwWrtShell *pNewSh, sal_uInt16 nCollId)
OUString InsertLabEnvText(SwWrtShell &rSh, SwFieldMgr &rFieldMgr, const OUString &rText)
Provides access to the formatting devices of a document.
virtual const JobSetup * getJobsetup() const =0
Returns the Jobsetup.
virtual SfxPrinter * getPrinter(bool bCreate) const =0
Return the printer set at the document.
virtual void setJobsetup(const JobSetup &rJobSetup)=0
Sets the Jobsetup.
SAL_WARN_UNUSED_RESULT Point PixelToLogic(const Point &rDevicePt) const
const Size & GetPaperSizePixel() const
void disposeAndReset(reference_type *pBody)
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
void SetTitle(const OUString &rTitle)
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
const T * GetArg(sal_uInt16 nSlotId) const
void AppendItem(const SfxPoolItem &)
void Done(bool bRemove=false)
SfxItemPool & GetPool() const
SfxViewShell * GetViewShell() const
SfxBindings & GetBindings()
SfxFrame & GetFrame() const
static SfxViewFrame * LoadHiddenDocument(SfxObjectShell const &i_rDoc, SfxInterfaceId i_nViewId)
constexpr tools::Long Height() const
constexpr tools::Long Width() const
void SetRight(const tools::Long nR, const sal_uInt16 nProp=100)
void SetLeft(const tools::Long nL, const sal_uInt16 nProp=100)
void SetNumberingType(SvxNumType nSet)
static Size GetPaperSize(Paper ePaper, MapUnit eUnit=MapUnit::MapTwip)
void SetLower(const sal_uInt16 nL, const sal_uInt16 nProp=100)
void SetUpper(const sal_uInt16 nU, const sal_uInt16 nProp=100)
virtual VclPtr< SfxAbstractTabDialog > CreateSwEnvDlg(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell *pWrtSh, Printer *pPrt, bool bInsert)=0
static SwAbstractDialogFactory * Create()
const SwTableNode * IsCursorInTable() const
Check if Point of current cursor is placed within a table.
bool SttEndDoc(bool bStt)
SwWrtShell * GetWrtShell()
Access to the SwWrtShell belonging to SwView.
void StartAllAction()
For all views of this document.
void SetNewDoc()
Optimizing UI.
SwUndoId StartUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Undo: set up Undo parenthesis, return nUndoId of this parenthesis.
SwTextFormatColl & GetTextFormatColl(sal_uInt16 nTextFormatColl) const
sal_uInt16 GetTextFormatCollCount() const
void SetTextFormatColl(SwTextFormatColl *, const bool bResetListAttrs=false)
Add 2nd optional parameter <bResetListAttrs> - see also <SwDoc::SetTextFormatColl(....
SwPageDesc * GetPageDescFromPool(sal_uInt16 nId)
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
SwDBData const & GetDBData() const
Database information.
SwUndoId EndUndo(SwUndoId eUndoId=SwUndoId::EMPTY, const SwRewriter *pRewriter=nullptr)
Closes parenthesis of nUndoId, not used by UI.
void DoUndo(bool bOn=true)
Undo.
sal_Int32 m_nSendFromLeft
sal_Int32 m_nAddrFromLeft
void ChgPageDesc(size_t i, const SwPageDesc &)
SwPageDesc * FindPageDescByName(const OUString &rName, bool bGetFromPool=false, size_t *pPos=nullptr)
void SetFlyName(const OUString &rName)
Set name at selected FlyFrame.
size_t GetCurPageDesc(const bool bCalcFrame=true) const
void ChgCurPageDesc(const SwPageDesc &)
PageDescriptor-interface.
void SetPageObjsNewPage(std::vector< SwFrameFormat * > &rFillArr)
const SwPageDesc & GetPageDesc(size_t i) const
void SetTableAttr(const SfxItemSet &)
void GetPageObjs(std::vector< SwFrameFormat * > &rFillArr)
SS for envelopes: get all page-bound objects and set them to new page.
bool InsertField(SwInsertField_Data &rData)
void SetLRSpace(tools::Long nLeft, tools::Long nRight)
const SfxItemSet & GetAttrSet() const
void SetHeightSizeType(SwFrameSize eType)
void SetULSpace(tools::Long nTop, tools::Long nBottom)
Pagedescriptor Client of SwPageDesc that is "described" by the attribute.
void InsertEnv(SfxRequest &)
void SetView(SwView *pVw)
static void ShowDBObj(SwView const &rView, const SwDBData &rData)
void ChgFooterShare(bool bNew)
const OUString & GetName() const
void SetFollow(const SwPageDesc *pNew)
SwFrameFormat & GetMaster()
void ChgHeaderShare(bool bNew)
void SetNumType(const SvxNumberType &rNew)
const SwPageDesc * GetFollow() const
void SetUseOn(UseOnPage eNew)
Same as WriteUseOn(), but the >= HeaderShare part of the bitfield is not modified.
void SetLandscape(bool bNew)
static void FillUIName(const OUString &rName, OUString &rFillName, SwGetPoolIdFromName)
Represents the style of a paragraph.
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the <SwNumRuleItem> and register/unregister the paragragh style at t...
const IDocumentDeviceAccess & getIDocumentDeviceAccess() const
Provides access to the document device interface.
const SfxItemPool & GetAttrPool() const
SwWrtShell * GetWrtShellPtr() const
Used by the UI to modify the document model.
bool EndPg(bool bSelect=false)
void EnterSelFrameMode(const Point *pStartDrag=nullptr)
bool Right(SwCursorSkipMode nMode, bool bSelect, sal_uInt16 nCount, bool bBasicCall, bool bVisual=false)
bool GotoFly(const OUString &rName, FlyCntType eType=FLYCNTTYPE_ALL, bool bSelFrame=true)
void Insert(const OUString &)
bool SttNxtPg(bool bSelect=false)
void SplitNode(bool bAutoFormat=false)
bool DelRight(bool isReplaceHeuristic=false)
void InsertPageBreak(const OUString *pPageDesc=nullptr, const ::std::optional< sal_uInt16 > &rPgNum=std::nullopt)
const SwView & GetView() const
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
OUString ReplacePoint(const OUString &rTmpName, bool bWithCommandType)
@ Fixed
Frame cannot be moved in Var-direction.
@ Variable
Frame is variable in Var-direction.
constexpr TypedWhichId< SvxBoxItem > RES_BOX(112)
constexpr TypedWhichId< SvxPaperBinItem > RES_PAPER_BIN(90)
constexpr TypedWhichId< SvxLRSpaceItem > RES_LR_SPACE(97)
constexpr TypedWhichId< SvxULSpaceItem > RES_UL_SPACE(98)
constexpr OUStringLiteral aData
sal_Int32 getTokenCount(std::string_view rIn, char cTok)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
@ RES_POOLCOLL_ENVELOPE_ADDRESS
Addressee.
@ RES_POOLCOLL_SEND_ADDRESS
Sender.
@ RES_POOLPAGE_ENVELOPE
Envelope.
constexpr auto SFX_INTERFACE_NONE
OUString SwResId(TranslateId aId)