[Libreoffice-commits] .: 12 commits - editeng/source framework/source RepositoryExternal.mk sc/source tools/inc tools/qa tools/source unusedcode.easy vcl/generic vcl/inc
Caolán McNamara
caolan at kemper.freedesktop.org
Mon Jan 16 02:25:07 PST 2012
RepositoryExternal.mk | 6 -
editeng/source/editeng/impedit4.cxx | 6 -
framework/source/services/autorecovery.cxx | 18 ++---
sc/source/ui/dbgui/scuiasciiopt.cxx | 4 -
sc/source/ui/docshell/impex.cxx | 20 +++--
sc/source/ui/inc/impex.hxx | 2
tools/inc/tools/stream.hxx | 2
tools/qa/cppunit/test_stream.cxx | 97 +++++++++++++++++++++++++++++
tools/source/rc/resmgr.cxx | 8 --
tools/source/stream/stream.cxx | 8 --
unusedcode.easy | 5 +
vcl/generic/fontmanager/fontcache.cxx | 14 ----
vcl/generic/fontmanager/fontconfig.cxx | 16 ++--
vcl/inc/fontcache.hxx | 2
vcl/inc/salsys.hxx | 2
15 files changed, 143 insertions(+), 67 deletions(-)
New commits:
commit e2260726ae54a25b26b86f35c4148d20d4b823d3
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jan 16 10:07:18 2012 +0000
Same expression on both sides of '-'
diff --git a/vcl/generic/fontmanager/fontconfig.cxx b/vcl/generic/fontmanager/fontconfig.cxx
index a5d1c15..4fd5d9e 100644
--- a/vcl/generic/fontmanager/fontconfig.cxx
+++ b/vcl/generic/fontmanager/fontconfig.cxx
@@ -165,13 +165,13 @@ namespace
{
FcChar8 *pNameA=NULL, *pNameB=NULL;
- bool bHaveA = FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch;
- bool bHaveB = FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch;
+ int nHaveA = FcPatternGetString(a, FC_FAMILY, 0, &pNameA) == FcResultMatch;
+ int nHaveB = FcPatternGetString(b, FC_FAMILY, 0, &pNameB) == FcResultMatch;
- if (bHaveA && bHaveB)
+ if (nHaveA && nHaveB)
return strcmp((const char*)pNameA, (const char*)pNameB);
- return bHaveA - bHaveB;
+ return nHaveA - nHaveB;
}
//Sort fonts so that fonts with the same family name are side-by-side, with
@@ -187,13 +187,13 @@ namespace
int nVersionA=0, nVersionB=0;
- bool bHaveA = FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch;
- bool bHaveB = FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch;
+ int nHaveA = FcPatternGetInteger(a, FC_FONTVERSION, 0, &nVersionA) == FcResultMatch;
+ int nHaveB = FcPatternGetInteger(b, FC_FONTVERSION, 0, &nVersionB) == FcResultMatch;
- if (bHaveA && bHaveB)
+ if (nHaveA && nHaveB)
return nVersionA > nVersionB;
- return bHaveA - bHaveA;
+ return nHaveA > nHaveB;
}
};
commit 27951fd37d9a4b506adacb3c12395e7504422a14
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jan 16 09:03:09 2012 +0000
SEARCH_PATH_DELIMITER is the same as SAL_PATHSEPARATOR
diff --git a/tools/source/rc/resmgr.cxx b/tools/source/rc/resmgr.cxx
index 68c8b4c..9860586 100644
--- a/tools/source/rc/resmgr.cxx
+++ b/tools/source/rc/resmgr.cxx
@@ -56,12 +56,6 @@
#include <list>
#include <set>
-#ifdef UNX
-#define SEARCH_PATH_DELIMITER ':'
-#else
-#define SEARCH_PATH_DELIMITER ';'
-#endif
-
using ::rtl::OUString;
using ::rtl::OString;
using ::rtl::OUStringBuffer;
@@ -209,7 +203,7 @@ void ResMgrContainer::init()
nIndex = 0;
while( nIndex >= 0 )
{
- OUString aPathElement( aEnvPath.getToken( 0, SEARCH_PATH_DELIMITER, nIndex ) );
+ OUString aPathElement( aEnvPath.getToken( 0, SAL_PATHSEPARATOR, nIndex ) );
if( aPathElement.getLength() )
{
OUString aFileURL;
commit 1ac9ccfbb696759efdbe426e6954495db870a000
Author: Caolán McNamara <caolanm at redhat.com>
Date: Mon Jan 16 08:57:38 2012 +0000
be consistent in include ordering
diff --git a/RepositoryExternal.mk b/RepositoryExternal.mk
index 1a4e0fd..91ff7a3 100644
--- a/RepositoryExternal.mk
+++ b/RepositoryExternal.mk
@@ -217,8 +217,8 @@ ifeq ($(SYSTEM_LIBCMIS),YES)
define gb_LinkTarget__use_cmis
$(call gb_LinkTarget_set_include,$(1),\
- $(LIBCMIS_CFLAGS) \
$$(INCLUDE) \
+ $(LIBCMIS_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(LIBCMIS_LIBS))
@@ -348,8 +348,8 @@ $(call gb_LinkTarget_add_defs,$(1),\
)
$(call gb_LinkTarget_set_include,$(1),\
- $(NEON_CFLAGS) \
$$(INCLUDE) \
+ $(NEON_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(NEON_LIBS))
@@ -807,8 +807,8 @@ endif # SYSTEM_LPSOLVE
define gb_LinkTarget__use_gio
$(call gb_LinkTarget_set_include,$(1),\
- $(GIO_CFLAGS) \
$$(INCLUDE) \
+ $(GIO_CFLAGS) \
)
$(call gb_LinkTarget_add_libs,$(1),$(GIO_LIBS))
commit 9790e4457f14950b83a0746e00f986d76cf1ca36
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Jan 15 20:41:19 2012 +0000
document with unit test rather suspicious eof handling
ReadLine differs from std::getline with respect to final lines
that end at EOF with no EOL.
i.e. see Export::ConvertLineEnds in l10ntools/source/export2.cxx
which doesn't make a massive amount of sense the way things currently are.
diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx
index f4647ff..107d1c1 100644
--- a/tools/qa/cppunit/test_stream.cxx
+++ b/tools/qa/cppunit/test_stream.cxx
@@ -130,6 +130,25 @@ namespace
CPPUNIT_ASSERT(tools_a == 'f');
//failbit is rather subtle wrt e.g seeks
+
+ char buffer[1024];
+
+ iss.clear();
+ iss.seekg(0);
+ CPPUNIT_ASSERT(iss.good());
+ iss.read(buffer, sizeof(buffer));
+ CPPUNIT_ASSERT(iss.gcount() == 3);
+ CPPUNIT_ASSERT(!iss.good());
+ CPPUNIT_ASSERT(!iss.bad());
+ CPPUNIT_ASSERT(iss.eof());
+
+ aMemStream.Seek(0);
+ CPPUNIT_ASSERT(aMemStream.good());
+ sal_Size nRet = aMemStream.Read(buffer, sizeof(buffer));
+ CPPUNIT_ASSERT(nRet == 3);
+ CPPUNIT_ASSERT(!aMemStream.good());
+ CPPUNIT_ASSERT(!aMemStream.bad());
+ CPPUNIT_ASSERT(aMemStream.eof());
}
void Test::test_fastostring()
@@ -247,14 +266,14 @@ namespace
CPPUNIT_ASSERT(bRet);
//This is the weird current behavior where an embedded null is read but
//discarded
- CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("foobar")));
+ CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("foobar"))); //<--diff A
CPPUNIT_ASSERT(aMemStream.good());
std::string sStr(RTL_CONSTASCII_STRINGPARAM(foo));
std::istringstream iss(sStr, std::istringstream::in);
std::getline(iss, sStr, '\n');
//embedded null read as expected
- CPPUNIT_ASSERT(sStr.size() == 7 && sStr[3] == 0);
+ CPPUNIT_ASSERT(sStr.size() == 7 && sStr[3] == 0); //<--diff A
CPPUNIT_ASSERT(iss.good());
bRet = aMemStream.ReadLine(aFoo);
@@ -275,7 +294,18 @@ namespace
CPPUNIT_ASSERT(sStr.empty());
CPPUNIT_ASSERT(iss.eof() && !iss.bad());
- }
+ char bar[] = "foo";
+ SvMemoryStream aMemStreamB(RTL_CONSTASCII_STRINGPARAM(bar), STREAM_READ);
+ bRet = aMemStreamB.ReadLine(aFoo);
+ CPPUNIT_ASSERT(bRet);
+ CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("foo")));
+ CPPUNIT_ASSERT(!aMemStreamB.eof()); //<-- diff B
+
+ std::istringstream issB(bar, std::istringstream::in);
+ std::getline(issB, sStr, '\n');
+ CPPUNIT_ASSERT(sStr == "foo");
+ CPPUNIT_ASSERT(issB.eof()); //<-- diff B
+ }
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
commit 67270ddc7c0b203c774a3d78e48d07535c54c0da
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sun Jan 15 12:23:11 2012 +0000
one bug display->one big display
diff --git a/vcl/inc/salsys.hxx b/vcl/inc/salsys.hxx
index ea95234..001a8a9 100644
--- a/vcl/inc/salsys.hxx
+++ b/vcl/inc/salsys.hxx
@@ -75,7 +75,7 @@ public:
virtual unsigned int GetDisplayScreenCount() = 0;
/* Queries whether multiple screens are part of one bigger display
- @returns true if screens form one bug display
+ @returns true if screens form one big display
false if screens are distinct and windows cannot
be moved between, or span multiple screens
*/
commit 456853e96cc37bf817410366f0b94d6890e0ba00
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Jan 14 14:55:14 2012 +0000
document with unit test rather odd embedded null handling
diff --git a/tools/qa/cppunit/test_stream.cxx b/tools/qa/cppunit/test_stream.cxx
index 3e7580f..f4647ff 100644
--- a/tools/qa/cppunit/test_stream.cxx
+++ b/tools/qa/cppunit/test_stream.cxx
@@ -48,12 +48,14 @@ namespace
void test_fastostring();
void test_read_cstring();
void test_read_pstring();
+ void test_readline();
CPPUNIT_TEST_SUITE(Test);
CPPUNIT_TEST(test_stdstream);
CPPUNIT_TEST(test_fastostring);
CPPUNIT_TEST(test_read_cstring);
CPPUNIT_TEST(test_read_pstring);
+ CPPUNIT_TEST(test_readline);
CPPUNIT_TEST_SUITE_END();
};
@@ -210,6 +212,71 @@ namespace
CPPUNIT_ASSERT(!aMemStream.eof());
}
+ void Test::test_readline()
+ {
+ char foo[] = "foo\nbar\n\n";
+ SvMemoryStream aMemStream(RTL_CONSTASCII_STRINGPARAM(foo), STREAM_READ);
+
+ rtl::OString aFoo;
+ sal_Bool bRet;
+
+ bRet = aMemStream.ReadLine(aFoo);
+ CPPUNIT_ASSERT(bRet);
+ CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("foo")));
+ CPPUNIT_ASSERT(aMemStream.good());
+
+ bRet = aMemStream.ReadLine(aFoo);
+ CPPUNIT_ASSERT(bRet);
+ CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("bar")));
+ CPPUNIT_ASSERT(aMemStream.good());
+
+ bRet = aMemStream.ReadLine(aFoo);
+ CPPUNIT_ASSERT(bRet);
+ CPPUNIT_ASSERT(aFoo.isEmpty());
+ CPPUNIT_ASSERT(aMemStream.good());
+
+ bRet = aMemStream.ReadLine(aFoo);
+ CPPUNIT_ASSERT(!bRet);
+ CPPUNIT_ASSERT(aFoo.isEmpty());
+ CPPUNIT_ASSERT(aMemStream.eof());
+
+ foo[3] = 0; //test reading embedded nulls
+
+ aMemStream.Seek(0);
+ bRet = aMemStream.ReadLine(aFoo);
+ CPPUNIT_ASSERT(bRet);
+ //This is the weird current behavior where an embedded null is read but
+ //discarded
+ CPPUNIT_ASSERT(aFoo.equalsL(RTL_CONSTASCII_STRINGPARAM("foobar")));
+ CPPUNIT_ASSERT(aMemStream.good());
+
+ std::string sStr(RTL_CONSTASCII_STRINGPARAM(foo));
+ std::istringstream iss(sStr, std::istringstream::in);
+ std::getline(iss, sStr, '\n');
+ //embedded null read as expected
+ CPPUNIT_ASSERT(sStr.size() == 7 && sStr[3] == 0);
+ CPPUNIT_ASSERT(iss.good());
+
+ bRet = aMemStream.ReadLine(aFoo);
+ CPPUNIT_ASSERT(bRet);
+ CPPUNIT_ASSERT(aFoo.isEmpty());
+ CPPUNIT_ASSERT(aMemStream.good());
+
+ std::getline(iss, sStr, '\n');
+ CPPUNIT_ASSERT(sStr.empty());
+ CPPUNIT_ASSERT(iss.good());
+
+ bRet = aMemStream.ReadLine(aFoo);
+ CPPUNIT_ASSERT(!bRet);
+ CPPUNIT_ASSERT(aFoo.isEmpty());
+ CPPUNIT_ASSERT(aMemStream.eof() && !aMemStream.bad());
+
+ std::getline(iss, sStr, '\n');
+ CPPUNIT_ASSERT(sStr.empty());
+ CPPUNIT_ASSERT(iss.eof() && !iss.bad());
+
+ }
+
CPPUNIT_TEST_SUITE_REGISTRATION(Test);
}
commit a8742cecc157a28f293107013d6b35ce8a342382
Author: Caolán McNamara <caolanm at redhat.com>
Date: Sat Jan 14 10:32:31 2012 +0000
convert some old-school ByteStrings
diff --git a/tools/source/stream/stream.cxx b/tools/source/stream/stream.cxx
index fea6025..08559ad 100644
--- a/tools/source/stream/stream.cxx
+++ b/tools/source/stream/stream.cxx
@@ -629,11 +629,9 @@ void SvStream::ResetError()
sal_Bool SvStream::ReadByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet )
{
- sal_Bool bRet;
- ByteString aStr;
-
- bRet = ReadLine(aStr);
- rStr = UniString( aStr, eSrcCharSet );
+ rtl::OString aStr;
+ sal_Bool bRet = ReadLine(aStr);
+ rStr = rtl::OStringToOUString(aStr, eSrcCharSet);
return bRet;
}
commit 4abfd463edd482389d83d75fe223a4a26aed7cb1
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 13 23:24:50 2012 +0000
force users of WriteByteStringLine to explictly denote encoding
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 54deb88..f76b0ca 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -270,7 +270,7 @@ sal_uInt32 ImpEditEngine::WriteText( SvStream& rOutput, EditSelection aSel )
nEndPos = aSel.Max().GetIndex();
}
XubString aTmpStr = aEditDoc.GetParaAsString( pNode, nStartPos, nEndPos );
- rOutput.WriteByteStringLine( aTmpStr );
+ rOutput.WriteByteStringLine( aTmpStr, rOutput.GetStreamCharSet() );
}
return rOutput.GetError();
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 0205d2c..e96f3e1 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -385,7 +385,6 @@ public:
sal_Bool ReadByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet );
sal_Bool WriteByteStringLine( const String& rStr, rtl_TextEncoding eDestCharSet );
- sal_Bool WriteByteStringLine( const String& rStr ) { return WriteByteStringLine( rStr, GetStreamCharSet()); }
/// Switch to no endian swapping and write 0xfeff
sal_Bool StartWritingUnicodeText();
commit 9d4d7272507c6a9c7ede239df9243103fce46dbf
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 13 23:21:48 2012 +0000
force users of ReadByteStringLine to explictly denote encoding
diff --git a/editeng/source/editeng/impedit4.cxx b/editeng/source/editeng/impedit4.cxx
index 6bdbba6..54deb88 100644
--- a/editeng/source/editeng/impedit4.cxx
+++ b/editeng/source/editeng/impedit4.cxx
@@ -132,13 +132,13 @@ EditPaM ImpEditEngine::ReadText( SvStream& rInput, EditSelection aSel )
EditPaM aPaM = aSel.Max();
XubString aTmpStr, aStr;
- sal_Bool bDone = rInput.ReadByteStringLine( aTmpStr );
+ sal_Bool bDone = rInput.ReadByteStringLine( aTmpStr, rInput.GetStreamCharSet() );
while ( bDone )
{
aTmpStr.Erase( MAXCHARSINPARA );
aPaM = ImpInsertText( EditSelection( aPaM, aPaM ), aTmpStr );
aPaM = ImpInsertParaBreak( aPaM );
- bDone = rInput.ReadByteStringLine( aTmpStr );
+ bDone = rInput.ReadByteStringLine( aTmpStr, rInput.GetStreamCharSet() );
}
return aPaM;
}
diff --git a/tools/inc/tools/stream.hxx b/tools/inc/tools/stream.hxx
index 4f06610..0205d2c 100644
--- a/tools/inc/tools/stream.hxx
+++ b/tools/inc/tools/stream.hxx
@@ -384,7 +384,6 @@ public:
sal_Bool WriteLines( const ByteString& rStr );
sal_Bool ReadByteStringLine( String& rStr, rtl_TextEncoding eSrcCharSet );
- sal_Bool ReadByteStringLine( String& rStr ) { return ReadByteStringLine( rStr, GetStreamCharSet()); }
sal_Bool WriteByteStringLine( const String& rStr, rtl_TextEncoding eDestCharSet );
sal_Bool WriteByteStringLine( const String& rStr ) { return WriteByteStringLine( rStr, GetStreamCharSet()); }
commit d3bda969c6a126cfa2742b9adba142cb7f316d56
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 13 23:13:52 2012 +0000
just return a new string rather than pass by reference
diff --git a/sc/source/ui/dbgui/scuiasciiopt.cxx b/sc/source/ui/dbgui/scuiasciiopt.cxx
index 834d0cc..17d0b2a 100644
--- a/sc/source/ui/dbgui/scuiasciiopt.cxx
+++ b/sc/source/ui/dbgui/scuiasciiopt.cxx
@@ -476,7 +476,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, String &rText )
bRet = false;
break;
}
- ReadCsvLine(*mpDatStream, rText, !bFixed, maFieldSeparators,
+ rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators,
mcTextSep);
mnStreamPos = mpDatStream->Tell();
mpRowPosArray[++mnRowPosCount] = mnStreamPos;
@@ -494,7 +494,7 @@ bool ScImportAsciiDlg::GetLine( sal_uLong nLine, String &rText )
else
{
Seek( mpRowPosArray[nLine]);
- ReadCsvLine(*mpDatStream, rText, !bFixed, maFieldSeparators, mcTextSep);
+ rText = ReadCsvLine(*mpDatStream, !bFixed, maFieldSeparators, mcTextSep);
mnStreamPos = mpDatStream->Tell();
}
diff --git a/sc/source/ui/docshell/impex.cxx b/sc/source/ui/docshell/impex.cxx
index b7922b3..2c99ac9 100644
--- a/sc/source/ui/docshell/impex.cxx
+++ b/sc/source/ui/docshell/impex.cxx
@@ -1180,7 +1180,7 @@ sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
while(--nSkipLines>0)
{
- ReadCsvLine(rStrm, aLine, !bFixed, rSeps, cStr); // content is ignored
+ aLine = ReadCsvLine(rStrm, !bFixed, rSeps, cStr); // content is ignored
if ( rStrm.IsEof() )
break;
}
@@ -1203,7 +1203,7 @@ sal_Bool ScImportExport::ExtText2Doc( SvStream& rStrm )
{
for( ;; )
{
- ReadCsvLine(rStrm, aLine, !bFixed, rSeps, cStr);
+ aLine = ReadCsvLine(rStrm, !bFixed, rSeps, cStr);
if ( rStrm.IsEof() )
break;
@@ -2123,11 +2123,12 @@ inline const sal_Unicode* lcl_UnicodeStrChr( const sal_Unicode* pStr,
return 0;
}
-void ReadCsvLine(SvStream &rStream, String& rStr, sal_Bool bEmbeddedLineBreak,
+String ReadCsvLine(SvStream &rStream, sal_Bool bEmbeddedLineBreak,
const String& rFieldSeparators, sal_Unicode cFieldQuote,
sal_Bool bAllowBackslashEscape)
{
- rStream.ReadUniOrByteStringLine(rStr, rStream.GetStreamCharSet());
+ String aStr;
+ rStream.ReadUniOrByteStringLine(aStr, rStream.GetStreamCharSet());
if (bEmbeddedLineBreak)
{
@@ -2138,11 +2139,11 @@ void ReadCsvLine(SvStream &rStream, String& rStr, sal_Bool bEmbeddedLineBreak,
xub_StrLen nLastOffset = 0;
xub_StrLen nQuotes = 0;
- while (!rStream.IsEof() && rStr.Len() < STRING_MAXLEN)
+ while (!rStream.IsEof() && aStr.Len() < STRING_MAXLEN)
{
bool bBackslashEscaped = false;
const sal_Unicode *p, *pStart;
- p = pStart = rStr.GetBuffer();
+ p = pStart = aStr.GetBuffer();
p += nLastOffset;
while (*p)
{
@@ -2180,14 +2181,15 @@ void ReadCsvLine(SvStream &rStream, String& rStr, sal_Bool bEmbeddedLineBreak,
break;
else
{
- nLastOffset = rStr.Len();
+ nLastOffset = aStr.Len();
String aNext;
rStream.ReadUniOrByteStringLine(aNext, rStream.GetStreamCharSet());
- rStr += sal_Unicode(_LF);
- rStr += aNext;
+ aStr += sal_Unicode(_LF);
+ aStr += aNext;
}
}
}
+ return aStr;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/source/ui/inc/impex.hxx b/sc/source/ui/inc/impex.hxx
index 8ccfdd9..51bd610 100644
--- a/sc/source/ui/inc/impex.hxx
+++ b/sc/source/ui/inc/impex.hxx
@@ -239,7 +239,7 @@ public:
characters will be spoiled, and a subsequent ReadCsvLine()
may start under false preconditions.
*/
-SC_DLLPUBLIC void ReadCsvLine(SvStream &rStream, String& rStr, sal_Bool bEmbeddedLineBreak,
+SC_DLLPUBLIC String ReadCsvLine(SvStream &rStream, sal_Bool bEmbeddedLineBreak,
const String& rFieldSeparators, sal_Unicode cFieldQuote,
sal_Bool bAllowBackslashEscape = sal_False);
commit 1aec590757962088358bdc7de175766a671c873b
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 13 23:09:27 2012 +0000
convert low hanging Strings to OUString
diff --git a/framework/source/services/autorecovery.cxx b/framework/source/services/autorecovery.cxx
index 689cae9..b464c1c 100644
--- a/framework/source/services/autorecovery.cxx
+++ b/framework/source/services/autorecovery.cxx
@@ -2794,9 +2794,9 @@ void AutoRecovery::implts_generateNewTempURL(const ::rtl::OUString&
// TODO: Must we strip some illegal signes - if we use the title?
- String sName (sUniqueName.makeStringAndClear());
- String sExtension(rInfo.Extension );
- String sPath (sBackupPath );
+ rtl::OUString sName(sUniqueName.makeStringAndClear());
+ String sExtension(rInfo.Extension);
+ String sPath(sBackupPath);
::utl::TempFile aTempFile(sName, &sExtension, &sPath);
rInfo.NewTempURL = aTempFile.GetURL();
@@ -3483,16 +3483,16 @@ sal_Bool AutoRecovery::impl_enoughDiscSpace(sal_Int32 nRequiredSpace)
//-----------------------------------------------
void AutoRecovery::impl_showFullDiscError()
{
- static String PLACEHOLDER_PATH = String::CreateFromAscii("%PATH");
+ rtl::OUString PLACEHOLDER_PATH(RTL_CONSTASCII_USTRINGPARAM("%PATH"));
- String sBtn(FwkResId(STR_FULL_DISC_RETRY_BUTTON));
- String sMsg(FwkResId(STR_FULL_DISC_MSG ));
+ rtl::OUString sBtn(ResId::toString(FwkResId(STR_FULL_DISC_RETRY_BUTTON)));
+ String sMsg(ResId::toString(FwkResId(STR_FULL_DISC_MSG)));
- String sBackupURL(SvtPathOptions().GetBackupPath());
+ rtl::OUString sBackupURL(SvtPathOptions().GetBackupPath());
INetURLObject aConverter(sBackupURL);
sal_Unicode aDelimiter;
- String sBackupPath = aConverter.getFSysPath(INetURLObject::FSYS_DETECT, &aDelimiter);
- if (sBackupPath.Len()<1)
+ rtl::OUString sBackupPath = aConverter.getFSysPath(INetURLObject::FSYS_DETECT, &aDelimiter);
+ if (sBackupPath.getLength() < 1)
sBackupPath = sBackupURL;
sMsg.SearchAndReplace(PLACEHOLDER_PATH, sBackupPath);
commit 54cf331a96429212c1ed0041c003840a760d75fa
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jan 13 22:54:14 2012 +0000
callcatcher: update list, updateDirTimestamp now unused
diff --git a/unusedcode.easy b/unusedcode.easy
index 20ea8da..26f593d 100644
--- a/unusedcode.easy
+++ b/unusedcode.easy
@@ -257,6 +257,10 @@ ScDPCache::GetAdditionalItemID(String const&) const
ScDPCache::GetDimNumType(short) const
ScDPCache::GetSortedItemData(short, int) const
ScDPCache::IsEmptyMember(int, unsigned short) const
+ScDPCollection::DBCaches::removeCache(int, rtl::OUString const&, rtl::OUString const&)
+ScDPCollection::DBCaches::size() const
+ScDPCollection::NameCaches::removeCache(rtl::OUString const&)
+ScDPCollection::SheetCaches::removeCache(ScRange const&)
ScDPFieldControlBase::GetParentDlg() const
ScDPFieldControlBase::ModifySelectionOffset(long)
ScDPFieldControlBase::SetSelectedField(unsigned long)
@@ -1748,7 +1752,6 @@ pdfi::PDFIProcessor::sortDocument(bool)
pdfi::PDFIRawAdaptor::odfConvert(rtl::OUString const&, com::sun::star::uno::Reference<com::sun::star::io::XOutputStream> const&, com::sun::star::uno::Reference<com::sun::star::task::XStatusIndicator> const&)
pdfparse::PDFReader::read(char const*, unsigned int)
psp::GetCommandLineTokenCount(rtl::OString const&)
-psp::PrintFontManager::getXLFD(psp::PrintFontManager::PrintFont*) const
psp::PrinterGfx::DrawBitmap(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, psp::PrinterBmp const&)
psp::PrinterGfx::DrawMask(Rectangle const&, Rectangle const&, psp::PrinterBmp const&, psp::PrinterColor&)
psp::PrinterGfx::GetGlyphBoundRect(unsigned short, Rectangle&)
diff --git a/vcl/generic/fontmanager/fontcache.cxx b/vcl/generic/fontmanager/fontcache.cxx
index 2e9ab9b..be9df03 100644
--- a/vcl/generic/fontmanager/fontcache.cxx
+++ b/vcl/generic/fontmanager/fontcache.cxx
@@ -502,20 +502,6 @@ void FontCache::read()
}
/*
- * FontCache::updateDirTimestamp
- */
-void FontCache::updateDirTimestamp( int nDirID )
-{
- PrintFontManager& rManager( PrintFontManager::get() );
- const OString& rDir = rManager.getDirectory( nDirID );
-
- struct stat aStat;
- if( ! stat( rDir.getStr(), &aStat ) )
- m_aCache[ nDirID ].m_nTimestamp = (sal_Int64)aStat.st_mtime;
-}
-
-
-/*
* FontCache::copyPrintFont
*/
void FontCache::copyPrintFont( const PrintFontManager::PrintFont* pFrom, PrintFontManager::PrintFont* pTo ) const
diff --git a/vcl/inc/fontcache.hxx b/vcl/inc/fontcache.hxx
index fd1b8cd..ac27fb9 100644
--- a/vcl/inc/fontcache.hxx
+++ b/vcl/inc/fontcache.hxx
@@ -91,8 +91,6 @@ public:
bool scanAdditionalFiles( const rtl::OString& rDir );
void flush();
-
- void updateDirTimestamp( int nDirID );
};
} // namespace psp
More information about the Libreoffice-commits
mailing list