Date: prev next · Thread: first prev next last
2012 Archives by date, by thread · List index


Hello list,

Since I went a bit beyond unusedcode.easy, I prefer to ask review on this one :)

Marc-André LAVERDIÈRE
"Perseverance must finish its work so that you may be mature and complete,
not lacking anything." -James 1:4
http://asimplediscipleslife.blogspot.com/
mlaverd.theunixplace.com
From 4732c77171a1aa288761b8280d10491f60fa233d Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Marc-Andr=C3=A9=20Laverdi=C3=A8re-Papineau?=
 <marc-andre@atc.tcs.com>
Date: Sun, 15 Jan 2012 18:24:58 -0500
Subject: [PATCH] removed some dead code

---
 filter/source/svg/svgexport.cxx          |   50 +-----------------------------
 filter/source/svg/svgfilter.hxx          |    6 ---
 filter/source/svg/svgwriter.cxx          |    8 -----
 tools/inc/tools/color.hxx                |    1 -
 tools/inc/tools/datetime.hxx             |    1 -
 tools/source/datetime/datetime.cxx       |   17 ----------
 tools/source/generic/color.cxx           |   15 ---------
 unusedcode.easy                          |    8 -----
 writerperfect/source/filter/PageSpan.cxx |   16 ---------
 writerperfect/source/filter/PageSpan.hxx |    2 -
 10 files changed, 1 insertions(+), 123 deletions(-)

diff --git a/filter/source/svg/svgexport.cxx b/filter/source/svg/svgexport.cxx
index 6149ddf..ea63fa1 100644
--- a/filter/source/svg/svgexport.cxx
+++ b/filter/source/svg/svgexport.cxx
@@ -382,20 +382,6 @@ sal_Bool SVGExport::IsUseNativeTextDecoration() const
 
 // -----------------------------------------------------------------------------
 
-::rtl::OUString SVGExport::GetGlyphPlacement() const
-{
-    ::rtl::OUString aRet;
-
-    if( mrFilterData.getLength() > 3 )
-        mrFilterData[ 3 ].Value >>= aRet;
-    else
-        aRet = B2UCONST( "abs" );
-
-    return aRet;
-}
-
-// -----------------------------------------------------------------------------
-
 sal_Bool SVGExport::IsUseOpacity() const
 {
     sal_Bool bRet = !IsUseTinyProfile();
@@ -408,43 +394,9 @@ sal_Bool SVGExport::IsUseOpacity() const
 
 // -----------------------------------------------------------------------------
 
-sal_Bool SVGExport::IsUseGradient() const
-{
-    sal_Bool bRet = !IsUseTinyProfile();
-
-    if( !bRet && ( mrFilterData.getLength() > 5 ) )
-        mrFilterData[ 5 ].Value >>= bRet;
-
-    return bRet;
-}
-
-// -----------------------------------------------------------------------------
-
-void SVGExport::pushClip( const ::basegfx::B2DPolyPolygon& rPolyPoly )
-{
-    maClipList.push_front( ::basegfx::tools::correctOrientations( rPolyPoly ) );
-}
-
-// -----------------------------------------------------------------------------
-
-void SVGExport::popClip()
-{
-    if( !maClipList.empty() )
-        maClipList.pop_front();
-}
-
-// -----------------------------------------------------------------------------
-
-sal_Bool SVGExport::hasClip() const
-{
-    return( !maClipList.empty() );
-}
-
-// -----------------------------------------------------------------------------
-
 const ::basegfx::B2DPolyPolygon* SVGExport::getCurClip() const
 {
-    return( maClipList.empty() ? NULL : &( *maClipList.begin() ) );
+    return NULL;
 }
 
 // ------------------------
diff --git a/filter/source/svg/svgfilter.hxx b/filter/source/svg/svgfilter.hxx
index 21c1238..d218e06 100644
--- a/filter/source/svg/svgfilter.hxx
+++ b/filter/source/svg/svgfilter.hxx
@@ -141,13 +141,8 @@ public:
     sal_Bool IsUseTinyProfile() const;
     sal_Bool IsEmbedFonts() const;
     sal_Bool IsUseNativeTextDecoration() const;
-    ::rtl::OUString GetGlyphPlacement() const;
     sal_Bool IsUseOpacity() const;
-    sal_Bool IsUseGradient() const;
 
-    void  pushClip( const ::basegfx::B2DPolyPolygon& rPolyPoly );
-    void  popClip();
-    sal_Bool  hasClip() const;
     const ::basegfx::B2DPolyPolygon* getCurClip() const;
 
 protected:
@@ -161,7 +156,6 @@ protected:
 private:
 
     const Sequence< PropertyValue >&    mrFilterData;
-    B2DPolyPolygonList                  maClipList;
 
     SVGExport();
 };
diff --git a/filter/source/svg/svgwriter.cxx b/filter/source/svg/svgwriter.cxx
index 9f70046..0639e5d 100644
--- a/filter/source/svg/svgwriter.cxx
+++ b/filter/source/svg/svgwriter.cxx
@@ -640,14 +640,6 @@ void SVGActionWriter::ImplWritePolyPolygon( const PolyPolygon& rPolyPoly, 
sal_Bo
     else
         aPolyPoly = rPolyPoly;
 
-    if( mrExport.hasClip() )
-    {
-        const ::basegfx::B2DPolyPolygon aB2DPolyPoly( ::basegfx::tools::correctOrientations( 
aPolyPoly.getB2DPolyPolygon() ) );
-
-        aPolyPoly = PolyPolygon( ::basegfx::tools::clipPolyPolygonOnPolyPolygon(
-                        *mrExport.getCurClip(), aB2DPolyPoly, sal_False, sal_False ) );
-    }
-
     // add path data attribute
     mrExport.AddAttribute( XML_NAMESPACE_NONE, aXMLAttrD, GetPathString( aPolyPoly, bLineOnly ) );
 
diff --git a/tools/inc/tools/color.hxx b/tools/inc/tools/color.hxx
index ba9d7df..a9fe589 100644
--- a/tools/inc/tools/color.hxx
+++ b/tools/inc/tools/color.hxx
@@ -156,7 +156,6 @@ public:
     void                IncreaseLuminance( sal_uInt8 cLumInc );
     void                DecreaseLuminance( sal_uInt8 cLumDec );
 
-    void                IncreaseContrast( sal_uInt8 cContInc );
     void                DecreaseContrast( sal_uInt8 cContDec );
 
     void                Invert();
diff --git a/tools/inc/tools/datetime.hxx b/tools/inc/tools/datetime.hxx
index 3f3ba38..cf053e5 100644
--- a/tools/inc/tools/datetime.hxx
+++ b/tools/inc/tools/datetime.hxx
@@ -82,7 +82,6 @@ public:
     sal_Bool            operator <=( const DateTime& rDateTime ) const;
 
     long            GetSecFromDateTime( const Date& rDate ) const;
-    void            MakeDateTimeFromSec( const Date& rDate, sal_uIntPtr nSec );
 
     void            ConvertToUTC()       { *this -= Time::GetUTCOffset(); }
     void            ConvertToLocalTime() { *this += Time::GetUTCOffset(); }
diff --git a/tools/source/datetime/datetime.cxx b/tools/source/datetime/datetime.cxx
index e58646d..3936389 100644
--- a/tools/source/datetime/datetime.cxx
+++ b/tools/source/datetime/datetime.cxx
@@ -128,23 +128,6 @@ long DateTime::GetSecFromDateTime( const Date& rDate ) const
 
 /*************************************************************************
 |*
-|*    DateTime::GetSecFromDateTime()
-|*
-*************************************************************************/
-
-void DateTime::MakeDateTimeFromSec( const Date& rDate, sal_uIntPtr nSec )
-{
-    long nDays = nSec / (24UL*60*60);
-    ((Date*)this)->operator=( rDate );
-    nSec -= nDays * (24UL*60*60);
-    sal_uInt16 nMin = (sal_uInt16)(nSec / 60);
-    nSec -= nMin * 60;
-    ((Time*)this)->operator=( Time( 0, nMin, (sal_uInt16)nSec ) );
-    operator+=( nDays );
-}
-
-/*************************************************************************
-|*
 |*    DateTime::operator +=()
 |*
 *************************************************************************/
diff --git a/tools/source/generic/color.cxx b/tools/source/generic/color.cxx
index f06d3d1..aa848f7 100644
--- a/tools/source/generic/color.cxx
+++ b/tools/source/generic/color.cxx
@@ -102,21 +102,6 @@ void Color::DecreaseLuminance( sal_uInt8 cLumDec )
 
 // -----------------------------------------------------------------------
 
-void Color::IncreaseContrast( sal_uInt8 cContInc )
-{
-    if( cContInc)
-    {
-        const double fM = 128.0 / ( 128.0 - 0.4985 * cContInc );
-        const double fOff = 128.0 - fM * 128.0;
-
-        SetRed( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_RED( mnColor ) * fM + fOff ), 0L, 255L ) 
);
-        SetGreen( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_GREEN( mnColor ) * fM + fOff ), 0L, 
255L ) );
-        SetBlue( (sal_uInt8) SAL_BOUND( _FRound( COLORDATA_BLUE( mnColor ) * fM + fOff ), 0L, 255L 
) );
-    }
-}
-
-// -----------------------------------------------------------------------
-
 void Color::DecreaseContrast( sal_uInt8 cContDec )
 {
     if( cContDec )
diff --git a/unusedcode.easy b/unusedcode.easy
index 7acfd21..c9a1a84 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -55,10 +55,8 @@ CharPosArray::Insert(CharPosArray const*, unsigned short, unsigned short, unsign
 CharPosArray::Replace(int const&, unsigned short)
 CharPosArray::Replace(int const*, unsigned short, unsigned short)
 CharPosArray::_ForEach(unsigned short, unsigned short, unsigned char (*)(int const&, void*), void*)
-Color::IncreaseContrast(unsigned char)
 CurrencyField::ImplLoadRes(ResId const&)
 CustomToolBarImportHelper::showToolbar(rtl::OUString const&)
-DateTime::MakeDateTimeFromSec(Date const&, unsigned long)
 DdeGetPutItem::DdeGetPutItem(DdeItem const&)
 DdeService::AddFormat(unsigned long)
 DdeService::AddTopic(DdeTopic const&)
@@ -177,8 +175,6 @@ Octree::AddColor(BitmapColor const&)
 Octree::Octree(unsigned long)
 OutputDevice::LogicToPixel(PolyPolygon const&, MapMode const&) const
 OutputDevice::PixelToLogic(PolyPolygon const&, MapMode const&) const
-PageSpan::getMarginLeft() const
-PageSpan::getMarginRight() const
 ParagraphObj::ParagraphObj(ParagraphObj&)
 ParagraphStyleManager::get(WPXString const&) const
 PathDialog::SetPath(Edit const&)
@@ -190,10 +186,6 @@ PropBrwMgr::GetChildWindowId()
 ProposalList::Remove(rtl::OUString const&)
 PushButton::GetSymbolAlign() const
 ResData::Dump()
-SVGExport::GetGlyphPlacement() const
-SVGExport::IsUseGradient() const
-SVGExport::popClip()
-SVGExport::pushClip(basegfx::B2DPolyPolygon const&)
 SalGraphics::DrawBitmap(SalTwoRect const*, SalBitmap const&, unsigned int, OutputDevice const*)
 SalGraphics::DrawNativeControlText(unsigned int, unsigned int, Rectangle const&, unsigned int, 
ImplControlValue const&, rtl::OUString const&, OutputDevice const*)
 SalGraphics::drawAlphaBitmap(SalTwoRect const&, SalBitmap const&, SalBitmap const&)
diff --git a/writerperfect/source/filter/PageSpan.cxx b/writerperfect/source/filter/PageSpan.cxx
index cb7da97..944764e 100644
--- a/writerperfect/source/filter/PageSpan.cxx
+++ b/writerperfect/source/filter/PageSpan.cxx
@@ -91,22 +91,6 @@ int PageSpan::getSpan() const
     return 0; // should never happen
 }
 
-double PageSpan::getMarginLeft() const
-{
-    if (mxPropList["fo:margin-left"])
-        return mxPropList["fo:margin-left"]->getDouble();
-
-    return 0.0;
-}
-
-double PageSpan::getMarginRight() const
-{
-    if (mxPropList["fo:margin-right"])
-        return mxPropList["fo:margin-right"]->getDouble();
-
-    return 0.0;
-}
-
 void PageSpan::setHeaderContent(std::vector<DocumentElement *> * pHeaderContent)
 {
     if (mpHeaderContent)
diff --git a/writerperfect/source/filter/PageSpan.hxx b/writerperfect/source/filter/PageSpan.hxx
index c3d5cc1..9172937 100644
--- a/writerperfect/source/filter/PageSpan.hxx
+++ b/writerperfect/source/filter/PageSpan.hxx
@@ -41,8 +41,6 @@ public:
     void writePageLayout(const int iNum, OdfDocumentHandler *pHandler) const;
     void writeMasterPages(const int iStartingNum, const int iPageLayoutNum, const bool 
bLastPageSpan, OdfDocumentHandler *pHandler) const;
     int getSpan() const;
-    double getMarginLeft() const;
-    double getMarginRight() const;
 
     void setHeaderContent(std::vector<DocumentElement *> * pHeaderContent);
     void setFooterContent(std::vector<DocumentElement *> * pFooterContent);
-- 
1.7.7.5


Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.