remove unused enum value SplitWindowItemFlags::Invisible

Change-Id: I4d63601ca3658b4ffd9eaf1c13d4c17503640aa0
Reviewed-on: https://gerrit.libreoffice.org/64041
Tested-by: Jenkins
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
This commit is contained in:
Noel Grandin
2018-11-23 15:18:50 +02:00
parent 361fa01df3
commit 37b3502b5c
3 changed files with 34 additions and 70 deletions

View File

@@ -1070,8 +1070,6 @@ include/vcl/ptrstyle.hxx:92
enum PointerStyle Chart enum PointerStyle Chart
include/vcl/salctype.hxx:41 include/vcl/salctype.hxx:41
enum ConvertDataFormat PDF enum ConvertDataFormat PDF
include/vcl/splitwin.hxx:37
enum SplitWindowItemFlags Invisible
include/vcl/vclenum.hxx:37 include/vcl/vclenum.hxx:37
enum MenuItemBits POPUPSELECT enum MenuItemBits POPUPSELECT
include/vcl/vclenum.hxx:143 include/vcl/vclenum.hxx:143

View File

@@ -34,11 +34,10 @@ enum class SplitWindowItemFlags
RelativeSize = 0x0002, RelativeSize = 0x0002,
PercentSize = 0x0004, PercentSize = 0x0004,
ColSet = 0x0008, ColSet = 0x0008,
Invisible = 0x0010,
}; };
namespace o3tl namespace o3tl
{ {
template<> struct typed_flags<SplitWindowItemFlags> : is_typed_flags<SplitWindowItemFlags, 0x1f> {}; template<> struct typed_flags<SplitWindowItemFlags> : is_typed_flags<SplitWindowItemFlags, 0x0f> {};
} }
#define SPLITWINDOW_APPEND (sal_uInt16(0xFFFF)) #define SPLITWINDOW_APPEND (sal_uInt16(0xFFFF))

View File

@@ -401,7 +401,6 @@ static void ImplCalcSet( ImplSplitSet* pSet,
sal_uInt16 nMins; sal_uInt16 nMins;
sal_uInt16 nCalcItems; sal_uInt16 nCalcItems;
size_t nItems = pSet->mvItems.size(); size_t nItems = pSet->mvItems.size();
sal_uInt16 nVisItems;
sal_uInt16 nAbsItems; sal_uInt16 nAbsItems;
long nCalcSize; long nCalcSize;
long nPos; long nPos;
@@ -409,20 +408,12 @@ static void ImplCalcSet( ImplSplitSet* pSet,
std::vector< ImplSplitItem >& rItems = pSet->mvItems; std::vector< ImplSplitItem >& rItems = pSet->mvItems;
bool bEmpty; bool bEmpty;
// get number of visible items
nVisItems = 0;
for ( auto& rItem : rItems )
{
if ( !(rItem.mnBits & SplitWindowItemFlags::Invisible) )
nVisItems++;
}
// calculate sizes // calculate sizes
if ( bRows ) if ( bRows )
nCalcSize = nSetHeight; nCalcSize = nSetHeight;
else else
nCalcSize = nSetWidth; nCalcSize = nSetWidth;
nCalcSize -= (nVisItems-1)*pSet->mnSplitSize; nCalcSize -= (rItems.size()-1)*pSet->mnSplitSize;
if ( pSet->mbCalcPix || (pSet->mnLastSize != nCalcSize) ) if ( pSet->mbCalcPix || (pSet->mnLastSize != nCalcSize) )
{ {
long nPercentFactor = 10; long nPercentFactor = 10;
@@ -433,15 +424,12 @@ static void ImplCalcSet( ImplSplitSet* pSet,
long nCurSize = 0; long nCurSize = 0;
for ( auto& rItem : rItems ) for ( auto& rItem : rItems )
{ {
if ( !(rItem.mnBits & SplitWindowItemFlags::Invisible) ) if ( rItem.mnBits & SplitWindowItemFlags::RelativeSize )
{ nRelCount += rItem.mnSize;
if ( rItem.mnBits & SplitWindowItemFlags::RelativeSize ) else if ( rItem.mnBits & SplitWindowItemFlags::PercentSize )
nRelCount += rItem.mnSize; nPercent += rItem.mnSize;
else if ( rItem.mnBits & SplitWindowItemFlags::PercentSize ) else
nPercent += rItem.mnSize; nAbsSize += rItem.mnSize;
else
nAbsSize += rItem.mnSize;
}
} }
// map relative values to percentages (percentage here one tenth of a procent) // map relative values to percentages (percentage here one tenth of a procent)
nPercent *= nPercentFactor; nPercent *= nPercentFactor;
@@ -466,9 +454,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
long nSizeDelta = nCalcSize-nAbsSize; long nSizeDelta = nCalcSize-nAbsSize;
for ( auto& rItem : rItems ) for ( auto& rItem : rItems )
{ {
if ( rItem.mnBits & SplitWindowItemFlags::Invisible ) if ( rItem.mnBits & SplitWindowItemFlags::RelativeSize )
rItem.mnPixSize = 0;
else if ( rItem.mnBits & SplitWindowItemFlags::RelativeSize )
{ {
if ( nSizeDelta <= 0 ) if ( nSizeDelta <= 0 )
rItem.mnPixSize = 0; rItem.mnPixSize = 0;
@@ -500,13 +486,10 @@ static void ImplCalcSet( ImplSplitSet* pSet,
// first resize absolute items relative // first resize absolute items relative
for ( auto& rItem : rItems ) for ( auto& rItem : rItems )
{ {
if ( !(rItem.mnBits & SplitWindowItemFlags::Invisible) ) if ( !(rItem.mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) )
{ {
if ( !(rItem.mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) ) nAbsItems++;
{ nSizeWinSize += rItem.mnPixSize;
nAbsItems++;
nSizeWinSize += rItem.mnPixSize;
}
} }
} }
// do not compensate rounding errors here // do not compensate rounding errors here
@@ -516,13 +499,10 @@ static void ImplCalcSet( ImplSplitSet* pSet,
for ( auto& rItem : rItems ) for ( auto& rItem : rItems )
{ {
if ( !(rItem.mnBits & SplitWindowItemFlags::Invisible) ) if ( !(rItem.mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) )
{ {
if ( !(rItem.mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) ) rItem.mnPixSize += (nSizeDelta*rItem.mnPixSize)/nSizeWinSize;
{ nNewSizeWinSize += rItem.mnPixSize;
rItem.mnPixSize += (nSizeDelta*rItem.mnPixSize)/nSizeWinSize;
nNewSizeWinSize += rItem.mnPixSize;
}
} }
} }
@@ -546,17 +526,14 @@ static void ImplCalcSet( ImplSplitSet* pSet,
rItem.mbSubSize = true; rItem.mbSubSize = true;
else else
{ {
if ( !(rItem.mnBits & SplitWindowItemFlags::Invisible) ) if ( (nSizeDelta > 0) || rItem.mnPixSize )
{ {
if ( (nSizeDelta > 0) || rItem.mnPixSize ) if ( j >= 1 )
rItem.mbSubSize = true;
else
{ {
if ( j >= 1 ) if ( (j == 0) && (rItem.mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) )
rItem.mbSubSize = true; rItem.mbSubSize = true;
else
{
if ( (j == 0) && (rItem.mnBits & (SplitWindowItemFlags::RelativeSize | SplitWindowItemFlags::PercentSize)) )
rItem.mbSubSize = true;
}
} }
} }
} }
@@ -574,9 +551,7 @@ static void ImplCalcSet( ImplSplitSet* pSet,
nMins = 0; nMins = 0;
for ( auto& rItem : rItems ) for ( auto& rItem : rItems )
{ {
if ( rItem.mnBits & SplitWindowItemFlags::Invisible ) if ( rItem.mbSubSize )
nMins++;
else if ( rItem.mbSubSize )
{ {
long* pSize = &(rItem.mnPixSize); long* pSize = &(rItem.mnPixSize);
long nTempErr; long nTempErr;
@@ -644,22 +619,17 @@ static void ImplCalcSet( ImplSplitSet* pSet,
rItems[i].mnOldWidth = rItems[i].mnWidth; rItems[i].mnOldWidth = rItems[i].mnWidth;
rItems[i].mnOldHeight = rItems[i].mnHeight; rItems[i].mnOldHeight = rItems[i].mnHeight;
if ( rItems[i].mnBits & SplitWindowItemFlags::Invisible ) bEmpty = false;
bEmpty = true; if ( bDown )
{
if ( nPos+rItems[i].mnPixSize > nMaxPos )
bEmpty = true;
}
else else
{ {
bEmpty = false; nPos -= rItems[i].mnPixSize;
if ( bDown ) if ( nPos < nMaxPos )
{ bEmpty = true;
if ( nPos+rItems[i].mnPixSize > nMaxPos )
bEmpty = true;
}
else
{
nPos -= rItems[i].mnPixSize;
if ( nPos < nMaxPos )
bEmpty = true;
}
} }
if ( bEmpty ) if ( bEmpty )
@@ -705,13 +675,10 @@ static void ImplCalcSet( ImplSplitSet* pSet,
} }
} }
if ( !(rItems[i].mnBits & SplitWindowItemFlags::Invisible) ) if ( !bDown )
{ nPos -= pSet->mnSplitSize;
if ( !bDown ) else
nPos -= pSet->mnSplitSize; nPos += rItems[i].mnPixSize+pSet->mnSplitSize;
else
nPos += rItems[i].mnPixSize+pSet->mnSplitSize;
}
} }
// calculate Sub-Set's // calculate Sub-Set's