summaryrefslogtreecommitdiff
path: root/sw/source/uibase/utlui
diff options
context:
space:
mode:
Diffstat (limited to 'sw/source/uibase/utlui')
-rw-r--r--sw/source/uibase/utlui/navipi.cxx2
-rw-r--r--sw/source/uibase/utlui/uitool.cxx48
2 files changed, 27 insertions, 23 deletions
diff --git a/sw/source/uibase/utlui/navipi.cxx b/sw/source/uibase/utlui/navipi.cxx
index af7a34ca2e80..7aac5d6094c4 100644
--- a/sw/source/uibase/utlui/navipi.cxx
+++ b/sw/source/uibase/utlui/navipi.cxx
@@ -1115,7 +1115,7 @@ sal_Int8 SwNavigationPI::ExecuteDrop( const ExecuteDropEvent& rEvt )
m_pxObjectShell.reset();
}
SfxStringItem aFileItem(SID_FILE_NAME, sFileName );
- SfxStringItem aOptionsItem( SID_OPTIONS, OUString("HRC") );
+ SfxStringItem aOptionsItem( SID_OPTIONS, "HRC" );
SfxLinkItem aLink( SID_DONELINK,
LINK( this, SwNavigationPI, DoneLink ) );
GetActiveView()->GetViewFrame()->GetDispatcher()->ExecuteList(
diff --git a/sw/source/uibase/utlui/uitool.cxx b/sw/source/uibase/utlui/uitool.cxx
index 2c84af61fd53..c44434b25961 100644
--- a/sw/source/uibase/utlui/uitool.cxx
+++ b/sw/source/uibase/utlui/uitool.cxx
@@ -101,25 +101,27 @@ void SetMetric(MetricFormatter& rCtrl, FieldUnit eUnit)
void PrepareBoxInfo(SfxItemSet& rSet, const SwWrtShell& rSh)
{
- SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
+ std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
const SfxPoolItem *pBoxInfo;
- if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER,
- true, &pBoxInfo))
- aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo);
+
+ if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, true, &pBoxInfo))
+ {
+ aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->Clone()));
+ }
// Table variant: If more than one table cells are selected
rSh.GetCursor(); //So that GetCursorCnt() returns the right thing
- aBoxInfo.SetTable (rSh.IsTableMode() && rSh.GetCursorCnt() > 1);
+ aBoxInfo->SetTable (rSh.IsTableMode() && rSh.GetCursorCnt() > 1);
// Always show the distance field
- aBoxInfo.SetDist (true);
+ aBoxInfo->SetDist (true);
// Set minimal size in tables and paragraphs
- aBoxInfo.SetMinDist (rSh.IsTableMode() || rSh.GetSelectionType() & (SelectionType::Text | SelectionType::Table));
+ aBoxInfo->SetMinDist (rSh.IsTableMode() || rSh.GetSelectionType() & (SelectionType::Text | SelectionType::Table));
// Set always the default distance
- aBoxInfo.SetDefDist (MIN_BORDER_DIST);
+ aBoxInfo->SetDefDist (MIN_BORDER_DIST);
// Single lines can have only in tables DontCare-Status
- aBoxInfo.SetValid(SvxBoxInfoItemValidFlags::DISABLE, !rSh.IsTableMode());
+ aBoxInfo->SetValid(SvxBoxInfoItemValidFlags::DISABLE, !rSh.IsTableMode());
- rSet.Put(aBoxInfo);
+ rSet.Put(*aBoxInfo);
}
void ConvertAttrCharToGen(SfxItemSet& rSet)
@@ -427,22 +429,24 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
// Margins, border and the other stuff.
rSet.Put(rMaster.GetAttrSet());
- SvxBoxInfoItem aBoxInfo( SID_ATTR_BORDER_INNER );
+ std::shared_ptr<SvxBoxInfoItem> aBoxInfo(std::make_shared<SvxBoxInfoItem>(SID_ATTR_BORDER_INNER));
const SfxPoolItem *pBoxInfo;
- if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER,
- true, &pBoxInfo) )
- aBoxInfo = *static_cast<const SvxBoxInfoItem*>(pBoxInfo);
- aBoxInfo.SetTable( false );
+ if ( SfxItemState::SET == rSet.GetItemState( SID_ATTR_BORDER_INNER, true, &pBoxInfo) )
+ {
+ aBoxInfo.reset(static_cast<SvxBoxInfoItem*>(pBoxInfo->Clone()));
+ }
+
+ aBoxInfo->SetTable( false );
// Show always the distance field
- aBoxInfo.SetDist( true);
+ aBoxInfo->SetDist( true);
// Set minimal size in tables and paragraphs
- aBoxInfo.SetMinDist( false );
+ aBoxInfo->SetMinDist( false );
// Set always the default distance
- aBoxInfo.SetDefDist( MIN_BORDER_DIST );
+ aBoxInfo->SetDefDist( MIN_BORDER_DIST );
// Single lines can have only in tables DontCare-Status
- aBoxInfo.SetValid( SvxBoxInfoItemValidFlags::DISABLE );
- rSet.Put( aBoxInfo );
+ aBoxInfo->SetValid( SvxBoxInfoItemValidFlags::DISABLE );
+ rSet.Put( *aBoxInfo );
SfxStringItem aFollow(SID_ATTR_PAGE_EXT1, OUString());
if(rPageDesc.GetFollow())
@@ -492,7 +496,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
// Shifting frame attributes
aHeaderSet.Put(pHeaderFormat->GetAttrSet());
- aHeaderSet.Put( aBoxInfo );
+ aHeaderSet.Put( *aBoxInfo );
// Create SetItem
SvxSetItem aSetItem(SID_ATTR_PAGE_HEADERSET, aHeaderSet);
@@ -542,7 +546,7 @@ void PageDescToItemSet( const SwPageDesc& rPageDesc, SfxItemSet& rSet)
// Shifting Frame attributes
aFooterSet.Put(pFooterFormat->GetAttrSet());
- aFooterSet.Put( aBoxInfo );
+ aFooterSet.Put( *aBoxInfo );
// Create SetItem
SvxSetItem aSetItem(SID_ATTR_PAGE_FOOTERSET, aFooterSet);