summaryrefslogtreecommitdiff
path: root/sc/source/ui
diff options
context:
space:
mode:
authorKohei Yoshida <kohei@libreoffice.org>2022-01-28 22:51:52 -0500
committerKohei Yoshida <kohei@libreoffice.org>2022-01-29 05:48:34 +0100
commite8032897b4a012d8e236211ee6e5ce89fb90492e (patch)
tree9f6a5add1b21ed1809046f40f40eed0c862662cc /sc/source/ui
parent3be0151bb619786b65499be413de04ad7c343cad (diff)
Standardize the flag name on bSkipEmptyCells.
And document what the flag does. This corresponds with the "Skip empty cells" check box in the Paste Special dialog. Change-Id: Ic6cf9099efbee43f737a1472a4e275839e3d2c82 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/129130 Tested-by: Jenkins Reviewed-by: Kohei Yoshida <kohei@libreoffice.org>
Diffstat (limited to 'sc/source/ui')
-rw-r--r--sc/source/ui/inc/undoblk.hxx4
-rw-r--r--sc/source/ui/inc/viewfunc.hxx30
-rw-r--r--sc/source/ui/undo/undoblk.cxx2
-rw-r--r--sc/source/ui/view/viewfun3.cxx38
4 files changed, 39 insertions, 35 deletions
diff --git a/sc/source/ui/inc/undoblk.hxx b/sc/source/ui/inc/undoblk.hxx
index 39dba0afa20d..a0de06cb698d 100644
--- a/sc/source/ui/inc/undoblk.hxx
+++ b/sc/source/ui/inc/undoblk.hxx
@@ -163,14 +163,14 @@ private:
struct ScUndoPasteOptions
{
ScPasteFunc nFunction;
- bool bSkipEmpty;
+ bool bSkipEmptyCells;
bool bTranspose;
bool bAsLink;
InsCellCmd eMoveMode;
ScUndoPasteOptions() :
nFunction( ScPasteFunc::NONE ),
- bSkipEmpty( false ),
+ bSkipEmptyCells( false ),
bTranspose( false ),
bAsLink( false ),
eMoveMode( INS_NONE )
diff --git a/sc/source/ui/inc/viewfunc.hxx b/sc/source/ui/inc/viewfunc.hxx
index ec037cc18e71..80b9b090bcad 100644
--- a/sc/source/ui/inc/viewfunc.hxx
+++ b/sc/source/ui/inc/viewfunc.hxx
@@ -116,12 +116,14 @@ public:
bool CopyToClipMultiRange( const ScDocument* pClipDoc, const ScRangeList& rRanges, bool bCut,
bool bApi, bool bIncludeObjects );
rtl::Reference<ScTransferObj> CopyToTransferable();
- SC_DLLPUBLIC bool PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
- ScPasteFunc nFunction = ScPasteFunc::NONE, bool bSkipEmpty = false,
- bool bTranspose = false, bool bAsLink = false,
- InsCellCmd eMoveMode = INS_NONE,
- InsertDeleteFlags nUndoExtraFlags = InsertDeleteFlags::NONE,
- bool bAllowDialogs = false );
+
+ SC_DLLPUBLIC bool PasteFromClip(
+ InsertDeleteFlags nFlags, ScDocument* pClipDoc,
+ ScPasteFunc nFunction = ScPasteFunc::NONE, bool bSkipEmptyCells = false,
+ bool bTranspose = false, bool bAsLink = false,
+ InsCellCmd eMoveMode = INS_NONE,
+ InsertDeleteFlags nUndoExtraFlags = InsertDeleteFlags::NONE,
+ bool bAllowDialogs = false );
void FillTab( InsertDeleteFlags nFlags, ScPasteFunc nFunction, bool bSkipEmpty, bool bAsLink );
@@ -352,14 +354,16 @@ private:
void PasteRTF( SCCOL nCol, SCROW nStartRow,
const css::uno::Reference< css::datatransfer::XTransferable >& rxTransferable );
- bool PasteMultiRangesFromClip(InsertDeleteFlags nFlags, ScDocument* pClipDoc,
- ScPasteFunc nFunction, bool bSkipEmpty, bool bIncludeFiltered,
- bool bTranspose, bool bAsLink, bool bAllowDialogs,
- InsCellCmd eMoveMode, InsertDeleteFlags nUndoFlags);
+ bool PasteMultiRangesFromClip(
+ InsertDeleteFlags nFlags, ScDocument* pClipDoc,
+ ScPasteFunc nFunction, bool bSkipEmptyCells, bool bIncludeFiltered,
+ bool bTranspose, bool bAsLink, bool bAllowDialogs,
+ InsCellCmd eMoveMode, InsertDeleteFlags nUndoFlags );
- bool PasteFromClipToMultiRanges( InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScPasteFunc nFunction,
- bool bSkipEmpty, bool bTranspose, bool bAsLink, bool bAllowDialogs,
- InsCellCmd eMoveMode, InsertDeleteFlags nUndoFlags );
+ bool PasteFromClipToMultiRanges(
+ InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScPasteFunc nFunction,
+ bool bSkipEmptyCells, bool bTranspose, bool bAsLink, bool bAllowDialogs,
+ InsCellCmd eMoveMode, InsertDeleteFlags nUndoFlags );
void PostPasteFromClip(const ScRangeList& rPasteRanges, const ScMarkData& rMark);
diff --git a/sc/source/ui/undo/undoblk.cxx b/sc/source/ui/undo/undoblk.cxx
index 26841c009eb2..be93e37bd35f 100644
--- a/sc/source/ui/undo/undoblk.cxx
+++ b/sc/source/ui/undo/undoblk.cxx
@@ -1177,7 +1177,7 @@ void ScUndoPaste::Repeat(SfxRepeatTarget& rTarget)
if (pOwnClip)
{
pViewSh->PasteFromClip( nFlags, pOwnClip->GetDocument(),
- aPasteOptions.nFunction, aPasteOptions.bSkipEmpty, aPasteOptions.bTranspose,
+ aPasteOptions.nFunction, aPasteOptions.bSkipEmptyCells, aPasteOptions.bTranspose,
aPasteOptions.bAsLink, aPasteOptions.eMoveMode, InsertDeleteFlags::NONE,
true ); // allow warning dialog
}
diff --git a/sc/source/ui/view/viewfun3.cxx b/sc/source/ui/view/viewfun3.cxx
index 5397d2dec352..679557d020b4 100644
--- a/sc/source/ui/view/viewfun3.cxx
+++ b/sc/source/ui/view/viewfun3.cxx
@@ -869,7 +869,7 @@ bool checkDestRangeForOverwrite(const ScRangeList& rDestRanges, const ScDocument
}
bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
- ScPasteFunc nFunction, bool bSkipEmpty,
+ ScPasteFunc nFunction, bool bSkipEmptyCells,
bool bTranspose, bool bAsLink,
InsCellCmd eMoveMode, InsertDeleteFlags nUndoExtraFlags,
bool bAllowDialogs )
@@ -900,7 +900,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
if (rClipParam.isMultiRange())
{
// Source data is multi-range.
- return PasteMultiRangesFromClip(nFlags, pClipDoc, nFunction, bSkipEmpty, false, bTranspose,
+ return PasteMultiRangesFromClip(nFlags, pClipDoc, nFunction, bSkipEmptyCells, false, bTranspose,
bAsLink, bAllowDialogs, eMoveMode, nUndoFlags);
}
@@ -909,7 +909,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
{
// Source data is single-range but destination is multi-range.
return PasteFromClipToMultiRanges(
- nFlags, pClipDoc, nFunction, bSkipEmpty, bTranspose, bAsLink, bAllowDialogs,
+ nFlags, pClipDoc, nFunction, bSkipEmptyCells, bTranspose, bAsLink, bAllowDialogs,
eMoveMode, nUndoFlags);
}
@@ -1281,7 +1281,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
ScDocumentUniquePtr pMixDoc;
if (nFunction != ScPasteFunc::NONE)
{
- bSkipEmpty = false;
+ bSkipEmptyCells = false;
if ( nFlags & InsertDeleteFlags::CONTENTS )
{
pMixDoc.reset(new ScDocument( SCDOCMODE_UNDO ));
@@ -1306,7 +1306,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
// copy normally (original range)
rDoc.CopyFromClip( aUserRange, aFilteredMark, nNoObjFlags,
pRefUndoDoc.get(), pClipDoc, true, false, bIncludeFiltered,
- bSkipEmpty, (bMarkIsFiltered ? &aRangeList : nullptr) );
+ bSkipEmptyCells, (bMarkIsFiltered ? &aRangeList : nullptr) );
// adapt refs manually in case of transpose
if ( bTranspose && bCutMode && (nFlags & InsertDeleteFlags::CONTENTS) )
@@ -1316,7 +1316,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
{
// copy with bAsLink=TRUE
rDoc.CopyFromClip( aUserRange, aFilteredMark, nNoObjFlags, pRefUndoDoc.get(), pClipDoc,
- true, true, bIncludeFiltered, bSkipEmpty );
+ true, true, bIncludeFiltered, bSkipEmptyCells );
}
else
{
@@ -1333,7 +1333,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
if ( pMixDoc ) // calculate with original data?
{
- rDoc.MixDocument( aUserRange, nFunction, bSkipEmpty, *pMixDoc );
+ rDoc.MixDocument( aUserRange, nFunction, bSkipEmptyCells, *pMixDoc );
}
pMixDoc.reset();
@@ -1405,7 +1405,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
ScUndoPasteOptions aOptions; // store options for repeat
aOptions.nFunction = nFunction;
- aOptions.bSkipEmpty = bSkipEmpty;
+ aOptions.bSkipEmptyCells = bSkipEmptyCells;
aOptions.bTranspose = bTranspose;
aOptions.bAsLink = bAsLink;
aOptions.eMoveMode = eMoveMode;
@@ -1464,7 +1464,7 @@ bool ScViewFunc::PasteFromClip( InsertDeleteFlags nFlags, ScDocument* pClipDoc,
}
bool ScViewFunc::PasteMultiRangesFromClip(InsertDeleteFlags nFlags, ScDocument* pClipDoc,
- ScPasteFunc nFunction, bool bSkipEmpty,
+ ScPasteFunc nFunction, bool bSkipEmptyCells,
bool bIncludeFiltered, bool bTranspose, bool bAsLink,
bool bAllowDialogs, InsCellCmd eMoveMode,
InsertDeleteFlags nUndoFlags)
@@ -1554,7 +1554,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(InsertDeleteFlags nFlags, ScDocument*
}
ScDocumentUniquePtr pMixDoc;
- if ( bSkipEmpty || nFunction != ScPasteFunc::NONE)
+ if ( bSkipEmptyCells || nFunction != ScPasteFunc::NONE)
{
if ( nFlags & InsertDeleteFlags::CONTENTS )
{
@@ -1578,10 +1578,10 @@ bool ScViewFunc::PasteMultiRangesFromClip(InsertDeleteFlags nFlags, ScDocument*
if (bAsLink && bTranspose)
nCopyFlags |= InsertDeleteFlags::FORMULA;
rDoc.CopyMultiRangeFromClip(rCurPos, aMark, nCopyFlags, pClipDoc, true, bAsLink && !bTranspose,
- bIncludeFiltered, bSkipEmpty);
+ bIncludeFiltered, bSkipEmptyCells);
if (pMixDoc)
- rDoc.MixDocument(aMarkedRange, nFunction, bSkipEmpty, *pMixDoc);
+ rDoc.MixDocument(aMarkedRange, nFunction, bSkipEmptyCells, *pMixDoc);
AdjustBlockHeight(); // update row heights before pasting objects
@@ -1611,7 +1611,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(InsertDeleteFlags nFlags, ScDocument*
ScUndoPasteOptions aOptions; // store options for repeat
aOptions.nFunction = nFunction;
- aOptions.bSkipEmpty = bSkipEmpty;
+ aOptions.bSkipEmptyCells = bSkipEmptyCells;
aOptions.bTranspose = bTranspose;
aOptions.bAsLink = bAsLink;
aOptions.eMoveMode = eMoveMode;
@@ -1634,7 +1634,7 @@ bool ScViewFunc::PasteMultiRangesFromClip(InsertDeleteFlags nFlags, ScDocument*
bool ScViewFunc::PasteFromClipToMultiRanges(
InsertDeleteFlags nFlags, ScDocument* pClipDoc, ScPasteFunc nFunction,
- bool bSkipEmpty, bool bTranspose, bool bAsLink, bool bAllowDialogs,
+ bool bSkipEmptyCells, bool bTranspose, bool bAsLink, bool bAllowDialogs,
InsCellCmd eMoveMode, InsertDeleteFlags nUndoFlags )
{
if (bTranspose)
@@ -1714,7 +1714,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
}
ScDocumentUniquePtr pMixDoc;
- if (bSkipEmpty || nFunction != ScPasteFunc::NONE)
+ if (bSkipEmptyCells || nFunction != ScPasteFunc::NONE)
{
if (nFlags & InsertDeleteFlags::CONTENTS)
{
@@ -1738,13 +1738,13 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
{
rDoc.CopyFromClip(
aRanges[i], aMark, (nFlags & ~InsertDeleteFlags::OBJECTS), nullptr, pClipDoc,
- false, false, true, bSkipEmpty);
+ false, false, true, bSkipEmptyCells);
}
if (pMixDoc)
{
for (size_t i = 0, n = aRanges.size(); i < n; ++i)
- rDoc.MixDocument(aRanges[i], nFunction, bSkipEmpty, *pMixDoc);
+ rDoc.MixDocument(aRanges[i], nFunction, bSkipEmptyCells, *pMixDoc);
}
AdjustBlockHeight(); // update row heights before pasting objects
@@ -1756,7 +1756,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
{
rDoc.CopyFromClip(
aRanges[i], aMark, InsertDeleteFlags::OBJECTS, nullptr, pClipDoc,
- false, false, true, bSkipEmpty);
+ false, false, true, bSkipEmptyCells);
}
}
@@ -1777,7 +1777,7 @@ bool ScViewFunc::PasteFromClipToMultiRanges(
ScUndoPasteOptions aOptions; // store options for repeat
aOptions.nFunction = nFunction;
- aOptions.bSkipEmpty = bSkipEmpty;
+ aOptions.bSkipEmptyCells = bSkipEmptyCells;
aOptions.bTranspose = bTranspose;
aOptions.bAsLink = bAsLink;
aOptions.eMoveMode = eMoveMode;