summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/docshell/docsh4.cxx4
-rw-r--r--sc/source/ui/drawfunc/drtxtob.cxx15
-rw-r--r--sc/source/ui/inc/viewfunc.hxx5
-rw-r--r--sc/source/ui/view/cellsh.cxx2
-rw-r--r--sc/source/ui/view/editsh.cxx17
-rw-r--r--sc/source/ui/view/formatsh.cxx92
-rw-r--r--sc/source/ui/view/output2.cxx12
-rw-r--r--sc/source/ui/view/tabvwsha.cxx29
-rw-r--r--sc/source/ui/view/viewfun2.cxx2
-rw-r--r--sc/source/ui/view/viewfun4.cxx2
-rw-r--r--sc/source/ui/view/viewfunc.cxx20
11 files changed, 104 insertions, 96 deletions
diff --git a/sc/source/ui/docshell/docsh4.cxx b/sc/source/ui/docshell/docsh4.cxx
index de8d9e0d118e..549231097045 100644
--- a/sc/source/ui/docshell/docsh4.cxx
+++ b/sc/source/ui/docshell/docsh4.cxx
@@ -1138,8 +1138,8 @@ void ScDocShell::Execute( SfxRequest& rReq )
#endif
case SID_OPEN_CALC:
{
- SfxStringItem aApp(SID_DOC_SERVICE, OUString("com.sun.star.sheet.SpreadsheetDocument"));
- SfxStringItem aTarget(SID_TARGETNAME, OUString("_blank"));
+ SfxStringItem aApp(SID_DOC_SERVICE, "com.sun.star.sheet.SpreadsheetDocument");
+ SfxStringItem aTarget(SID_TARGETNAME, "_blank");
GetViewData()->GetDispatcher().ExecuteList(
SID_OPENDOC, SfxCallMode::API|SfxCallMode::SYNCHRON,
{ &aApp, &aTarget });
diff --git a/sc/source/ui/drawfunc/drtxtob.cxx b/sc/source/ui/drawfunc/drtxtob.cxx
index e13883ed3039..f735e56ef082 100644
--- a/sc/source/ui/drawfunc/drtxtob.cxx
+++ b/sc/source/ui/drawfunc/drtxtob.cxx
@@ -204,7 +204,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
const SvxFontItem& rItem = pOutView->GetAttribs().Get(EE_CHAR_FONTINFO);
OUString aString;
- SvxFontItem aNewItem( EE_CHAR_FONTINFO );
+ std::shared_ptr<SvxFontItem> aNewItem(std::make_shared<SvxFontItem>(EE_CHAR_FONTINFO));
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = nullptr;
@@ -221,12 +221,15 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
{
const OUString& aFontName(pFontItem->GetValue());
vcl::Font aFont(aFontName, Size(1,1)); // Size only because of CTOR
- aNewItem = SvxFontItem( aFont.GetFamilyType(), aFont.GetFamilyName(),
- aFont.GetStyleName(), aFont.GetPitch(),
- aFont.GetCharSet(), ATTR_FONT );
+ aNewItem = std::make_shared<SvxFontItem>(
+ aFont.GetFamilyType(), aFont.GetFamilyName(),
+ aFont.GetStyleName(), aFont.GetPitch(),
+ aFont.GetCharSet(), ATTR_FONT);
}
else
- aNewItem = rItem;
+ {
+ aNewItem.reset(static_cast<SvxFontItem*>(rItem.Clone()));
+ }
}
else
ScViewUtil::ExecuteCharMap( rItem, *pViewData->GetViewShell()->GetViewFrame() );
@@ -234,7 +237,7 @@ void ScDrawTextObjectBar::Execute( SfxRequest &rReq )
if ( !aString.isEmpty() )
{
SfxItemSet aSet( pOutliner->GetEmptyItemSet() );
- aSet.Put( aNewItem );
+ aSet.Put( *aNewItem );
// If nothing is selected, then SetAttribs of the View selects a word
pOutView->GetOutliner()->QuickSetAttribs( aSet, pOutView->GetSelection() );
pOutView->InsertText(aString);
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index 7719cddf6a5c..963b41f863ec 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -71,8 +71,9 @@ public:
~ScViewFunc();
SC_DLLPUBLIC const ScPatternAttr* GetSelectionPattern ();
- void GetSelectionFrame ( SvxBoxItem& rLineOuter,
- SvxBoxInfoItem& rLineInner );
+ void GetSelectionFrame(
+ std::shared_ptr<SvxBoxItem>& rLineOuter,
+ std::shared_ptr<SvxBoxInfoItem>& rLineInner );
SvtScriptType GetSelectionScriptType();
diff --git a/sc/source/ui/view/cellsh.cxx b/sc/source/ui/view/cellsh.cxx
index b751a8dd893f..26020a86ef4f 100644
--- a/sc/source/ui/view/cellsh.cxx
+++ b/sc/source/ui/view/cellsh.cxx
@@ -806,7 +806,7 @@ void ScCellShell::GetState(SfxItemSet &rSet)
// In interpreter may happen via rescheduled Basic
if ( pDoc->IsInInterpreter() )
- rSet.Put( SfxStringItem( nWhich, OUString("...") ) );
+ rSet.Put( SfxStringItem( nWhich, "..." ) );
else
{
FormulaError nErrCode = FormulaError::NONE;
diff --git a/sc/source/ui/view/editsh.cxx b/sc/source/ui/view/editsh.cxx
index b65bd957ab3b..100592811994 100644
--- a/sc/source/ui/view/editsh.cxx
+++ b/sc/source/ui/view/editsh.cxx
@@ -391,7 +391,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
pTableView->GetAttribs().Get(nFontWhich));
OUString aString;
- SvxFontItem aNewItem( EE_CHAR_FONTINFO );
+ std::shared_ptr<SvxFontItem> aNewItem(std::make_shared<SvxFontItem>(EE_CHAR_FONTINFO));
const SfxItemSet *pArgs = rReq.GetArgs();
const SfxPoolItem* pItem = nullptr;
@@ -408,12 +408,15 @@ void ScEditShell::Execute( SfxRequest& rReq )
{
const OUString& aFontName(pFontItem->GetValue());
vcl::Font aFont(aFontName, Size(1,1)); // Size just because CTOR
- aNewItem = SvxFontItem( aFont.GetFamilyType(), aFont.GetFamilyName(),
- aFont.GetStyleName(), aFont.GetPitch(),
- aFont.GetCharSet(), ATTR_FONT );
+ aNewItem = std::make_shared<SvxFontItem>(
+ aFont.GetFamilyType(), aFont.GetFamilyName(),
+ aFont.GetStyleName(), aFont.GetPitch(),
+ aFont.GetCharSet(), ATTR_FONT);
}
else
- aNewItem = rItem;
+ {
+ aNewItem.reset(static_cast<SvxFontItem*>(rItem.Clone()));
+ }
}
else
{
@@ -436,7 +439,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
SfxItemSet aSet( pTableView->GetEmptyItemSet() );
SvxScriptSetItem aSetItem( SID_ATTR_CHAR_FONT, GetPool() );
- aSetItem.PutItemForScriptType( nSetScript, aNewItem );
+ aSetItem.PutItemForScriptType( nSetScript, *aNewItem );
aSet.Put( aSetItem.GetItemSet(), false );
// SetAttribs on the View selects a word, when nothing is selected
@@ -446,7 +449,7 @@ void ScEditShell::Execute( SfxRequest& rReq )
pTopView->InsertText(aString);
SfxStringItem aStringItem( SID_CHARMAP, aString );
- SfxStringItem aFontItem( SID_ATTR_SPECIALCHAR, aNewItem.GetFamilyName() );
+ SfxStringItem aFontItem( SID_ATTR_SPECIALCHAR, aNewItem->GetFamilyName() );
rReq.AppendItem( aFontItem );
rReq.AppendItem( aStringItem );
rReq.Done();
diff --git a/sc/source/ui/view/formatsh.cxx b/sc/source/ui/view/formatsh.cxx
index f7315debd5de..0f085f50e913 100644
--- a/sc/source/ui/view/formatsh.cxx
+++ b/sc/source/ui/view/formatsh.cxx
@@ -2053,121 +2053,121 @@ void ScFormatShell::GetAttrState( SfxItemSet& rSet )
editeng::SvxBorderLine aLine(nullptr,0,SvxBorderLineStyle::SOLID);
bool bCol = false;
bool bColDisable = false, bStyleDisable = false;
- SvxBoxItem aBoxItem(ATTR_BORDER);
- SvxBoxInfoItem aInfoItem(ATTR_BORDER_INNER);
+ std::shared_ptr<SvxBoxItem> aBoxItem(std::make_shared<SvxBoxItem>(ATTR_BORDER));
+ std::shared_ptr<SvxBoxInfoItem> aInfoItem(std::make_shared<SvxBoxInfoItem>(ATTR_BORDER_INNER));
pTabViewShell->GetSelectionFrame(aBoxItem, aInfoItem);
- if( aBoxItem.GetTop() )
+ if( aBoxItem->GetTop() )
{
bCol = true;
- aCol = aBoxItem.GetTop()->GetColor() ;
+ aCol = aBoxItem->GetTop()->GetColor() ;
aLine.SetColor(aCol);
- aLine.SetWidth( aBoxItem.GetTop()->GetWidth());
- aLine.SetBorderLineStyle( aBoxItem.GetTop()->GetBorderLineStyle());
+ aLine.SetWidth( aBoxItem->GetTop()->GetWidth());
+ aLine.SetBorderLineStyle( aBoxItem->GetTop()->GetBorderLineStyle());
}
- if( aBoxItem.GetBottom() )
+ if( aBoxItem->GetBottom() )
{
if(!bCol)
{
bCol = true;
- aCol = aBoxItem.GetBottom()->GetColor() ;
+ aCol = aBoxItem->GetBottom()->GetColor() ;
aLine.SetColor(aCol);
- aLine.SetWidth( aBoxItem.GetBottom()->GetWidth());
- aLine.SetBorderLineStyle( aBoxItem.GetBottom()->GetBorderLineStyle());
+ aLine.SetWidth( aBoxItem->GetBottom()->GetWidth());
+ aLine.SetBorderLineStyle( aBoxItem->GetBottom()->GetBorderLineStyle());
}
else
{
- if(aCol != aBoxItem.GetBottom()->GetColor() )
+ if(aCol != aBoxItem->GetBottom()->GetColor() )
bColDisable = true;
- if( aLine != *aBoxItem.GetBottom() )
+ if( aLine != *aBoxItem->GetBottom() )
bStyleDisable = true;
}
}
- if( aBoxItem.GetLeft() )
+ if( aBoxItem->GetLeft() )
{
if(!bCol)
{
bCol = true;
- aCol = aBoxItem.GetLeft()->GetColor() ;
+ aCol = aBoxItem->GetLeft()->GetColor() ;
aLine.SetColor(aCol);
- aLine.SetWidth( aBoxItem.GetLeft()->GetWidth());
- aLine.SetBorderLineStyle( aBoxItem.GetLeft()->GetBorderLineStyle());
+ aLine.SetWidth( aBoxItem->GetLeft()->GetWidth());
+ aLine.SetBorderLineStyle( aBoxItem->GetLeft()->GetBorderLineStyle());
}
else
{
- if(aCol != aBoxItem.GetLeft()->GetColor() )
+ if(aCol != aBoxItem->GetLeft()->GetColor() )
bColDisable = true;
- if( aLine != *aBoxItem.GetLeft() )
+ if( aLine != *aBoxItem->GetLeft() )
bStyleDisable = true;
}
}
- if( aBoxItem.GetRight() )
+ if( aBoxItem->GetRight() )
{
if(!bCol)
{
bCol = true;
- aCol = aBoxItem.GetRight()->GetColor() ;
+ aCol = aBoxItem->GetRight()->GetColor() ;
aLine.SetColor(aCol);
- aLine.SetWidth( aBoxItem.GetRight()->GetWidth());
- aLine.SetBorderLineStyle( aBoxItem.GetRight()->GetBorderLineStyle());
+ aLine.SetWidth( aBoxItem->GetRight()->GetWidth());
+ aLine.SetBorderLineStyle( aBoxItem->GetRight()->GetBorderLineStyle());
}
else
{
- if(aCol != aBoxItem.GetRight()->GetColor() )
+ if(aCol != aBoxItem->GetRight()->GetColor() )
bColDisable = true;
- if( aLine != *aBoxItem.GetRight() )
+ if( aLine != *aBoxItem->GetRight() )
bStyleDisable = true;
}
}
- if( aInfoItem.GetVert())
+ if( aInfoItem->GetVert())
{
if(!bCol)
{
bCol = true;
- aCol = aInfoItem.GetVert()->GetColor() ;
+ aCol = aInfoItem->GetVert()->GetColor() ;
aLine.SetColor(aCol);
- aLine.SetWidth( aInfoItem.GetVert()->GetWidth());
- aLine.SetBorderLineStyle( aInfoItem.GetVert()->GetBorderLineStyle());
+ aLine.SetWidth( aInfoItem->GetVert()->GetWidth());
+ aLine.SetBorderLineStyle( aInfoItem->GetVert()->GetBorderLineStyle());
}
else
{
- if(aCol != aInfoItem.GetVert()->GetColor() )
+ if(aCol != aInfoItem->GetVert()->GetColor() )
bColDisable = true;
- if( aLine != *aInfoItem.GetVert() )
+ if( aLine != *aInfoItem->GetVert() )
bStyleDisable = true;
}
}
- if( aInfoItem.GetHori())
+ if( aInfoItem->GetHori())
{
if(!bCol)
{
bCol = true;
- aCol = aInfoItem.GetHori()->GetColor() ;
+ aCol = aInfoItem->GetHori()->GetColor() ;
aLine.SetColor(aCol);
- aLine.SetWidth( aInfoItem.GetHori()->GetWidth());
- aLine.SetBorderLineStyle( aInfoItem.GetHori()->GetBorderLineStyle());
+ aLine.SetWidth( aInfoItem->GetHori()->GetWidth());
+ aLine.SetBorderLineStyle( aInfoItem->GetHori()->GetBorderLineStyle());
}
else
{
- if(aCol != aInfoItem.GetHori()->GetColor() )
+ if(aCol != aInfoItem->GetHori()->GetColor() )
bColDisable = true;
- if( aLine != *aInfoItem.GetHori() )
+ if( aLine != *aInfoItem->GetHori() )
bStyleDisable = true;
}
}
- if( !aInfoItem.IsValid( SvxBoxInfoItemValidFlags::VERT )
- || !aInfoItem.IsValid( SvxBoxInfoItemValidFlags::HORI )
- || !aInfoItem.IsValid( SvxBoxInfoItemValidFlags::LEFT )
- || !aInfoItem.IsValid( SvxBoxInfoItemValidFlags::RIGHT )
- || !aInfoItem.IsValid( SvxBoxInfoItemValidFlags::TOP )
- || !aInfoItem.IsValid( SvxBoxInfoItemValidFlags::BOTTOM ) )
+ if( !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::VERT )
+ || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::HORI )
+ || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::LEFT )
+ || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::RIGHT )
+ || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::TOP )
+ || !aInfoItem->IsValid( SvxBoxInfoItemValidFlags::BOTTOM ) )
{
bColDisable = true;
bStyleDisable = true;
@@ -2414,15 +2414,15 @@ void ScFormatShell::GetTextAttrState( SfxItemSet& rSet )
void ScFormatShell::GetBorderState( SfxItemSet& rSet )
{
ScTabViewShell* pTabViewShell = GetViewData()->GetViewShell();
- SvxBoxItem aBoxItem( ATTR_BORDER );
- SvxBoxInfoItem aInfoItem( ATTR_BORDER_INNER );
+ std::shared_ptr<SvxBoxItem> aBoxItem(std::make_shared<SvxBoxItem>(ATTR_BORDER));
+ std::shared_ptr<SvxBoxInfoItem> aInfoItem(std::make_shared<SvxBoxInfoItem>(ATTR_BORDER_INNER));
pTabViewShell->GetSelectionFrame( aBoxItem, aInfoItem );
if ( rSet.GetItemState( ATTR_BORDER ) != SfxItemState::UNKNOWN )
- rSet.Put( aBoxItem );
+ rSet.Put( *aBoxItem );
if ( rSet.GetItemState( ATTR_BORDER_INNER ) != SfxItemState::UNKNOWN )
- rSet.Put( aInfoItem );
+ rSet.Put( *aInfoItem );
}
void ScFormatShell::GetAlignState( SfxItemSet& rSet )
diff --git a/sc/source/ui/view/output2.cxx b/sc/source/ui/view/output2.cxx
index f0b0e9fb7149..3aaaaccd4f15 100644
--- a/sc/source/ui/view/output2.cxx
+++ b/sc/source/ui/view/output2.cxx
@@ -2413,21 +2413,15 @@ void ScOutputData::DrawEditParam::setPatternToEngine(bool bUseStyleColor)
const SfxPoolItem* pItem;
if ( mpPreviewFontSet->GetItemState( ATTR_FONT, true, &pItem ) == SfxItemState::SET )
{
- SvxFontItem aFontItem(EE_CHAR_FONTINFO);
- aFontItem = static_cast<const SvxFontItem&>(*pItem);
- pSet->Put( aFontItem );
+ pSet->Put(*pItem);
}
if ( mpPreviewFontSet->GetItemState( ATTR_CJK_FONT, true, &pItem ) == SfxItemState::SET )
{
- SvxFontItem aCjkFontItem(EE_CHAR_FONTINFO_CJK);
- aCjkFontItem = static_cast<const SvxFontItem&>(*pItem);
- pSet->Put( aCjkFontItem );
+ pSet->Put(*pItem);
}
if ( mpPreviewFontSet->GetItemState( ATTR_CTL_FONT, true, &pItem ) == SfxItemState::SET )
{
- SvxFontItem aCtlFontItem(EE_CHAR_FONTINFO_CTL);
- aCtlFontItem = static_cast<const SvxFontItem&>(*pItem);
- pSet->Put( aCtlFontItem );
+ pSet->Put(*pItem);
}
}
mpEngine->SetDefaults( pSet );
diff --git a/sc/source/ui/view/tabvwsha.cxx b/sc/source/ui/view/tabvwsha.cxx
index 0ab20a898e52..fbd9ca9564fd 100644
--- a/sc/source/ui/view/tabvwsha.cxx
+++ b/sc/source/ui/view/tabvwsha.cxx
@@ -475,8 +475,8 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
{
ScDocument* pDoc = GetViewData().GetDocument();
- SvxBoxItem aLineOuter( ATTR_BORDER );
- SvxBoxInfoItem aLineInner( ATTR_BORDER_INNER );
+ std::shared_ptr<SvxBoxItem> aLineOuter(std::make_shared<SvxBoxItem>(ATTR_BORDER));
+ std::shared_ptr<SvxBoxInfoItem> aLineInner(std::make_shared<SvxBoxInfoItem>(ATTR_BORDER_INNER));
const ScPatternAttr* pOldAttrs = GetSelectionPattern();
@@ -506,26 +506,29 @@ void ScTabViewShell::ExecuteCellFormatDlg(SfxRequest& rReq, const OString &rName
// Get border items and put them in the set:
GetSelectionFrame( aLineOuter, aLineInner );
+
//Fix border incorrect for RTL fdo#62399
if( pDoc->IsLayoutRTL( GetViewData().GetTabNo() ) )
{
- SvxBoxItem aNewFrame( aLineOuter );
- SvxBoxInfoItem aTempInfo( aLineInner );
+ std::shared_ptr<SvxBoxItem> aNewFrame(static_cast<SvxBoxItem*>(aLineOuter->Clone()));
+ std::shared_ptr<SvxBoxInfoItem> aTempInfo(static_cast<SvxBoxInfoItem*>(aLineInner->Clone()));
- if ( aLineInner.IsValid(SvxBoxInfoItemValidFlags::LEFT) )
- aNewFrame.SetLine( aLineOuter.GetLeft(), SvxBoxItemLine::RIGHT );
- if ( aLineInner.IsValid(SvxBoxInfoItemValidFlags::RIGHT) )
- aNewFrame.SetLine( aLineOuter.GetRight(), SvxBoxItemLine::LEFT );
+ if ( aLineInner->IsValid(SvxBoxInfoItemValidFlags::LEFT) )
+ aNewFrame->SetLine( aLineOuter->GetLeft(), SvxBoxItemLine::RIGHT );
+ if ( aLineInner->IsValid(SvxBoxInfoItemValidFlags::RIGHT) )
+ aNewFrame->SetLine( aLineOuter->GetRight(), SvxBoxItemLine::LEFT );
- aLineInner.SetValid( SvxBoxInfoItemValidFlags::LEFT, aTempInfo.IsValid(SvxBoxInfoItemValidFlags::RIGHT));
- aLineInner.SetValid( SvxBoxInfoItemValidFlags::RIGHT, aTempInfo.IsValid(SvxBoxInfoItemValidFlags::LEFT));
+ aLineInner->SetValid( SvxBoxInfoItemValidFlags::LEFT, aTempInfo->IsValid(SvxBoxInfoItemValidFlags::RIGHT));
+ aLineInner->SetValid( SvxBoxInfoItemValidFlags::RIGHT, aTempInfo->IsValid(SvxBoxInfoItemValidFlags::LEFT));
- pOldSet->Put( aNewFrame );
+ pOldSet->Put( *aNewFrame );
}
else
- pOldSet->Put( aLineOuter );
+ {
+ pOldSet->Put( *aLineOuter );
+ }
- pOldSet->Put( aLineInner );
+ pOldSet->Put( *aLineInner );
// Generate NumberFormat Value from Value and Language and box it.
pOldSet->Put( SfxUInt32Item( ATTR_VALUE_FORMAT,
diff --git a/sc/source/ui/view/viewfun2.cxx b/sc/source/ui/view/viewfun2.cxx
index 96b57048f6b2..bc8a0551417f 100644
--- a/sc/source/ui/view/viewfun2.cxx
+++ b/sc/source/ui/view/viewfun2.cxx
@@ -2683,7 +2683,7 @@ void ScViewFunc::MoveTable(
// execute without SfxCallMode::RECORD, because already contained in move command
SfxStringItem aItem( SID_FILE_NAME, "private:factory/" STRING_SCAPP );
- SfxStringItem aTarget( SID_TARGETNAME, OUString("_blank") );
+ SfxStringItem aTarget( SID_TARGETNAME, "_blank" );
const SfxPoolItem* pRetItem = GetViewData().GetDispatcher().ExecuteList(
SID_OPENDOC, SfxCallMode::API|SfxCallMode::SYNCHRON,
diff --git a/sc/source/ui/view/viewfun4.cxx b/sc/source/ui/view/viewfun4.cxx
index 938571650805..7c34c1b549af 100644
--- a/sc/source/ui/view/viewfun4.cxx
+++ b/sc/source/ui/view/viewfun4.cxx
@@ -619,7 +619,7 @@ bool ScViewFunc::PasteFile( const Point& rPos, const OUString& rFile, bool bLink
SfxStringItem aFileNameItem( SID_FILE_NAME, aStrURL );
SfxStringItem aFilterItem( SID_FILTER_NAME, pFlt->GetName() );
// #i69524# add target, as in SfxApplication when the Open dialog is used
- SfxStringItem aTargetItem( SID_TARGETNAME, OUString("_default") );
+ SfxStringItem aTargetItem( SID_TARGETNAME, "_default" );
// Open Asynchronously, because it can also happen from D&D
// and that is not so good for the MAC...
diff --git a/sc/source/ui/view/viewfunc.cxx b/sc/source/ui/view/viewfunc.cxx
index 9fa34128fedc..894259de285b 100644
--- a/sc/source/ui/view/viewfunc.cxx
+++ b/sc/source/ui/view/viewfunc.cxx
@@ -851,14 +851,17 @@ const ScPatternAttr* ScViewFunc::GetSelectionPattern()
}
}
-void ScViewFunc::GetSelectionFrame( SvxBoxItem& rLineOuter,
- SvxBoxInfoItem& rLineInner )
+void ScViewFunc::GetSelectionFrame(
+ std::shared_ptr<SvxBoxItem>& rLineOuter,
+ std::shared_ptr<SvxBoxInfoItem>& rLineInner )
{
ScDocument* pDoc = GetViewData().GetDocument();
const ScMarkData& rMark = GetViewData().GetMarkData();
if ( rMark.IsMarked() || rMark.IsMultiMarked() )
- pDoc->GetSelectionFrame( rMark, rLineOuter, rLineInner );
+ {
+ pDoc->GetSelectionFrame( rMark, *rLineOuter, *rLineInner );
+ }
else
{
const ScPatternAttr* pAttrs =
@@ -866,11 +869,12 @@ void ScViewFunc::GetSelectionFrame( SvxBoxItem& rLineOuter,
GetViewData().GetCurY(),
GetViewData().GetTabNo() );
- rLineOuter = pAttrs->GetItem( ATTR_BORDER );
- rLineInner = pAttrs->GetItem( ATTR_BORDER_INNER );
- rLineInner.SetTable(false);
- rLineInner.SetDist(true);
- rLineInner.SetMinDist(false);
+ rLineOuter.reset(static_cast<SvxBoxItem*>(pAttrs->GetItem(ATTR_BORDER).Clone()));
+ rLineInner.reset(static_cast<SvxBoxInfoItem*>(pAttrs->GetItem(ATTR_BORDER_INNER).Clone()));
+
+ rLineInner->SetTable(false);
+ rLineInner->SetDist(true);
+ rLineInner->SetMinDist(false);
}
}