#!/usr/bin/env perl # script to generate LibreOffice bash_completion file for the main applications # written by Rene Engelhard , Public Domain # updated for libreoffice-build by Petr Mladek , Public Domain # yes, this script probably is not real good code :) but still easier # to maintain than adding those entries statically many times in # a file... use strict; my @DRAWDOCS=("sxd", "std", "dxf", "emf", "eps", "met", "pct", "sgf", "sgv", "sda", "sdd", "vor", "svm", "wmf", "bmp", "gif", "jpg", "jpeg", "jfif", "fif", "jpe", "pcd", "pcx", "pgm", "png", "ppm", "psd", "ras", "tga", "tif", "tiff", "xbm", "xpm", "odg", "otg", "fodg", "odc", "odi", "sds", "wpg", "svg"); my @IMPRESSDOCS=("sxi", "sti", "ppt", "pps", "pot", "sxd", "sda", "sdd", "sdp", "vor", "cgm", "odp", "otp", "fodp", "ppsm", "ppsx", "pptm", "pptx", "potm", "potx"); my @TEMPLATES=("stw", "dot", "vor", "stc", "xlt", "sti", "pot", "std", "stw", "dotm", "dotx", "potm", "potx", "xltm", "xltx"); my @MATHDOCS=("sxm", "smf", "mml", "odf"); my @MASTERDOCS=("sxg", "odm", "sgl"); my @WRITERDOCS=("doc", "dot", "rtf", "sxw", "stw", "sdw", "vor", "txt", "htm?", "xml", "wp", "wpd", "wps", "odt", "ott", "fodt", "docm", "docx", "dotm", "dotx"); my @WEBDOCS=("htm", "html", "stw", "txt", "vor", "oth"); my @BASEDOCS=("odb"); my @CALCDOCS=("sxc", "stc", "dif", "dbf", "xls", "xlw", "xlt", "rtf", "sdc", "vor", "slk", "txt", "htm", "html", "wk1", "wks", "123", "xml", "ods", "ots", "fods", "csv", "xlsb", "xlsm", "xlsx", "xltm", "xltx"); my @EXTENSIONS=("oxt"); # default names of lowrappers # use "" if you want to disable any wrapper my %APPS = ( office => "libreoffice", office_short => "loffice", master => "", base => "lobase", calc => "localc", draw => "lodraw", impress => "loimpress", math => "lomath", template => "lofromtemplate", unopkg => "unopkg", web => "loweb", writer => "lowriter", ); my $office_shell_function = "_loexp_"; sub usage() { print "Script to Generate bash completion for LO wrappers\n\n"; print "Usage: $0 --help\n"; print " $0 [--binsuffix=suffix]\n"; print "\t\t[--compat-oowrappers]\n"; print "\t\t[--office=wrapper_name]\n"; print "\t\t[--office-short=wrapper_name]\n"; print "\t\t[--master=wrapper_name]\n"; print "\t\t[--base=wrapper_name]\n"; print "\t\t[--calc=wrapper_name]\n"; print "\t\t[--draw=wrapper_name]\n"; print "\t\t[--impress=wrapper_name]\n"; print "\t\t[--math=wrapper_name]\n"; print "\t\t[--template=wrapper_name]\n"; print "\t\t[--unopkg=wrapper_name]\n"; print "\t\t[--web=wrapper_name]\n"; print "\t\t[--writer=wrapper_name]\n"; print "\t\tinput_file\n"; print "\t\toutput_file\n\n"; print "Options:\n"; print "\t--help\t\tprint this help\n"; print "\t--binsuffix\tdefines a suffix that is added after each wrapper\n"; print "\t--compat-oowrappers\tset wrapper names to the old default oo* wrapper names\n"; print "The other options allows to redefine the wrapper names.\n"; print "The value \"\" can be used to disable any wrapper.\n\n"; } my $infilename; my $outfilename; my $binsuffix = ''; my $opt; foreach my $arg (@ARGV) { if ( $arg =~ /--help/ ) { usage(); exit 0; } elsif ( $arg =~ /--compat-oowrappers/ ) { $APPS{'office'} = "openoffice"; $APPS{'office_short'} = "ooffice"; $APPS{'master'} = ""; $APPS{'base'} = "oobase"; $APPS{'calc'} = "oocalc"; $APPS{'draw'} = "oodraw"; $APPS{'impress'} = "ooimpress"; $APPS{'math'} = "oomath"; $APPS{'template'} = "oofromtemplate"; $APPS{'unopkg'} = "unopkg"; $APPS{'web'} = "ooweb"; $APPS{'writer'} = "oowriter"; $office_shell_function = "_ooexp_"; } elsif ( $arg =~ /--binsuffix=(.*)/ ) { $binsuffix = "$1"; } elsif ( $arg =~ /--office=(.*)/ ) { $APPS{'office'} = "$1"; } elsif ( $arg =~ /--office-short=(.*)/ ) { $APPS{'office_short'} = "$1"; } elsif ( $arg =~ /--master=(.*)/ ) { $APPS{'master'} = "$1"; } elsif ( $arg =~ /--base=(.*)/ ) { $APPS{'base'} = "$1"; } elsif ( $arg =~ /--calc=(.*)/ ) { $APPS{'calc'} = "$1"; } elsif ( $arg =~ /--draw=(.*)/ ) { $APPS{'draw'} = "$1"; } elsif ( $arg =~ /--impress=(.*)/ ) { $APPS{'impress'} = "$1" } elsif ( $arg =~ /--math=(.*)/ ) { $APPS{'math'} = "$1"; } elsif ( $arg =~ /--template=(.*)/ ) { $APPS{'template'} = "$1"; } elsif ( $arg =~ /--unopkg=(.*)/ ) { $APPS{'unopkg'} = "$1"; } elsif ( $arg =~ /--web=(.*)/ ) { $APPS{'web'} = "$1"; } elsif ( $arg =~ /--writer=(.*)/ ) { $APPS{'writer'} = "$1" } elsif ( $arg =~ /^-.*/ ) { printf STDERR "Error: invalid option \"$arg\", try --help\n"; exit 1; } elsif ( $outfilename ) { printf STDERR "Error: too much arguments, try --help\n"; exit 1; } else { if ($infilename) { $outfilename = "$arg"; } else { $infilename = "$arg"; } } } unless ( $infilename ) { printf STDERR "Error: undefined input file, try --help\n"; exit 1; } unless ( $outfilename ) { printf STDERR "Error: undefined output file, try --help\n"; exit 1; } #add binsuffix foreach my $app (keys %APPS) { $APPS{$app} .= "$binsuffix" unless ( "$APPS{$app}" eq "" ); } sub print_suffixes_check { my $app = shift(@_); my $first_suffix = shift(@_); ($first_suffix) || die "Error: No suffix defined for $app\n"; print BCOUTFILE " $app)\t\te=\'!*.+(" . $first_suffix . "|" . uc($first_suffix); foreach my $suffix (@_) { print BCOUTFILE "|" . $suffix; print BCOUTFILE "|" . uc($suffix); } print BCOUTFILE ")\' ;;\n"; } sub print_suffixes_checks { foreach my $app (keys %APPS) { # skip the disabled wrapper next if ( $APPS{$app} eq "" ); if ($app eq "draw" ) { print_suffixes_check ($APPS{$app}, @DRAWDOCS); } if ($app eq "writer") { print_suffixes_check ($APPS{$app}, @WRITERDOCS, @MASTERDOCS); } if ($app eq "web") { print_suffixes_check ($APPS{$app}, @WEBDOCS); } if ($app eq "math") { print_suffixes_check ($APPS{$app}, @MATHDOCS); } if ($app eq "impress") { print_suffixes_check ($APPS{$app}, @IMPRESSDOCS); } if ($app eq "base") { print_suffixes_check ($APPS{$app}, @BASEDOCS); } if ($app eq "calc") { print_suffixes_check ($APPS{$app}, @CALCDOCS); } if ($app eq "master") { print_suffixes_check ($APPS{$app}, @MASTERDOCS); } if ($app eq "template") { print_suffixes_check ($APPS{$app}, @TEMPLATES); } # libreoffice should contain all... if (($app eq "office") || ($app eq "office_short")) { print_suffixes_check ($APPS{$app}, @DRAWDOCS, @WRITERDOCS, @MATHDOCS, @IMPRESSDOCS, @BASEDOCS, @CALCDOCS, @MASTERDOCS, @TEMPLATES, @WEBDOCS); } # unopkg is a standalone tool if ($app eq "unopkg") { print_suffixes_check ($APPS{$app}, @EXTENSIONS); } } } sub print_apps { my $app_to_print; foreach my $app (keys %APPS) { # skip the disabled wrapper next if ( $APPS{$app} eq "" ); print BCOUTFILE "\t\t\t\t\t$app_to_print \\\n" if ($app_to_print); $app_to_print = $APPS{$app}; } # the last app will be printed without the final backslash ($app_to_print) || die "Error: No LO wrapper was selected\n"; print BCOUTFILE "\t\t\t\t\t$app_to_print\n"; } open (BCINFILE, "$infilename") || die "Error: can't open $infilename for reading: $!\n"; open (BCOUTFILE, "> $outfilename") || die "Error: can't open $outfilename for writing: $!\n"; while (my $line = ) { chomp $line; $line =~ s/\@OFFICE_SHELL_FUNCTION\@/$office_shell_function/; if ($line =~ m/\@BASH_COMPLETION_SUFFIXES_CHECKS\@/) { print_suffixes_checks(); } elsif ($line =~ m/\@BASH_COMPLETION_OOO_APPS\@/) { print_apps(); } else { print BCOUTFILE "$line\n"; } } close (BCINFILE); close (BCOUTFILE); ro/mimo/mimo-7-5 LibreOffice 核心代码仓库文档基金会
summaryrefslogtreecommitdiff
path: root/sot
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2015-07-03 15:24:09 +0200
committerNoel Grandin <noelgrandin@gmail.com>2015-07-06 11:45:28 +0000
commitc4379aacbe9d5732dadf02c2d4306266e162ffc6 (patch)
tree089c27b6ba2ad77be7cafb277477035e130f7544 /sot
parent5aff134960b046a05f6255d10fd6d8ec72a3ff41 (diff)
loplugin:unusedmethods sot
Change-Id: I14e8bb3e4e38ade1044ce1c50c9676a65152724c Reviewed-on: https://gerrit.libreoffice.org/16733 Reviewed-by: Noel Grandin <noelgrandin@gmail.com> Tested-by: Noel Grandin <noelgrandin@gmail.com>
Diffstat (limited to 'sot')
-rw-r--r--sot/source/base/object.cxx4
-rw-r--r--sot/source/sdstor/stg.cxx104
-rw-r--r--sot/source/sdstor/stgcache.hxx1
-rw-r--r--sot/source/sdstor/stgdir.hxx3
-rw-r--r--sot/source/sdstor/stgelem.hxx4
-rw-r--r--sot/source/sdstor/stgstrms.cxx19
-rw-r--r--sot/source/sdstor/stgstrms.hxx7
-rw-r--r--sot/source/sdstor/storage.cxx10
-rw-r--r--sot/source/sdstor/ucbstorage.cxx66
9 files changed, 2 insertions, 216 deletions
diff --git a/sot/source/base/object.cxx b/sot/source/base/object.cxx
index 013853df13b9..aa809904697f 100644
--- a/sot/source/base/object.cxx
+++ b/sot/source/base/object.cxx
@@ -52,10 +52,6 @@ void * SotObject::CreateInstance( SotObject ** ppObj )
return p;
}
-const SotFactory * SotObject::GetSvFactory() const
-{
- return ClassFactory();
-}
void * SotObject::Cast( const SotFactory * pFact )
{
diff --git a/sot/source/sdstor/stg.cxx b/sot/source/sdstor/stg.cxx
index a3e20858b1e4..953da657ef91 100644
--- a/sot/source/sdstor/stg.cxx
+++ b/sot/source/sdstor/stg.cxx
@@ -274,20 +274,6 @@ bool StorageStream::Commit()
}
}
-bool StorageStream::Revert()
-{
- bool bResult = false;
-
- if ( Validate() )
- {
- pEntry->Revert();
- pIo->MoveError( *this );
- bResult = Good();
- }
-
- return bResult;
-}
-
bool StorageStream::CopyTo( BaseStorageStream* pDest )
{
if( !Validate() || !pDest || !pDest->Validate( true ) || Equals( *pDest ) )
@@ -299,11 +285,6 @@ bool StorageStream::CopyTo( BaseStorageStream* pDest )
return Good() && pDest->Good();
}
-const SvStream* StorageStream::GetSvStream() const
-{
- return GetSvStream_Impl();
-}
-
bool StorageStream::Validate( bool bValidate ) const
{
bool bRet = Validate_Impl( bValidate );
@@ -810,59 +791,6 @@ bool Storage::CopyTo( BaseStorage* pDest ) const
return Good() && pDest->Good();
}
-// Move one element
-
-bool Storage::MoveTo( const OUString& rElem, BaseStorage* pODest, const OUString& rNew )
-{
- if( !Validate() || !pODest || !pODest->Validate( true ) || Equals( *pODest ) )
- {
- SetError( SVSTREAM_ACCESS_DENIED );
- return false;
- }
-
- StgDirEntry* pElem = pIo->pTOC->Find( *pEntry, rElem );
- if( pElem )
- {
- // Simplest case: both storages share the same file
- bool bRes;
- Storage *pOther = PTR_CAST( Storage, pODest );
- if( pOther && pIo == pOther->pIo && rElem == rNew )
- {
- Storage *p = static_cast<Storage*>(pODest);
- Storage *pDest = p;
- // both storages are conventional storages, use implementation dependent code
- if( !pElem->IsContained( pDest->pEntry ) )
- {
- // cyclic move
- SetError( SVSTREAM_ACCESS_DENIED );
- return false;
- }
- bRes = pIo->pTOC->Move( *pEntry, *pDest->pEntry, rNew );
- if( !bRes )
- {
- pIo->MoveError( *this );
- pDest->pIo->MoveError( *pDest );
- sal_uLong nErr = GetError();
- if( !nErr )
- nErr = pDest->GetError();
- SetError( nErr );
- pDest->SetError( nErr );
- }
- }
- else
- {
- bRes = CopyTo( rElem, pODest, rNew );
- if( bRes )
- bRes = Remove( rElem );
- }
- if( !bRes )
- SetError( pIo->GetError() );
- return bRes;
- }
- SetError( SVSTREAM_FILE_NOT_FOUND );
- return false;
-}
-
bool Storage::IsStorage( const OUString& rName ) const
{
if( Validate() )
@@ -959,21 +887,6 @@ void Storage::SetClass( const SvGlobalName & rClass,
SetError( SVSTREAM_ACCESS_DENIED );
}
-void Storage::SetConvertClass( const SvGlobalName & rConvertClass,
- SotClipboardFormatId nOriginalClipFormat,
- const OUString & rUserTypeName )
-{
- if( Validate( true ) )
- {
- SetClass( rConvertClass, nOriginalClipFormat, rUserTypeName );
- // plus the convert flag:
- StgOleStream aOle( *this, true );
- aOle.GetFlags() |= 4;
- if( !aOle.Store() )
- SetError( aOle.GetError() );
- }
-}
-
SvGlobalName Storage::GetClassName()
{
StgCompObjStream aCompObj( *this, false );
@@ -1005,18 +918,6 @@ OUString Storage::GetUserName()
return OUString();
}
-bool Storage::ShouldConvert()
-{
- StgOleStream aOle( *this, false );
- if( aOle.Load() )
- return ( aOle.GetFlags() & 4 ) != 0;
- else
- {
- pIo->ResetError();
- return false;
- }
-}
-
bool Storage::ValidateFAT()
{
Link<> aLink = StgIo::GetErrorLink();
@@ -1046,11 +947,6 @@ const ClsId& Storage::GetClassId() const
return aDummyId;
}
-const SvStream* Storage::GetSvStream() const
-{
- return GetSvStream_Impl();
-}
-
bool Storage::Validate( bool bValidate ) const
{
bool bRet = Validate_Impl( bValidate );
diff --git a/sot/source/sdstor/stgcache.hxx b/sot/source/sdstor/stgcache.hxx
index bef0c76bd49b..64c3d9e86034 100644
--- a/sot/source/sdstor/stgcache.hxx
+++ b/sot/source/sdstor/stgcache.hxx
@@ -74,7 +74,6 @@ public:
void SetStrm( UCBStorageStream* );
bool IsWritable() { return ( pStrm && pStrm->IsWritable() ); }
bool Good() { return nError == SVSTREAM_OK; }
- bool Bad() { return nError != SVSTREAM_OK; }
sal_uLong GetError() { return nError; }
void MoveError( StorageBase& );
void SetError( sal_uLong );
diff --git a/sot/source/sdstor/stgdir.hxx b/sot/source/sdstor/stgdir.hxx
index 3f762d9796ec..c0924f1bf3af 100644
--- a/sot/source/sdstor/stgdir.hxx
+++ b/sot/source/sdstor/stgdir.hxx
@@ -74,7 +74,6 @@ public:
void SetDirty() { bDirty = true; }
bool IsDirty();
- void ClearDirty();
bool Commit();
bool Revert();
@@ -84,7 +83,6 @@ public:
sal_Int32 GetSize();
bool SetSize( sal_Int32 );
sal_Int32 Seek( sal_Int32 );
- sal_Int32 Tell() { return nPos; }
sal_Int32 Read( void*, sal_Int32 );
sal_Int32 Write( const void*, sal_Int32 );
void Copy( BaseStorageStream& );
@@ -105,7 +103,6 @@ public:
StgDirEntry* GetRoot() { return pRoot; }
StgDirEntry* Find( StgDirEntry&, const OUString& );
StgDirEntry* Create( StgDirEntry&, const OUString&, StgEntryType );
- bool Remove( StgDirEntry&, const OUString& );
bool Rename( StgDirEntry&, const OUString&, const OUString& );
bool Move( StgDirEntry&, StgDirEntry&, const OUString& );
};
diff --git a/sot/source/sdstor/stgelem.hxx b/sot/source/sdstor/stgelem.hxx
index 385ee9b25348..0a8bcc90356d 100644
--- a/sot/source/sdstor/stgelem.hxx
+++ b/sot/source/sdstor/stgelem.hxx
@@ -62,7 +62,6 @@ public:
bool Load( SvStream& );
bool Store( StgIo& );
bool Check(); // check the signature and version
- short GetByteOrder() const { return nByteOrder; }
sal_Int32 GetTOCStart() const { return nTOCstrm; }
void SetTOCStart( sal_Int32 n );
sal_Int32 GetDataFATStart() const { return nDataFAT; }
@@ -79,7 +78,6 @@ public:
sal_Int32 GetMasters() const { return nMaster; }
void SetMasters( sal_Int32 n );
static short GetFAT1Size() { return cFATPagesInHeader; }
- const ClsId& GetClassId() const { return aClsId; }
sal_Int32 GetFATPage( short ) const;
void SetFATPage( short, sal_Int32 );
};
@@ -136,8 +134,6 @@ public:
StgEntryType GetType() const { return (StgEntryType) cType; }
sal_Int32 GetStartPage() const { return nPage1; }
void SetType( StgEntryType t ) { cType = (sal_uInt8) t; }
- sal_uInt8 GetFlags() const { return cFlags; }
- void SetFlags( sal_uInt8 c ) { cFlags = c; }
sal_Int32 GetSize() const { return nSize; }
void SetSize( sal_Int32 n ) { nSize = n; }
const ClsId& GetClassId() const { return aClsId; }
diff --git a/sot/source/sdstor/stgstrms.cxx b/sot/source/sdstor/stgstrms.cxx