diff options
author | Noel Grandin <noel@peralex.com> | 2014-08-22 15:15:17 +0200 |
---|---|---|
committer | Eike Rathke <erack@redhat.com> | 2014-09-04 09:05:34 -0500 |
commit | 8e4dc1d760d85e09bbc3f3bbb5b8be2947db1b63 (patch) | |
tree | dbb60d3d9c8f931ed98e6ac864695d1d9046cee5 /sc/source/ui/vba/vbarange.cxx | |
parent | a62a046df3302e5763b7a568ac25032bb1501d44 (diff) |
create type-safe bitfield for sc insert/delete flags
The most important part of the change is in sc/inc/global.hxx
It creates a type-safe struct that prevents the accidental interaction
between regular integer types and the flags struct.
It also provides utility methods that make combining and testing the
flags type-safe.
Change-Id: Ibc5b20058b1655df913490682b679afd1297b36d
Reviewed-on: https://gerrit.libreoffice.org/11071
Reviewed-by: Eike Rathke <erack@redhat.com>
Tested-by: Eike Rathke <erack@redhat.com>
Diffstat (limited to 'sc/source/ui/vba/vbarange.cxx')
-rw-r--r-- | sc/source/ui/vba/vbarange.cxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/sc/source/ui/vba/vbarange.cxx b/sc/source/ui/vba/vbarange.cxx index 7e33235844d4..523db877a903 100644 --- a/sc/source/ui/vba/vbarange.cxx +++ b/sc/source/ui/vba/vbarange.cxx @@ -2797,10 +2797,9 @@ uno::Any ScVbaRange::getCellRange( const uno::Reference< excel::XRange >& rxRang throw uno::RuntimeException(); } -static sal_uInt16 -getPasteFlags (sal_Int32 Paste) +static InsertDeleteFlags getPasteFlags (sal_Int32 Paste) { - sal_uInt16 nFlags = IDF_NONE; + InsertDeleteFlags nFlags = IDF_NONE; switch (Paste) { case excel::XlPasteType::xlPasteComments: nFlags = IDF_NOTE;break; @@ -2821,7 +2820,7 @@ getPasteFlags (sal_Int32 Paste) default: nFlags = IDF_ALL;break; } -return nFlags; + return nFlags; } static sal_uInt16 @@ -2875,7 +2874,7 @@ ScVbaRange::PasteSpecial( const uno::Any& Paste, const uno::Any& Operation, cons if ( Transpose.hasValue() ) Transpose >>= bTranspose; - sal_uInt16 nFlags = getPasteFlags(nPaste); + InsertDeleteFlags nFlags = getPasteFlags(nPaste); sal_uInt16 nFormulaBits = getPasteFormulaBits(nOperation); excel::implnPasteSpecial(pShell->GetModel(), nFlags,nFormulaBits,bSkipBlanks,bTranspose); } |