summaryrefslogtreecommitdiff
path: root/sw/source/uibase/app/appenv.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/app/appenv.cxx')
-rw-r--r--sw/source/uibase/app/appenv.cxx17
1 files changed, 10 insertions, 7 deletions
diff --git a/sw/source/uibase/app/appenv.cxx b/sw/source/uibase/app/appenv.cxx
index 02ce718915ae..6c744867ada1 100644
--- a/sw/source/uibase/app/appenv.cxx
+++ b/sw/source/uibase/app/appenv.cxx
@@ -150,6 +150,9 @@ void SwModule::InsertEnv( SfxRequest& rReq )
pNewView->AttrChangedNotify(nullptr); // so that SelectShell is being called
pSh = pNewView->GetWrtShellPtr();
+ if (!pSh)
+ return;
+
OUString aTmp = SwResId(STR_ENV_TITLE) + OUString::number( ++nTitleNo );
xDocSh->SetTitle( aTmp );
@@ -167,7 +170,7 @@ void SwModule::InsertEnv( SfxRequest& rReq )
// Check if there's already an envelope.
bool bEnvChange = false;
- SfxItemSet aSet(GetPool(), svl::Items<FN_ENVELOP, FN_ENVELOP>{});
+ SfxItemSetFixed<FN_ENVELOP, FN_ENVELOP> aSet(GetPool());
aSet.Put(aEnvCfg.GetItem());
SfxPrinter* pTempPrinter = pSh->getIDocumentDeviceAccess().getPrinter( true );
@@ -281,8 +284,8 @@ void SwModule::InsertEnv( SfxRequest& rReq )
if ( pSh->IsCursorInTable() )
{
pSh->SplitNode();
- pSh->Right( CRSR_SKIP_CHARS, false, 1, false );
- SfxItemSet aBreakSet( pSh->GetAttrPool(), svl::Items<RES_PAGEDESC, RES_PAGEDESC>{} );
+ pSh->Right( SwCursorSkipMode::Chars, false, 1, false );
+ SfxItemSetFixed<RES_PAGEDESC, RES_PAGEDESC> aBreakSet( pSh->GetAttrPool() );
aBreakSet.Put( SwFormatPageDesc( pFollow ) );
pSh->SetTableAttr( aBreakSet );
}
@@ -334,8 +337,8 @@ void SwModule::InsertEnv( SfxRequest& rReq )
tools::Long lLeft = rItem.m_nShiftRight,
lUpper = rItem.m_nShiftDown;
- sal_uInt16 nPageW = static_cast<sal_uInt16>(std::max(rItem.m_nWidth, rItem.m_nHeight)),
- nPageH = static_cast<sal_uInt16>(std::min(rItem.m_nWidth, rItem.m_nHeight));
+ sal_uInt16 nPageW = o3tl::narrowing<sal_uInt16>(std::max(rItem.m_nWidth, rItem.m_nHeight)),
+ nPageH = o3tl::narrowing<sal_uInt16>(std::min(rItem.m_nWidth, rItem.m_nHeight));
switch (rItem.m_eAlign)
{
@@ -352,8 +355,8 @@ void SwModule::InsertEnv( SfxRequest& rReq )
}
SvxLRSpaceItem aLRMargin( RES_LR_SPACE );
SvxULSpaceItem aULMargin( RES_UL_SPACE );
- aLRMargin.SetLeft (static_cast<sal_uInt16>(lLeft) );
- aULMargin.SetUpper(static_cast<sal_uInt16>(lUpper));
+ aLRMargin.SetLeft (o3tl::narrowing<sal_uInt16>(lLeft) );
+ aULMargin.SetUpper(o3tl::narrowing<sal_uInt16>(lUpper));
aLRMargin.SetRight(0);
aULMargin.SetLower(0);
rFormat.SetFormatAttr(aLRMargin);