From 03c360a0429d1a6dba168d0bb9f94c7bc8e1f63c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?G=C3=A1bor=20Stefanik?= <netrolller.3d@gmail.com>
Date: Sat, 14 Apr 2012 00:53:24 +0200
Subject: [PATCH] Remove unused debug facilities from basebmp

---
 basebmp/Library_basebmp.mk    |    2 -
 basebmp/Package_inc.mk        |    1 -
 basebmp/inc/basebmp/debug.hxx |   66 -------------------------
 basebmp/source/debug.cxx      |  109 -----------------------------------------
 basebmp/test/bmpdemo.cxx      |    1 -
 unusedcode.easy               |    1 -
 vcl/headless/svpgdi.cxx       |    1 -
 vcl/headless/svptext.cxx      |    4 --
 8 files changed, 0 insertions(+), 185 deletions(-)
 delete mode 100644 basebmp/inc/basebmp/debug.hxx
 delete mode 100644 basebmp/source/debug.cxx

diff --git a/basebmp/Library_basebmp.mk b/basebmp/Library_basebmp.mk
index f747d3d..bf20726 100644
--- a/basebmp/Library_basebmp.mk
+++ b/basebmp/Library_basebmp.mk
@@ -53,14 +53,12 @@ $(eval $(call gb_Library_use_libraries,basebmp,\
 ifeq ($(OS),SOLARIS)
 $(eval $(call gb_Library_add_cxxobjects,basebmp, \
 	basebmp/source/bitmapdevice \
-	basebmp/source/debug \
 	basebmp/source/polypolygonrenderer \
     , $(gb_COMPILEROPTFLAGS) $(gb_LinkTarget_EXCEPTIONFLAGS) -xalias_level=compatible \
 ))
 else
 $(eval $(call gb_Library_add_exception_objects,basebmp,\
 	basebmp/source/bitmapdevice \
-	basebmp/source/debug \
 	basebmp/source/polypolygonrenderer \
 ))
 endif
diff --git a/basebmp/Package_inc.mk b/basebmp/Package_inc.mk
index b1298e9..718e0d3 100644
--- a/basebmp/Package_inc.mk
+++ b/basebmp/Package_inc.mk
@@ -30,7 +30,6 @@ $(eval $(call gb_Package_Package,basebmp_inc,$(SRCDIR)/basebmp/inc))
 $(eval $(call gb_Package_add_file,basebmp_inc,inc/basebmp/bitmapdevice.hxx,basebmp/bitmapdevice.hxx))
 $(eval $(call gb_Package_add_file,basebmp_inc,inc/basebmp/basebmpdllapi.h,basebmp/basebmpdllapi.h))
 $(eval $(call gb_Package_add_file,basebmp_inc,inc/basebmp/color.hxx,basebmp/color.hxx))
-$(eval $(call gb_Package_add_file,basebmp_inc,inc/basebmp/debug.hxx,basebmp/debug.hxx))
 $(eval $(call gb_Package_add_file,basebmp_inc,inc/basebmp/drawmodes.hxx,basebmp/drawmodes.hxx))
 $(eval $(call gb_Package_add_file,basebmp_inc,inc/basebmp/scanlineformats.hxx,basebmp/scanlineformats.hxx))
 
diff --git a/basebmp/inc/basebmp/debug.hxx b/basebmp/inc/basebmp/debug.hxx
deleted file mode 100644
index 0a8c721..0000000
--- a/basebmp/inc/basebmp/debug.hxx
+++ /dev/null
@@ -1,66 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef INCLUDED_BASEBMP_DEBUG_HXX
-#define INCLUDED_BASEBMP_DEBUG_HXX
-
-#include <iostream>
-#include <boost/shared_ptr.hpp>
-#include <basebmp/basebmpdllapi.h>
-
-namespace basebmp
-{
-    class BitmapDevice;
-
-    /** Dump content of BitmapDevice to given output stream.
-
-        @param rDevice
-        Device whose content should be dumped.
-
-        @param rOutputStream
-        Stream to write output to.
-
-        Used in vcl/headless/svpgdi.cxx when OSL_DEBUG_LEVEL > 2
-
-        Use like this:
-<pre>
-        #include <basebmp/debug.hxx>
-        #include <iostream>
-        #include <fstream>
-
-        std::ofstream output("/tmp/my_test.dump");
-        debugDump( pMyDevice, output );
-</pre>
-    */
-    void BASEBMP_DLLPUBLIC debugDump( const boost::shared_ptr< BitmapDevice >& rDevice,
-                                      ::std::ostream&                          rOutputStream );
-}
-
-#endif /* INCLUDED_BASEBMP_DEBUG_HXX */
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basebmp/source/debug.cxx b/basebmp/source/debug.cxx
deleted file mode 100644
index 5491715..0000000
--- a/basebmp/source/debug.cxx
+++ /dev/null
@@ -1,109 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org.  If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include <osl/diagnose.h>
-
-#include <basegfx/point/b2ipoint.hxx>
-#include <basegfx/vector/b2ivector.hxx>
-
-#include <basebmp/scanlineformats.hxx>
-#include <basebmp/color.hxx>
-#include <basebmp/bitmapdevice.hxx>
-#include <basebmp/debug.hxx>
-
-#include <iomanip>
-
-namespace basebmp
-{
-    namespace
-    {
-        static const char* getFormatString( sal_Int32 nScanlineFormat )
-        {
-            switch( nScanlineFormat )
-            {
-                case Format::ONE_BIT_MSB_GREY:
-                    return "ONE_BIT_MSB_GREY";
-                case Format::ONE_BIT_LSB_GREY:
-                    return "ONE_BIT_LSB_GREY";
-                case Format::ONE_BIT_MSB_PAL:
-                    return "ONE_BIT_MSB_PAL";
-                case Format::ONE_BIT_LSB_PAL:
-                    return "ONE_BIT_LSB_PAL";
-                case Format::FOUR_BIT_MSB_GREY:
-                    return "FOUR_BIT_MSB_GREY";
-                case Format::FOUR_BIT_LSB_GREY:
-                    return "FOUR_BIT_LSB_GREY";
-                case Format::FOUR_BIT_MSB_PAL:
-                    return "FOUR_BIT_MSB_PAL";
-                case Format::FOUR_BIT_LSB_PAL:
-                    return "FOUR_BIT_LSB_PAL";
-                case Format::EIGHT_BIT_PAL:
-                    return "EIGHT_BIT_PAL";
-                case Format::EIGHT_BIT_GREY:
-                    return "EIGHT_BIT_GREY";
-                case Format::SIXTEEN_BIT_LSB_TC_MASK:
-                    return "SIXTEEN_BIT_LSB_TC_MASK";
-                case Format::SIXTEEN_BIT_MSB_TC_MASK:
-                    return "SIXTEEN_BIT_MSB_TC_MASK";
-                case Format::TWENTYFOUR_BIT_TC_MASK:
-                    return "TWENTYFOUR_BIT_TC_MASK";
-                case Format::THIRTYTWO_BIT_TC_MASK:
-                    return "THIRTYTWO_BIT_TC_MASK";
-                default:
-                    return "<unknown>";
-            }
-        }
-    }
-
-    SAL_DLLPUBLIC_EXPORT void debugDump( const BitmapDeviceSharedPtr& rDevice,
-                    std::ostream&                rOutputStream )
-    {
-        const basegfx::B2IVector aSize( rDevice->getSize() );
-        const bool               bTopDown( rDevice->isTopDown() );
-        const sal_Int32          nScanlineFormat( rDevice->getScanlineFormat() );
-
-        rOutputStream
-            << "/* basebmp::BitmapDevice content dump */" << std::endl
-            << "/* Width   = " << aSize.getX() << " */" << std::endl
-            << "/* Height  = " << aSize.getY() << " */" << std::endl
-            << "/* TopDown = " << bTopDown << " */" << std::endl
-            << "/* Format  = " << getFormatString(nScanlineFormat) << " */" << std::endl
-            << "/* (dumped entries are already mapped RGBA color values) */" << std::endl
-            << std::endl;
-
-        rOutputStream << std::hex;
-        for( int y=0; y<aSize.getY(); ++y )
-        {
-            for( int x=0; x<aSize.getX(); ++x )
-                rOutputStream << std::setw(8) << (sal_uInt32)rDevice->getPixel( basegfx::B2IPoint(x,y) ).toInt32() << " ";
-            rOutputStream << std::endl;
-        }
-    }
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/basebmp/test/bmpdemo.cxx b/basebmp/test/bmpdemo.cxx
index 6b94921..02b392a 100644
--- a/basebmp/test/bmpdemo.cxx
+++ b/basebmp/test/bmpdemo.cxx
@@ -62,7 +62,6 @@
 #include <basebmp/color.hxx>
 #include <basebmp/scanlineformats.hxx>
 #include <basebmp/bitmapdevice.hxx>
-#include <basebmp/debug.hxx>
 
 #include <rtl/bootstrap.hxx>
 
diff --git a/unusedcode.easy b/unusedcode.easy
index e24c9f9..2b2bf8b 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -359,7 +359,6 @@ _SwPamRanges_SAR::_ForEach(unsigned short, unsigned short, unsigned char (*)(SwP
 _SwRedlineTbl::Insert(SwRedline* const*, unsigned short)
 _SwRedlineTbl::Insert(_SwRedlineTbl const*, unsigned short, unsigned short)
 _SwRedlineTbl::Remove(SwRedline* const&, unsigned short)
-basebmp::debugDump(boost::shared_ptr<basebmp::BitmapDevice> const&, std::basic_ostream<char, std::char_traits<char> >&)
 basegfx::tools::equal(basegfx::B2DPolyPolygon const&, basegfx::B2DPolyPolygon const&, double const&)
 basegfx::tools::equal(basegfx::B3DPolyPolygon const&, basegfx::B3DPolyPolygon const&, double const&)
 basegfx::tools::getSignedArea(basegfx::B3DPolygon const&)
diff --git a/vcl/headless/svpgdi.cxx b/vcl/headless/svpgdi.cxx
index 1d07a2f..0ff1cfe 100644
--- a/vcl/headless/svpgdi.cxx
+++ b/vcl/headless/svpgdi.cxx
@@ -40,7 +40,6 @@
 #include <tools/debug.hxx>
 
 #if OSL_DEBUG_LEVEL > 2
-#include <basebmp/debug.hxx>
 #include <fstream>
 #include <rtl/strbuf.hxx>
 #include <sys/stat.h>
diff --git a/vcl/headless/svptext.cxx b/vcl/headless/svptext.cxx
index 26abf38..2eecfbd 100644
--- a/vcl/headless/svptext.cxx
+++ b/vcl/headless/svptext.cxx
@@ -34,10 +34,6 @@
 
 #include <tools/debug.hxx>
 
-#if OSL_DEBUG_LEVEL > 2
-#include <basebmp/debug.hxx>
-#endif
-
 #include <outfont.hxx>
 #include <impfont.hxx>
 #include <rtl/instance.hxx>
-- 
1.7.7

