summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noel.grandin@collabora.co.uk>2020-02-07 14:02:01 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2020-02-07 18:10:35 +0100
commitc05680bd27f0f9fc9d5371f4ef97fd45184de1c6 (patch)
tree6f4b1905e163deef0c8c3e0d1179f472a91e2091
parentaffe9c8384475fc85027703332bc0f1b36eaa0a6 (diff)
rename GetBaseOfstForFly->GetBaseOffsetForFly
Change-Id: Ieeeaa53d916e192e7219d7d3d405584a22249e7f Reviewed-on: https://gerrit.libreoffice.org/c/core/+/88181 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--sw/source/core/frmedt/fews.cxx2
-rw-r--r--sw/source/core/inc/txtfrm.hxx2
-rw-r--r--sw/source/core/layout/frmtool.cxx8
-rw-r--r--sw/source/core/layout/ssfrm.cxx2
-rw-r--r--sw/source/core/objectpositioning/anchoredobjectposition.cxx4
-rw-r--r--vcl/qa/cppunit/ScanlineToolsTest.cxx42
6 files changed, 9 insertions, 51 deletions
diff --git a/sw/source/core/frmedt/fews.cxx b/sw/source/core/frmedt/fews.cxx
index e5edce6ba7f0..b608d2e8e4a8 100644
--- a/sw/source/core/frmedt/fews.cxx
+++ b/sw/source/core/frmedt/fews.cxx
@@ -1124,7 +1124,7 @@ void SwFEShell::CalcBoundRect( SwRect& _orRect,
}
const SwTwips nBaseOfstForFly = ( pFrame->IsTextFrame() && pFly ) ?
- static_cast<const SwTextFrame*>(pFrame)->GetBaseOfstForFly( !bWrapThrough ) :
+ static_cast<const SwTextFrame*>(pFrame)->GetBaseOffsetForFly( !bWrapThrough ) :
0;
if( aRectFnSet.IsVert() || aRectFnSet.IsVertL2R() )
{
diff --git a/sw/source/core/inc/txtfrm.hxx b/sw/source/core/inc/txtfrm.hxx
index f76c3b41339f..b234e242ba59 100644
--- a/sw/source/core/inc/txtfrm.hxx
+++ b/sw/source/core/inc/txtfrm.hxx
@@ -748,7 +748,7 @@ public:
mbFollowFormatAllowed = false;
}
- SwTwips GetBaseOfstForFly( bool bIgnoreFlysAnchoredAtThisFrame ) const
+ SwTwips GetBaseOffsetForFly( bool bIgnoreFlysAnchoredAtThisFrame ) const
{
return ( bIgnoreFlysAnchoredAtThisFrame ?
mnFlyAnchorOfst :
diff --git a/sw/source/core/layout/frmtool.cxx b/sw/source/core/layout/frmtool.cxx
index b8798af8a835..975bf3f9ead4 100644
--- a/sw/source/core/layout/frmtool.cxx
+++ b/sw/source/core/layout/frmtool.cxx
@@ -93,8 +93,8 @@ SwFrameNotify::SwFrameNotify( SwFrame *pF ) :
{
if ( pF->IsTextFrame() )
{
- mnFlyAnchorOfst = static_cast<SwTextFrame*>(pF)->GetBaseOfstForFly( true );
- mnFlyAnchorOfstNoWrap = static_cast<SwTextFrame*>(pF)->GetBaseOfstForFly( false );
+ mnFlyAnchorOfst = static_cast<SwTextFrame*>(pF)->GetBaseOffsetForFly( true );
+ mnFlyAnchorOfstNoWrap = static_cast<SwTextFrame*>(pF)->GetBaseOffsetForFly( false );
}
else
{
@@ -114,8 +114,8 @@ SwFrameNotify::~SwFrameNotify() COVERITY_NOEXCEPT_FALSE
const bool bChgHeight =
aRectFnSet.GetHeight(maFrame)!=aRectFnSet.GetHeight(mpFrame->getFrameArea());
const bool bChgFlyBasePos = mpFrame->IsTextFrame() &&
- ( ( mnFlyAnchorOfst != static_cast<SwTextFrame*>(mpFrame)->GetBaseOfstForFly( true ) ) ||
- ( mnFlyAnchorOfstNoWrap != static_cast<SwTextFrame*>(mpFrame)->GetBaseOfstForFly( false ) ) );
+ ( ( mnFlyAnchorOfst != static_cast<SwTextFrame*>(mpFrame)->GetBaseOffsetForFly( true ) ) ||
+ ( mnFlyAnchorOfstNoWrap != static_cast<SwTextFrame*>(mpFrame)->GetBaseOffsetForFly( false ) ) );
if ( mpFrame->IsFlowFrame() && !mpFrame->IsInFootnote() )
{
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index 14193b09d260..1de1f32aa394 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -296,7 +296,7 @@ Point SwFrame::GetFrameAnchorPos( bool bIgnoreFlysAnchoredAtThisFrame ) const
if ( IsTextFrame() )
{
SwTwips nBaseOfstForFly =
- static_cast<const SwTextFrame*>(this)->GetBaseOfstForFly( bIgnoreFlysAnchoredAtThisFrame );
+ static_cast<const SwTextFrame*>(this)->GetBaseOffsetForFly( bIgnoreFlysAnchoredAtThisFrame );
if ( IsVertical() )
aAnchor.AdjustY(nBaseOfstForFly );
else
diff --git a/sw/source/core/objectpositioning/anchoredobjectposition.cxx b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
index 48a0e27c881c..5ac2514bb6d0 100644
--- a/sw/source/core/objectpositioning/anchoredobjectposition.cxx
+++ b/sw/source/core/objectpositioning/anchoredobjectposition.cxx
@@ -611,7 +611,7 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri
if ( _rHoriOrientFrame.IsTextFrame() )
{
// consider movement of text frame left
- nOffset += static_cast<const SwTextFrame&>(_rHoriOrientFrame).GetBaseOfstForFly( !_bObjWrapThrough );
+ nOffset += static_cast<const SwTextFrame&>(_rHoriOrientFrame).GetBaseOffsetForFly( !_bObjWrapThrough );
}
else if ( _rHoriOrientFrame.IsPageFrame() && aRectFnSet.IsVert() )
{
@@ -733,7 +733,7 @@ void SwAnchoredObjectPosition::GetHoriAlignmentValues( const SwFrame& _rHoriOri
bool bIgnoreFlysAnchoredAtFrame = !bWrapThrough;
nOffset = _rHoriOrientFrame.IsTextFrame() ?
- static_cast<const SwTextFrame&>(_rHoriOrientFrame).GetBaseOfstForFly( bIgnoreFlysAnchoredAtFrame ) :
+ static_cast<const SwTextFrame&>(_rHoriOrientFrame).GetBaseOffsetForFly( bIgnoreFlysAnchoredAtFrame ) :
0;
break;
}
diff --git a/vcl/qa/cppunit/ScanlineToolsTest.cxx b/vcl/qa/cppunit/ScanlineToolsTest.cxx
index bf053d3bc890..9a0ad213e7cc 100644
--- a/vcl/qa/cppunit/ScanlineToolsTest.cxx
+++ b/vcl/qa/cppunit/ScanlineToolsTest.cxx
@@ -20,14 +20,12 @@ class ScanlineToolsTest : public CppUnit::TestFixture
void ScanlineTransformer_32_ARGB();
void ScanlineTransformer_24_BGR();
void ScanlineTransformer_8bit_Palette();
- void ScanlineTransformer_4bit_Palette();
void ScanlineTransformer_1bit_Palette();
CPPUNIT_TEST_SUITE(ScanlineToolsTest);
CPPUNIT_TEST(ScanlineTransformer_32_ARGB);
CPPUNIT_TEST(ScanlineTransformer_24_BGR);
CPPUNIT_TEST(ScanlineTransformer_8bit_Palette);
- CPPUNIT_TEST(ScanlineTransformer_4bit_Palette);
CPPUNIT_TEST(ScanlineTransformer_1bit_Palette);
CPPUNIT_TEST_SUITE_END();
};
@@ -126,46 +124,6 @@ void ScanlineToolsTest::ScanlineTransformer_8bit_Palette()
}
}
-void ScanlineToolsTest::ScanlineTransformer_4bit_Palette()
-{
- std::vector<Color> aColors{
- Color(10, 250, 120), Color(30, 230, 110), Color(50, 210, 100),
- Color(70, 190, 90), Color(90, 170, 80), Color(110, 150, 70),
- };
-
- BitmapPalette aPalette(16);
- for (size_t i = 0; i < aColors.size(); ++i)
- {
- aPalette[i] = aColors[i];
- }
-
- std::unique_ptr<vcl::bitmap::ScanlineTransformer> pScanlineTransformer
- = vcl::bitmap::getScanlineTransformer(4, aPalette);
-
- std::vector<sal_uInt8> aScanLine(3, 0); // 6 * 0.5 BytesPerPixel
- pScanlineTransformer->startLine(aScanLine.data());
-
- for (Color const& aColor : aColors)
- {
- pScanlineTransformer->writePixel(aColor);
- }
-
- std::vector<sal_uInt8> aExpectedBytes{ 0x01, 0x23, 0x45 };
-
- for (size_t i = 0; i < aScanLine.size(); ++i)
- {
- CPPUNIT_ASSERT_EQUAL(int(aExpectedBytes[i]), int(aScanLine[i]));
- }
-
- pScanlineTransformer->startLine(aScanLine.data());
-
- for (size_t i = 0; i < aColors.size(); ++i)
- {
- Color aColor = pScanlineTransformer->readPixel();
- CPPUNIT_ASSERT_EQUAL(aColors[i], aColor);
- }
-}
-
void ScanlineToolsTest::ScanlineTransformer_1bit_Palette()
{
std::vector<Color> aColors{