[Libreoffice-commits] .: 4 commits - Makefile sal/osl sd/source sot/inc sot/source svx/inc svx/source test/inc test/source tools/inc tools/source unusedcode.easy
Caolán McNamara
caolan at kemper.freedesktop.org
Thu Mar 1 02:45:00 PST 2012
Makefile | 6 ++
sal/osl/unx/file.cxx | 2
sd/source/filter/eppt/pptx-text.cxx | 12 -----
sd/source/filter/eppt/text.hxx | 2
sot/inc/sot/stg.hxx | 1
sot/source/sdstor/ucbstorage.cxx | 17 -------
svx/inc/svx/xexch.hxx | 1
svx/source/xoutdev/xexch.cxx | 10 ----
test/inc/test/sheet/xdatapilottable2.hxx | 1
test/inc/test/sheet/xnamedranges.hxx | 2
test/inc/test/util/xsearchable.hxx | 1
test/source/sheet/xdatapilottable2.cxx | 4 +
test/source/sheet/xnamedranges.cxx | 4 +
test/source/util/xsearchable.cxx | 4 +
tools/inc/tools/stream.hxx | 4 -
tools/inc/tools/unqidx.hxx | 2
tools/source/memtools/unqidx.cxx | 22 ---------
tools/source/stream/strmunx.cxx | 70 ++++++++++---------------------
unusedcode.easy | 20 --------
19 files changed, 48 insertions(+), 137 deletions(-)
New commits:
commit f87e486d298d98beb3aa9bd1c4884877117cbdcc
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 1 10:06:06 2012 +0000
WaE: C4265: class has virtual functions, but destructor is not virtual
diff --git a/test/inc/test/sheet/xdatapilottable2.hxx b/test/inc/test/sheet/xdatapilottable2.hxx
index 7b82bf8..25ce93e 100644
--- a/test/inc/test/sheet/xdatapilottable2.hxx
+++ b/test/inc/test/sheet/xdatapilottable2.hxx
@@ -50,6 +50,7 @@ public:
void testGetDrillDownData();
void testGetOutputRangeByType();
void testInsertDrillDownSheet();
+ virtual ~XDataPilotTable2();
virtual uno::Reference< uno::XInterface > initDP2() = 0;
virtual uno::Reference< uno::XInterface > getSheets() = 0;
diff --git a/test/inc/test/sheet/xnamedranges.hxx b/test/inc/test/sheet/xnamedranges.hxx
index 508fec5..b2a6012 100644
--- a/test/inc/test/sheet/xnamedranges.hxx
+++ b/test/inc/test/sheet/xnamedranges.hxx
@@ -43,6 +43,8 @@ public:
// removes given entry
XNamedRanges(const rtl::OUString& rNameToRemove);
+ virtual ~XNamedRanges();
+
virtual uno::Reference< uno::XInterface > init(sal_Int32 nSheets = 0) = 0;
// XNamedRanges
diff --git a/test/inc/test/util/xsearchable.hxx b/test/inc/test/util/xsearchable.hxx
index f7b8758..673ce44 100644
--- a/test/inc/test/util/xsearchable.hxx
+++ b/test/inc/test/util/xsearchable.hxx
@@ -38,6 +38,7 @@ class OOO_DLLPUBLIC_TEST XSearchable
public:
XSearchable(const rtl::OUString& rString, sal_Int32 nCount) : maSearchString(rString), mnCount(nCount) {}
XSearchable() : maSearchString(RTL_CONSTASCII_USTRINGPARAM("SearchString")), mnCount(1) {}
+ virtual ~XSearchable();
void testFindFirst();
void testFindNext();
diff --git a/test/source/sheet/xdatapilottable2.cxx b/test/source/sheet/xdatapilottable2.cxx
index de1bb97..dd29aa3 100644
--- a/test/source/sheet/xdatapilottable2.cxx
+++ b/test/source/sheet/xdatapilottable2.cxx
@@ -46,6 +46,10 @@ using namespace com::sun::star::uno;
namespace apitest {
+XDataPilotTable2::~XDataPilotTable2()
+{
+}
+
void XDataPilotTable2::testGetPositionData()
{
uno::Reference< sheet::XDataPilotTable2 > xDPTable(initDP2(), UNO_QUERY_THROW);
diff --git a/test/source/sheet/xnamedranges.cxx b/test/source/sheet/xnamedranges.cxx
index b5c9a46..9f52cc6 100644
--- a/test/source/sheet/xnamedranges.cxx
+++ b/test/source/sheet/xnamedranges.cxx
@@ -65,6 +65,10 @@ XNamedRanges::XNamedRanges(const rtl::OUString& rNameToRemove):
}
+XNamedRanges::~XNamedRanges()
+{
+}
+
void XNamedRanges::testAddNewByName()
{
uno::Reference< sheet::XNamedRanges > xNamedRanges(init(), UNO_QUERY_THROW);
diff --git a/test/source/util/xsearchable.cxx b/test/source/util/xsearchable.cxx
index 7f3fdb0..040268b 100644
--- a/test/source/util/xsearchable.cxx
+++ b/test/source/util/xsearchable.cxx
@@ -74,6 +74,10 @@ void XSearchable::testFindNext()
}
}
+XSearchable::~XSearchable()
+{
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 2eeef79b78242a89ef6901ba67b30f178d59027f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Thu Mar 1 09:31:54 2012 +0000
callcatcher: update list
diff --git a/Makefile b/Makefile
index 82cb710..e9a1880 100644
--- a/Makefile
+++ b/Makefile
@@ -467,6 +467,12 @@ findunusedcode:
| grep -v ^libwpg:: \
| grep -v ^lucene:: \
| grep -v ^salhelper:: \
+ | grep -v ^WP1 \
+ | grep -v ^WP3 \
+ | grep -v ^WP42 \
+ | grep -v ^WP6 \
+ | grep -v ^WPG \
+ | grep -v ^WPS \
> unusedcode.easy
check: subsequentcheck
diff --git a/sd/source/filter/eppt/pptx-text.cxx b/sd/source/filter/eppt/pptx-text.cxx
index b54acde..3848528 100644
--- a/sd/source/filter/eppt/pptx-text.cxx
+++ b/sd/source/filter/eppt/pptx-text.cxx
@@ -1297,18 +1297,6 @@ TextObj::~TextObj()
delete mpImplTextObj;
}
-void TextObj::Write( SvStream* pStrm )
-{
- sal_uInt32 nSize, nPos = pStrm->Tell();
- *pStrm << (sal_uInt32)( EPP_TextCharsAtom << 16 ) << (sal_uInt32)0;
- for ( void* pPtr = First(); pPtr; pPtr = Next() )
- ((ParagraphObj*)pPtr)->Write( pStrm );
- nSize = pStrm->Tell() - nPos;
- pStrm->SeekRel( - ( (sal_Int32)nSize - 4 ) );
- *pStrm << (sal_uInt32)( nSize - 8 );
- pStrm->SeekRel( nSize - 8 );
-}
-
void TextObj::ImplCalculateTextPositions()
{
mpImplTextObj->mnTextSize = 0;
diff --git a/sd/source/filter/eppt/text.hxx b/sd/source/filter/eppt/text.hxx
index 58ddca9..aadd938 100644
--- a/sd/source/filter/eppt/text.hxx
+++ b/sd/source/filter/eppt/text.hxx
@@ -252,8 +252,6 @@ class TextObj
TextObj( const TextObj& rTextObj );
~TextObj();
- void Write( SvStream* pStrm );
-
ParagraphObj* First(){ return (ParagraphObj*)mpImplTextObj->mpList->First(); };
ParagraphObj* Next(){ return(ParagraphObj*)mpImplTextObj->mpList->Next(); };
sal_uInt32 Count() const { return mpImplTextObj->mnTextSize; };
diff --git a/sot/inc/sot/stg.hxx b/sot/inc/sot/stg.hxx
index cb447e3..793ee0e 100644
--- a/sot/inc/sot/stg.hxx
+++ b/sot/inc/sot/stg.hxx
@@ -296,7 +296,6 @@ protected:
~UCBStorage();
public:
static sal_Bool IsStorageFile( SvStream* );
- static sal_Bool IsStorageFile( const String& rName );
static sal_Bool IsDiskSpannedFile( SvStream* );
static String GetLinkedFile( SvStream& );
static String CreateLinkFile( const String& rName );
diff --git a/sot/source/sdstor/ucbstorage.cxx b/sot/source/sdstor/ucbstorage.cxx
index e82d7b3..4899aa0 100644
--- a/sot/source/sdstor/ucbstorage.cxx
+++ b/sot/source/sdstor/ucbstorage.cxx
@@ -3203,23 +3203,6 @@ sal_Bool UCBStorage::Equals( const BaseStorage& rStorage ) const
return ((BaseStorage*)this) == &rStorage;
}
-sal_Bool UCBStorage::IsStorageFile( const String& rFileName )
-{
- rtl::OUString aFileURL = rFileName;
- INetURLObject aObj( aFileURL );
- if ( aObj.GetProtocol() == INET_PROT_NOT_VALID )
- {
- ::utl::LocalFileHelper::ConvertPhysicalNameToURL( rFileName, aFileURL );
- aObj.SetURL( aFileURL );
- aFileURL = aObj.GetMainURL( INetURLObject::NO_DECODE );
- }
-
- SvStream * pStm = ::utl::UcbStreamHelper::CreateStream( aFileURL, STREAM_STD_READ );
- sal_Bool bRet = UCBStorage::IsStorageFile( pStm );
- delete pStm;
- return bRet;
-}
-
sal_Bool UCBStorage::IsStorageFile( SvStream* pFile )
{
if ( !pFile )
diff --git a/svx/inc/svx/xexch.hxx b/svx/inc/svx/xexch.hxx
index cb31e44..37f286d 100644
--- a/svx/inc/svx/xexch.hxx
+++ b/svx/inc/svx/xexch.hxx
@@ -60,7 +60,6 @@ public:
SVX_DLLPUBLIC friend SvStream& operator<<( SvStream& rOStm, const XFillExchangeData& rXFillExchangeData );
SVX_DLLPUBLIC friend SvStream& operator>>( SvStream& rIStm, XFillExchangeData& rXFillExchangeData );
- static sal_uLong RegisterClipboardFormatName();
XFillAttrSetItem* GetXFillAttrSetItem() { return pXFillAttrSetItem; }
};
diff --git a/svx/source/xoutdev/xexch.cxx b/svx/source/xoutdev/xexch.cxx
index c292750..61c61bb 100644
--- a/svx/source/xoutdev/xexch.cxx
+++ b/svx/source/xoutdev/xexch.cxx
@@ -78,16 +78,6 @@ XFillExchangeData::~XFillExchangeData()
delete pXFillAttrSetItem;
}
-/*************************************************************************
-|*
-|*
-|*
-*************************************************************************/
-sal_uIntPtr XFillExchangeData::RegisterClipboardFormatName()
-{
- return( SOT_FORMATSTR_ID_XFA );
-}
-
/******************************************************************************
|*
|* Binaer-Export (z.Z. ohne Versionsverwaltung, da nicht persistent!)
diff --git a/tools/inc/tools/unqidx.hxx b/tools/inc/tools/unqidx.hxx
index 1f806f9..17d9ecf 100644
--- a/tools/inc/tools/unqidx.hxx
+++ b/tools/inc/tools/unqidx.hxx
@@ -66,7 +66,6 @@ public:
sal_uIntPtr GetCurIndex() const;
sal_uIntPtr GetIndex( const void* p ) const;
- sal_Bool IsIndexValid( sal_uIntPtr nIndex ) const;
void* Seek( void* p );
void* First();
@@ -104,7 +103,6 @@ public: \
using UniqueIndex::Clear; \
using UniqueIndex::Count; \
using UniqueIndex::GetCurIndex; \
- using UniqueIndex::IsIndexValid; \
using UniqueIndex::GetStartIndex; \
using UniqueIndex::GetCurMaxIndex; \
\
diff --git a/tools/source/memtools/unqidx.cxx b/tools/source/memtools/unqidx.cxx
index 64e0b39..38cf2a9 100644
--- a/tools/source/memtools/unqidx.cxx
+++ b/tools/source/memtools/unqidx.cxx
@@ -195,28 +195,6 @@ sal_uIntPtr UniqueIndex::GetIndex( const void* p ) const
/*************************************************************************
|*
-|* UniqueIndex::IsIndexValid()
-|*
-*************************************************************************/
-
-sal_Bool UniqueIndex::IsIndexValid( sal_uIntPtr nIndex ) const
-{
- // Ist Index zulaessig
- if ( (nIndex >= nStartIndex) &&
- (nIndex < (Container::GetSize()+nStartIndex)) )
- {
- // Index ist nur zulaessig, wenn Eintrag auch belegt ist
- if ( Container::ImpGetObject( nIndex-nStartIndex ) )
- return sal_True;
- else
- return sal_False;
- }
- else
- return sal_False;
-}
-
-/*************************************************************************
-|*
|* UniqueIndex::Seek()
|*
*************************************************************************/
diff --git a/unusedcode.easy b/unusedcode.easy
index 90cd389..d51eed7 100755
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -380,10 +380,8 @@ TaskBar::TaskBar(Window*, long)
TaskStatusFieldItem::TaskStatusFieldItem()
TempFile::IsValid() const
TextEngine::GetLeftMargin() const
-TextObj::Write(SvStream*)
TransferableDataHelper::GetInterface(com::sun::star::datatransfer::DataFlavor const&, com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
TypeDescriptor_Init_Impl::~TypeDescriptor_Init_Impl()
-UCBStorage::IsStorageFile(String const&)
UCBStream::UCBStream(com::sun::star::uno::Reference<com::sun::star::io::XOutputStream>&)
UnoComboBoxControl::getActionListeners()
UnoComboBoxControl::getItemListeners()
@@ -405,20 +403,6 @@ VbaFoundFilesEnum::SetFileList(com::sun::star::uno::Sequence<rtl::OUString>&)
VbaFoundFilesEnum::VbaFoundFilesEnum()
VclEventListeners2::~VclEventListeners2()
ViewShell::getIDocumentFieldsAccess() const
-WP1FixedLengthGroup::isGroupConsistent(WPXInputStream*, WPXEncryption*, unsigned char)
-WP3ResourceFork::getResourcesByID(unsigned int) const
-WP3ResourceFork::getResourcesByType(unsigned int) const
-WP3StylesListener::insertCell()
-WP3StylesListener::insertRow()
-WP3SubDocument::WP3SubDocument(unsigned char*, unsigned int)
-WP42SubDocument::WP42SubDocument(unsigned char*, unsigned int)
-WP6SubDocument::WP6SubDocument(WPXInputStream*, WPXEncryption*, unsigned int)
-WPGTextDataHandler::endSubDocument()
-WPS8Parser::readText(WPXInputStream*, WPS8ContentListener*)
-WPSContentListener::closeEndnote()
-WPSContentListener::closeFootnote()
-WPSContentListener::openEndnote()
-WPSContentListener::openFootnote()
WPXPropertyList::Iter::last()
WPXPropertyListVector::Iter::last()
WPXString::Iter::last()
@@ -434,7 +418,6 @@ WinMtfOutput::SetFont(Font const&)
Window::PostUserEvent(unsigned long&, unsigned long, void*)
X11SalGraphics::SetMask(int&, int&, unsigned int&, unsigned int&, int&, int&, unsigned long)
X509Certificate_NssImpl::getImplementation(com::sun::star::uno::Reference<com::sun::star::uno::XInterface>)
-XFillExchangeData::RegisterClipboardFormatName()
XMLElement::Equals(rtl::OUString)
XMLEmbeddedObjectExportFilter::XMLEmbeddedObjectExportFilter()
XMLErrors::AddRecord(int, com::sun::star::uno::Sequence<rtl::OUString> const&)
@@ -559,7 +542,6 @@ binfilter::ByteString::SearchAndReplace(char const*, binfilter::ByteString const
binfilter::ByteString::SearchAndReplaceAll(binfilter::ByteString const&, binfilter::ByteString const&)
binfilter::ByteString::SearchAndReplaceAll(char const*, binfilter::ByteString const&)
binfilter::ByteString::SearchAndReplaceAll(char, char)
-binfilter::ByteString::SearchBackward(char, unsigned short) const
binfilter::ByteString::SetChar(unsigned short, char)
binfilter::ByteString::SetToken(unsigned short, char, binfilter::ByteString const&, unsigned short)
binfilter::ByteString::ToUpperAscii()
@@ -613,8 +595,6 @@ binfilter::ScConditionalFormats_Impl::Insert(binfilter::ScConditionalFormat* con
binfilter::ScConditionalFormats_Impl::Insert(binfilter::ScConditionalFormats_Impl const*, unsigned short, unsigned short)
binfilter::ScConditionalFormats_Impl::Remove(binfilter::ScConditionalFormat* const&, unsigned short)
binfilter::ScConditionalFormats_Impl::Remove(unsigned short, unsigned short)
-binfilter::ScMultipleWriteHeader::ScMultipleWriteHeader(SvStream&, unsigned int)
-binfilter::ScMultipleWriteHeader::~ScMultipleWriteHeader()
binfilter::ScMyContentAction::~ScMyContentAction()
binfilter::ScMyDelAction::~ScMyDelAction()
binfilter::ScMyMoveAction::~ScMyMoveAction()
commit 1431c95d19cde8b913d772c9a99c3ebd886e983a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Feb 29 21:08:28 2012 +0000
now restore and use reduced UnlockFile and UnlockRange impls
because its super ugly to have unbalanced lock/unlocks and with
the removal of STAR_ENABLE_FILE_LOCKING we can call those
methods and now get unchanged behaviour
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 6482fdd..c2749ff 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -639,11 +639,9 @@ private:
SvFileStream & operator= (const SvFileStream&);
sal_Bool LockRange( sal_Size nByteOffset, sal_Size nBytes );
- sal_Bool LockFile();
-#ifdef WNT
sal_Bool UnlockRange( sal_Size nByteOffset, sal_Size nBytes );
+ sal_Bool LockFile();
sal_Bool UnlockFile();
-#endif
protected:
virtual sal_Size GetData( void* pData, sal_Size nSize );
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index 2df86ce..cb55ddc 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -556,6 +556,22 @@ sal_Bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes )
/*************************************************************************
|*
+|* SvFileStream::UnlockRange()
+|*
+*************************************************************************/
+
+sal_Bool SvFileStream::UnlockRange( sal_Size nByteOffset, sal_Size nBytes )
+{
+ if ( ! IsOpen() )
+ return sal_False;
+
+ InternalStreamLock::UnlockFile( nByteOffset, nByteOffset+nBytes, this );
+
+ return sal_True;
+}
+
+/*************************************************************************
+|*
|* SvFileStream::LockFile()
|*
*************************************************************************/
@@ -567,6 +583,17 @@ sal_Bool SvFileStream::LockFile()
/*************************************************************************
|*
+|* SvFileStream::UnlockFile()
+|*
+*************************************************************************/
+
+sal_Bool SvFileStream::UnlockFile()
+{
+ return UnlockRange( 0UL, 0UL );
+}
+
+/*************************************************************************
+|*
|* SvFileStream::Open()
|*
*************************************************************************/
@@ -688,7 +715,7 @@ void SvFileStream::Open( const String& rFilename, StreamMode nOpenMode )
void SvFileStream::Close()
{
- InternalStreamLock::UnlockFile( 0, 0, this );
+ UnlockFile();
if ( IsOpen() )
{
commit 05a8216d03b5db559e01dd1808f2805df31c970a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Feb 29 21:02:22 2012 +0000
STAR_ENABLE_FILE_LOCKING was a secret
diff --git a/sal/osl/unx/file.cxx b/sal/osl/unx/file.cxx
index b8a851f..c513f60 100644
--- a/sal/osl/unx/file.cxx
+++ b/sal/osl/unx/file.cxx
@@ -837,7 +837,7 @@ struct Locking_Impl
Locking_Impl() : m_enabled(0)
{
#ifndef HAVE_O_EXLOCK
- m_enabled = ((getenv("SAL_ENABLE_FILE_LOCKING") != 0) || (getenv("STAR_ENABLE_FILE_LOCKING") != 0));
+ m_enabled = (getenv("SAL_ENABLE_FILE_LOCKING") != 0);
#endif /* HAVE_O_EXLOCK */
}
};
diff --git a/tools/source/stream/strmunx.cxx b/tools/source/stream/strmunx.cxx
index d001c6f..2df86ce 100644
--- a/tools/source/stream/strmunx.cxx
+++ b/tools/source/stream/strmunx.cxx
@@ -34,7 +34,6 @@
#include <errno.h>
#include <unistd.h>
#include <limits.h>
-#include <stdlib.h> // fuer getenv()
#include <tools/debug.hxx>
#include <tools/fsys.hxx>
@@ -500,8 +499,6 @@ void SvFileStream::FlushData()
// lokal gibt es nicht
}
-static char *pFileLockEnvVar = (char*)1;
-
/*************************************************************************
|*
|* SvFileStream::LockRange()
@@ -510,11 +507,6 @@ static char *pFileLockEnvVar = (char*)1;
sal_Bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes )
{
- struct flock aflock;
- aflock.l_start = nByteOffset;
- aflock.l_whence = SEEK_SET;
- aflock.l_len = nBytes;
-
int nLockMode = 0;
if ( ! IsOpen() )
@@ -559,47 +551,6 @@ sal_Bool SvFileStream::LockRange( sal_Size nByteOffset, sal_Size nBytes )
return sal_False;
}
- // HACK: File-Locking nur via Environmentvariable einschalten
- // um einen Haenger im Zusammenspiel mit einem Linux
- // NFS-2-Server (kein Lockdaemon) zu verhindern.
- // File-Locking ?ber NFS ist generell ein Performancekiller.
- // HR, 22.10.1997 fuer SOLARIS
- // HR, 18.05.1998 Environmentvariable
-
- if ( pFileLockEnvVar == (char*)1 )
- pFileLockEnvVar = getenv("STAR_ENABLE_FILE_LOCKING");
- if ( ! pFileLockEnvVar )
- return sal_True;
-
- aflock.l_type = nLockMode;
- sal_IntPtr iFileHandle;
- oslFileError rc = osl_getFileOSHandle(pInstanceData->rHandle, &iFileHandle);
- if (rc != osl_File_E_None)
- {
- SetError( ::GetSvError( rc ));
- return sal_False;
- }
- if (fcntl((int)iFileHandle, F_GETLK, &aflock) == -1)
- {
- #if defined SOLARIS
- if (errno == ENOSYS)
- return sal_True;
- #endif
- SetError( ::GetSvError( errno ));
- return sal_False;
- }
- if (aflock.l_type != F_UNLCK)
- {
- SetError(SVSTREAM_LOCKING_VIOLATION);
- return sal_False;
- }
-
- aflock.l_type = nLockMode;
- if (fcntl((int)iFileHandle, F_SETLK, &aflock) == -1)
- {
- SetError( ::GetSvError( errno ));
- return sal_False;
- }
return sal_True;
}
More information about the Libreoffice-commits
mailing list