summaryrefslogtreecommitdiff
path: root/sc/source/ui/view/cellsh1.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'sc/source/ui/view/cellsh1.cxx')
-rw-r--r--sc/source/ui/view/cellsh1.cxx60
1 files changed, 37 insertions, 23 deletions
diff --git a/sc/source/ui/view/cellsh1.cxx b/sc/source/ui/view/cellsh1.cxx
index f94f19ac7c48..91a1143f2695 100644
--- a/sc/source/ui/view/cellsh1.cxx
+++ b/sc/source/ui/view/cellsh1.cxx
@@ -202,10 +202,10 @@ void HandleConditionalFormat(sal_uInt32 nIndex, bool bCondFormatDlg, bool bConta
if (bCondFormatDlg || !bContainsCondFormat)
{
// Put the xml string parameter to initialize the
- // Conditional Format Dialog.
- std::shared_ptr<ScCondFormatDlgData> pDlgItem(std::make_shared<ScCondFormatDlgData>(nullptr, nIndex, false));
- pDlgItem->SetDialogType(eType);
- pTabViewShell->setScCondFormatDlgItem(pDlgItem);
+ // Conditional Format Dialog. Set the initial DialogData.
+ std::shared_ptr<ScCondFormatDlgData> pDlgData(std::make_shared<ScCondFormatDlgData>(nullptr, nIndex, false));
+ pDlgData->SetDialogType(eType);
+ pTabViewShell->setScCondFormatDlgData(pDlgData);
sal_uInt16 nId = ScCondFormatDlgWrapper::GetChildWindowId();
SfxViewFrame& rViewFrm = pTabViewShell->GetViewFrame();
@@ -1443,7 +1443,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
weld::WaitObject aWait( GetViewData().GetDialogParent() );
pTabViewShell->CopyToClip( nullptr, false, false, true );
rReq.Done();
- GetViewData().SetPasteMode( ScPasteFlags::Mode | ScPasteFlags::Border );
+
+ if (!comphelper::LibreOfficeKit::isActive() || !pTabViewShell->GetViewShell() || !pTabViewShell->GetViewShell()->IsLokReadOnlyView())
+ GetViewData().SetPasteMode( ScPasteFlags::Mode | ScPasteFlags::Border );
+
pTabViewShell->ShowCursor();
pTabViewShell->UpdateCopySourceOverlay();
}
@@ -1454,7 +1457,10 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
weld::WaitObject aWait( GetViewData().GetDialogParent() );
pTabViewShell->CutToClip();
rReq.Done();
- GetViewData().SetPasteMode( ScPasteFlags::Mode | ScPasteFlags::Border );
+
+ if (!comphelper::LibreOfficeKit::isActive() || !pTabViewShell->GetViewShell() || !pTabViewShell->GetViewShell()->IsLokReadOnlyView())
+ GetViewData().SetPasteMode( ScPasteFlags::Mode | ScPasteFlags::Border );
+
pTabViewShell->ShowCursor();
pTabViewShell->UpdateCopySourceOverlay();
}
@@ -2202,10 +2208,11 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
sal_uInt32 nIndex = sal_uInt32(-1);
bool bManaged = false;
- const std::shared_ptr<ScCondFormatDlgData>& rDlgItem(pTabViewShell->getScCondFormatDlgItem());
- if (rDlgItem)
+ // get the current DialogData
+ const std::shared_ptr<ScCondFormatDlgData>& rDlgData(pTabViewShell->getScCondFormatDlgData());
+ if (rDlgData)
{
- nIndex = rDlgItem->GetIndex();
+ nIndex = rDlgData->GetIndex();
bManaged = true;
}
@@ -2846,7 +2853,7 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
SfxAllItemSet aSet( GetPool() );
aSet.Put( SfxBoolItem( FN_PARAM_1, false ) );
- aSet.Put( SvxFontItem( aCurFont.GetFamilyType(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitch(), aCurFont.GetCharSet(), GetPool().GetWhichIDFromSlotID(SID_ATTR_CHAR_FONT) ) );
+ aSet.Put( SvxFontItem( aCurFont.GetFamilyTypeMaybeAskConfig(), aCurFont.GetFamilyName(), aCurFont.GetStyleName(), aCurFont.GetPitchMaybeAskConfig(), aCurFont.GetCharSet(), GetPool().GetWhichIDFromSlotID(SID_ATTR_CHAR_FONT) ) );
SfxViewFrame& rViewFrame = pTabViewShell->GetViewFrame();
auto xFrame = rViewFrame.GetFrame().GetFrameInterface();
VclPtr<SfxAbstractDialog> pDlg(pFact->CreateCharMapDialog(pTabViewShell->GetFrameWeld(), aSet, xFrame));
@@ -2911,10 +2918,12 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScAddress aPos(rData.GetCurX(), rData.GetCurY(), rData.GetTabNo());
ScConditionalFormatList* pList = nullptr;
- const std::shared_ptr<ScCondFormatDlgData>& rDlgItem(pTabViewShell->getScCondFormatDlgItem());
- if (rDlgItem)
+
+ // get the current DialogData
+ const std::shared_ptr<ScCondFormatDlgData>& rDlgData(pTabViewShell->getScCondFormatDlgData());
+ if (rDlgData)
{
- pList = rDlgItem->GetConditionalFormatList();
+ pList = rDlgData->GetConditionalFormatList();
}
if (!pList)
@@ -2923,11 +2932,15 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
VclPtr<AbstractScCondFormatManagerDlg> pDlg(pFact->CreateScCondFormatMgrDlg(
pTabViewShell->GetFrameWeld(), rDoc, pList));
- if (rDlgItem)
+ if (rDlgData)
+ {
pDlg->SetModified();
+ // reset the current DialogData, will be reset when needed below
+ pTabViewShell->setScCondFormatDlgData(nullptr);
+ }
pDlg->StartExecuteAsync(
- [this, pDlg, &rData, pTabViewShell, rDlgItem, aPos](sal_Int32 nRet)
+ [this, pDlg, &rData, pTabViewShell, aPos](sal_Int32 nRet)
{
std::unique_ptr<ScConditionalFormatList> pCondFormatList
= pDlg->GetConditionalFormatList();
@@ -2939,12 +2952,14 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
else if (nRet == DLG_RET_ADD)
{
// Put the xml string parameter to initialize the
- // Conditional Format Dialog. ( add new )
- pTabViewShell->setScCondFormatDlgItem(
+ // Conditional Format Dialog. ( add new ). Provide
+ // new DialogData
+ pTabViewShell->setScCondFormatDlgData(
std::make_shared<ScCondFormatDlgData>(
std::shared_ptr<ScConditionalFormatList>(
pCondFormatList.release()),
-1, true));
+
// Queue message to open Conditional Format Dialog
GetViewData().GetDispatcher().Execute(SID_OPENDLG_CONDFRMT,
SfxCallMode::ASYNCHRON);
@@ -2954,12 +2969,14 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
ScConditionalFormat* pFormat = pDlg->GetCondFormatSelected();
sal_uInt32 nIndex = pFormat ? pFormat->GetKey() : sal_uInt32(-1);
// Put the xml string parameter to initialize the
- // Conditional Format Dialog. ( edit selected conditional format )
- pTabViewShell->setScCondFormatDlgItem(
+ // Conditional Format Dialog. ( edit selected conditional format ).
+ // Provide new DialogData
+ pTabViewShell->setScCondFormatDlgData(
std::make_shared<ScCondFormatDlgData>(
std::shared_ptr<ScConditionalFormatList>(
pCondFormatList.release()),
nIndex, true));
+
// Queue message to open Conditional Format Dialog
GetViewData().GetDispatcher().Execute(SID_OPENDLG_CONDFRMT,
SfxCallMode::ASYNCHRON);
@@ -2967,9 +2984,6 @@ void ScCellShell::ExecuteEdit( SfxRequest& rReq )
else
pCondFormatList.reset();
- if (rDlgItem)
- pTabViewShell->setScCondFormatDlgItem(nullptr);
-
pDlg->disposeOnce();
});
}
@@ -3638,7 +3652,7 @@ void ScCellShell::ExecuteSubtotals(SfxRequest& rReq)
ScopedVclPtr<SfxAbstractTabDialog> pDlg;
ScSubTotalParam aSubTotalParam;
- SfxItemSetFixed<SCITEM_SUBTDATA, SCITEM_SUBTDATA> aArgSet( GetPool() );
+ SfxItemSet aArgSet(SfxItemSet::makeFixedSfxItemSet<SCITEM_SUBTDATA, SCITEM_SUBTDATA>(GetPool()));
bool bAnonymous;