[Libreoffice-commits] core.git: 4 commits - cui/source fpicker/source include/tools sc/source sfx2/source svtools/source sw/source tools/source
Tor Lillqvist
tml at collabora.com
Tue Apr 1 02:15:12 PDT 2014
cui/source/dialogs/linkdlg.cxx | 4 -
fpicker/source/office/iodlg.cxx | 4 -
include/tools/urlobj.hxx | 16 ----
sc/source/core/tool/compiler.cxx | 4 -
sc/source/ui/view/gridwin5.cxx | 2
sc/source/ui/view/tabvwsh3.cxx | 2
sfx2/source/appl/macroloader.cxx | 6 -
sfx2/source/doc/objmisc.cxx | 2
sfx2/source/notify/eventsupplier.cxx | 2
svtools/source/control/inettbc.cxx | 1
svtools/source/misc/imagemgr.cxx | 8 +-
sw/source/core/doc/docdde.cxx | 2
sw/source/core/doc/tblafmt.cxx | 2
sw/source/core/doc/visiturl.cxx | 2
sw/source/core/text/EnhancedPDFExportHelper.cxx | 2
sw/source/core/uibase/config/uinums.cxx | 4 -
sw/source/core/uibase/dbui/dbmgr.cxx | 2
sw/source/core/uibase/misc/glosdoc.cxx | 2
sw/source/core/uibase/shells/grfsh.cxx | 2
sw/source/core/uibase/uiview/view2.cxx | 2
sw/source/core/uibase/uno/unomailmerge.cxx | 2
sw/source/core/uibase/utlui/content.cxx | 6 -
sw/source/core/uibase/utlui/gloslst.cxx | 2
sw/source/filter/html/htmlgrin.cxx | 2
sw/source/filter/ww8/wrtw8nds.cxx | 2
sw/source/filter/ww8/wrtww8.cxx | 2
sw/source/filter/ww8/ww8par5.cxx | 4 -
sw/source/ui/chrdlg/chardlg.cxx | 2
sw/source/ui/dialog/uiregionsw.cxx | 6 -
sw/source/ui/envelp/mailmrge.cxx | 5 -
sw/source/ui/frmdlg/frmpage.cxx | 4 -
sw/source/ui/index/cnttab.cxx | 2
sw/source/ui/misc/glosbib.cxx | 2
sw/source/ui/misc/glossary.cxx | 2
tools/source/fsys/urlobj.cxx | 94 ++----------------------
35 files changed, 59 insertions(+), 149 deletions(-)
New commits:
commit 856c749963b04604a52235a96b5af183fdf5125d
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Apr 1 10:51:15 2014 +0300
Kill FSYS_MAC which is for ancient non-OS X Mac
Change-Id: I51e91b97217507bcdca8c82f8a8683758d871185
diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx
index 53027c8..ace1d76 100644
--- a/include/tools/urlobj.hxx
+++ b/include/tools/urlobj.hxx
@@ -251,10 +251,6 @@ public:
*/
FSYS_DOS = 0x4,
- /** Mac notation (e.g., "dir:file").
- */
- FSYS_MAC = 0x8,
-
/** Detect the used notation.
@descr For the following descriptions, please note that
@@ -300,11 +296,10 @@ public:
becomes
"file:///" *UCS4
replacing the delimiter by "/" within <*UCS4>. The delimiter is
- that character from the set { "/", "\", ":" } which appears most
+ that character from the set { "/", "\" } which appears most
often in <*UCS4> (if FSYS_UNX is not among the style bits, "/"
is removed from the set; if FSYS_DOS is not among the style
- bits, "\" is removed from the set; if FSYS_MAC is not among the
- style bits, ":" is removed from the set). If two or more
+ bits, "\" is removed from the set). If two or more
characters appear the same number of times, the character
mentioned first in that set is chosen. If the first character
of <*UCS4> is the delimiter, that character is not copied.
@@ -843,7 +838,7 @@ public:
@param pDelimiter Upon successful return, this parameter can return
the character that is the 'main' delimiter within the returned file
- system path (e.g., "/" for Unix, "\" for DOS, ":" for Mac). This is
+ system path (e.g., "/" for Unix, "\" for DOS). This is
especially useful for routines that later try to shorten the returned
file system path at a 'good' position, e.g. to fit it into some
limited display space.
diff --git a/svtools/source/control/inettbc.cxx b/svtools/source/control/inettbc.cxx
index 6fe2ea3..8189d72 100644
--- a/svtools/source/control/inettbc.cxx
+++ b/svtools/source/control/inettbc.cxx
@@ -526,7 +526,6 @@ OUString SvtURLBox::ParseSmart( const OUString& _aText, const OUString& _aBaseUR
// take base URL and append current input
bool bWasAbsolute = false;
#ifdef UNX
- // don't support FSYS_MAC under Unix, because here ':' is a valid character for a filename
INetURLObject::FSysStyle eStyle = static_cast< INetURLObject::FSysStyle >( INetURLObject::FSYS_VOS | INetURLObject::FSYS_UNX | INetURLObject::FSYS_DOS );
// encode file URL correctly
aSmart = INetURLObject::encode( aSmart, INetURLObject::PART_FPATH, '%', INetURLObject::ENCODE_ALL );
diff --git a/tools/source/fsys/urlobj.cxx b/tools/source/fsys/urlobj.cxx
index 761e0dc..26b03d5 100644
--- a/tools/source/fsys/urlobj.cxx
+++ b/tools/source/fsys/urlobj.cxx
@@ -591,8 +591,7 @@ INetURLObject::FSysStyle guessFSysStyleByCounting(sal_Unicode const * pBegin,
{
DBG_ASSERT(eStyle
& (INetURLObject::FSYS_UNX
- | INetURLObject::FSYS_DOS
- | INetURLObject::FSYS_MAC),
+ | INetURLObject::FSYS_DOS),
"guessFSysStyleByCounting(): Bad style");
DBG_ASSERT(std::numeric_limits< sal_Int32 >::min() < pBegin - pEnd
&& pEnd - pBegin <= std::numeric_limits< sal_Int32 >::max(),
@@ -603,9 +602,6 @@ INetURLObject::FSysStyle guessFSysStyleByCounting(sal_Unicode const * pBegin,
sal_Int32 nBackslashCount
= eStyle & INetURLObject::FSYS_DOS ?
0 : std::numeric_limits< sal_Int32 >::min();
- sal_Int32 nColonCount
- = eStyle & INetURLObject::FSYS_MAC ?
- 0 : std::numeric_limits< sal_Int32 >::min();
while (pBegin != pEnd)
switch (*pBegin++)
{
@@ -616,16 +612,9 @@ INetURLObject::FSysStyle guessFSysStyleByCounting(sal_Unicode const * pBegin,
case '\\':
++nBackslashCount;
break;
-
- case ':':
- ++nColonCount;
- break;
}
return nSlashCount >= nBackslashCount ?
- nSlashCount >= nColonCount ?
- INetURLObject::FSYS_UNX : INetURLObject::FSYS_MAC :
- nBackslashCount >= nColonCount ?
- INetURLObject::FSYS_DOS : INetURLObject::FSYS_MAC;
+ INetURLObject::FSYS_UNX : INetURLObject::FSYS_DOS;
}
OUString parseScheme(
@@ -1126,17 +1115,16 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef,
// becomes
// "file:///" *path ["#" *UCS4]
// replacing the delimiter by "/" within <*path>. The
- // delimiter is that character from the set { "/", "\",
- // ":" } which appears most often in <*path> (if FSYS_UNX
+ // delimiter is that character from the set { "/", "\"}
+ // which appears most often in <*path> (if FSYS_UNX
// is not among the style bits, "/" is removed from the
// set; if FSYS_DOS is not among the style bits, "\" is
- // removed from the set; if FSYS_MAC is not among the
- // style bits, ":" is removed from the set). If two or
+ // removed from the set). If two or
// more characters appear the same number of times, the
// character mentioned first in that set is chosen. If
// the first character of <*path> is the delimiter, that
- // character is not copied.
- if (eStyle & (FSYS_UNX | FSYS_DOS | FSYS_MAC))
+ // character is not copied
+ if (eStyle & (FSYS_UNX | FSYS_DOS))
{
aSynAbsURIRef.appendAscii("//");
switch (guessFSysStyleByCounting(pPos, pEnd, eStyle))
@@ -1149,10 +1137,6 @@ bool INetURLObject::setAbsURIRef(OUString const & rTheAbsURIRef,
nSegmentDelimiter = '\\';
break;
- case FSYS_MAC:
- nSegmentDelimiter = ':';
- break;
-
default:
OSL_FAIL(
"INetURLObject::setAbsURIRef():"
@@ -1568,11 +1552,6 @@ bool INetURLObject::convertRelToAbs(OUString const & rTheRelURIRef,
bRelativeNonURIs = true;
break;
- case FSYS_MAC:
- nSegmentDelimiter = ':';
- bRelativeNonURIs = true;
- break;
-
default:
OSL_FAIL("INetURLObject::convertRelToAbs():"
" Bad guessFSysStyleByCounting");
@@ -4593,8 +4572,7 @@ bool INetURLObject::setFSysPath(OUString const & rFSysPath,
switch ((eStyle & FSYS_VOS ? 1 : 0)
+ (eStyle & FSYS_UNX ? 1 : 0)
- + (eStyle & FSYS_DOS ? 1 : 0)
- + (eStyle & FSYS_MAC ? 1 : 0))
+ + (eStyle & FSYS_DOS ? 1 : 0))
{
case 0:
return false;
@@ -4653,7 +4631,7 @@ bool INetURLObject::setFSysPath(OUString const & rFSysPath,
break;
}
- if (!(eStyle & (FSYS_UNX | FSYS_DOS | FSYS_MAC)))
+ if (!(eStyle & (FSYS_UNX | FSYS_DOS)))
return false;
eStyle = guessFSysStyleByCounting(pFSysBegin, pFSysEnd, eStyle);
@@ -4743,30 +4721,6 @@ bool INetURLObject::setFSysPath(OUString const & rFSysPath,
break;
}
- case FSYS_MAC:
- aSynAbsURIRef.append('/');
- for (sal_Unicode const * p = pFSysBegin; p != pFSysEnd; ++p)
- {
- switch (*p)
- {
- case ':':
- aSynAbsURIRef.append('/');
- break;
-
- case '/':
- case '|':
- case '#':
- case '%':
- appendEscape(aSynAbsURIRef, '%', *p);
- break;
-
- default:
- aSynAbsURIRef.append(*p);
- break;
- }
- }
- break;
-
default:
OSL_ASSERT(false);
break;
@@ -4790,7 +4744,6 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle,
if ((eStyle & FSYS_VOS ? 1 : 0)
+ (eStyle & FSYS_UNX ? 1 : 0)
+ (eStyle & FSYS_DOS ? 1 : 0)
- + (eStyle & FSYS_MAC ? 1 : 0)
> 1)
{
eStyle = eStyle & FSYS_VOS
@@ -4872,35 +4825,6 @@ OUString INetURLObject::getFSysPath(FSysStyle eStyle,
return aSynFSysPath.makeStringAndClear();
}
- case FSYS_MAC:
- {
- if (m_aHost.isPresent() && m_aHost.getLength() > 0)
- return OUString();
-
- if (pDelimiter)
- *pDelimiter = ':';
-
- OUStringBuffer aSynFSysPath;
- sal_Unicode const * p
- = m_aAbsURIRef.getStr() + m_aPath.getBegin();
- sal_Unicode const * pEnd = p + m_aPath.getLength();
- DBG_ASSERT(p < pEnd && *p == '/',
- "INetURLObject::getFSysPath(): Bad path");
- ++p;
- while (p < pEnd)
- {
- EscapeType eEscapeType;
- sal_uInt32 nUTF32 = getUTF32(p, pEnd, false, '%', WAS_ENCODED,
- RTL_TEXTENCODING_UTF8,
- eEscapeType);
- if (eEscapeType == ESCAPE_NO && nUTF32 == '/')
- aSynFSysPath.append(':');
- else
- aSynFSysPath.appendUtf32(nUTF32);
- }
- return aSynFSysPath.makeStringAndClear();
- }
-
default:
return OUString();
}
commit fe41e4ba11f66d247ca4b09563c3ea21728fa410
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Apr 1 08:48:58 2014 +0300
Bin pointless INET_HEX_ESCAPE
Change-Id: I72238e511c2fca4a4aba0be60b0f2d3b1f46e5c2
diff --git a/cui/source/dialogs/linkdlg.cxx b/cui/source/dialogs/linkdlg.cxx
index fa7ecfe..74ac8ec 100644
--- a/cui/source/dialogs/linkdlg.cxx
+++ b/cui/source/dialogs/linkdlg.cxx
@@ -225,7 +225,7 @@ IMPL_LINK( SvBaseLinksDlg, LinksSelectHdl, SvTabListBox *, pSvTabListBox )
OUString aFileName;
pLinkMgr->GetDisplayNames( pLink, &sType, &aFileName, pLinkNm, pFilter );
- aFileName = INetURLObject::decode(aFileName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS);
+ aFileName = INetURLObject::decode(aFileName, '%', INetURLObject::DECODE_UNAMBIGUOUS);
FileName().SetText( aFileName );
SourceName().SetText( sLink );
TypeName().SetText( sType );
@@ -640,7 +640,7 @@ void SvBaseLinksDlg::InsertEntry( const SvBaseLink& rLink, sal_uLong nPos, sal_B
OUString aTxt = Links().GetEllipsisString( sFileNm, nWidthPixel, TEXT_DRAW_PATHELLIPSIS );
INetURLObject aPath( sFileNm, INET_PROT_FILE );
OUString aFileName = aPath.getName();
- aFileName = INetURLObject::decode(aFileName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS);
+ aFileName = INetURLObject::decode(aFileName, '%', INetURLObject::DECODE_UNAMBIGUOUS);
if( aFileName.getLength() > aTxt.getLength() )
aTxt = aFileName;
diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx
index d400d51..53027c8 100644
--- a/include/tools/urlobj.hxx
+++ b/include/tools/urlobj.hxx
@@ -30,9 +30,6 @@ namespace com { namespace sun { namespace star { namespace util {
class XStringWidth;
} } } }
-// Special tokens:
-#define INET_HEX_ESCAPE '%'
-
// Common URL prefixes for various schemes:
#define INET_FTP_SCHEME "ftp://"
#define INET_HTTP_SCHEME "http://"
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 871d9c5..5d13c49 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -839,7 +839,7 @@ struct ConventionOOO_A1 : public Convention_A1
if (bEncodeUrl)
aFile = rFileName;
else
- aFile = INetURLObject::decode(rFileName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS);
+ aFile = INetURLObject::decode(rFileName, '%', INetURLObject::DECODE_UNAMBIGUOUS);
rBuffer.append("'" + aFile.replaceAll("'", "''") + "'#");
@@ -1069,7 +1069,7 @@ struct ConventionXL
if (bEncodeUrl)
aFullName = rFullName;
else
- aFullName = INetURLObject::decode(rFullName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS);
+ aFullName = INetURLObject::decode(rFullName, '%', INetURLObject::DECODE_UNAMBIGUOUS);
const sal_Unicode* pBuf = aFullName.getStr();
sal_Int32 nLen = aFullName.getLength();
diff --git a/sc/source/ui/view/gridwin5.cxx b/sc/source/ui/view/gridwin5.cxx
index 905f5ea..b35783c 100644
--- a/sc/source/ui/view/gridwin5.cxx
+++ b/sc/source/ui/view/gridwin5.cxx
@@ -371,7 +371,7 @@ void ScGridWindow::RequestHelp(const HelpEvent& rHEvt)
OUString aUrl;
if ( GetEditUrl( aPosPixel, NULL, &aUrl, NULL ) )
{
- aHelpText = INetURLObject::decode( aUrl, INET_HEX_ESCAPE,
+ aHelpText = INetURLObject::decode( aUrl, '%',
INetURLObject::DECODE_UNAMBIGUOUS );
if( bCtrlClickHlink )
diff --git a/sc/source/ui/view/tabvwsh3.cxx b/sc/source/ui/view/tabvwsh3.cxx
index d8d4827..cabe511 100644
--- a/sc/source/ui/view/tabvwsh3.cxx
+++ b/sc/source/ui/view/tabvwsh3.cxx
@@ -247,7 +247,7 @@ void ScTabViewShell::Execute( SfxRequest& rReq )
if ( nSlot == SID_JUMPTOMARK )
{
// URL has to be decoded for escaped characters (%20)
- aAddress = INetURLObject::decode( aAddress, INET_HEX_ESCAPE,
+ aAddress = INetURLObject::decode( aAddress, '%',
INetURLObject::DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8 );
}
diff --git a/sfx2/source/appl/macroloader.cxx b/sfx2/source/appl/macroloader.cxx
index 81afe1f..3560779 100644
--- a/sfx2/source/appl/macroloader.cxx
+++ b/sfx2/source/appl/macroloader.cxx
@@ -216,7 +216,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, com::sun::star::uno::An
{
// find BasicManager
SfxObjectShell* pDoc = NULL;
- OUString aBasMgrName( INetURLObject::decode(aMacro.copy( 8, nHashPos-8 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET) );
+ OUString aBasMgrName( INetURLObject::decode(aMacro.copy( 8, nHashPos-8 ), '%', INetURLObject::DECODE_WITH_CHARSET) );
if ( aBasMgrName.isEmpty() )
pBasMgr = pAppMgr;
else if ( aBasMgrName == "." )
@@ -253,7 +253,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, com::sun::star::uno::An
}
// find BASIC method
- OUString aQualifiedMethod( INetURLObject::decode(aMacro.copy( nHashPos+1 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET) );
+ OUString aQualifiedMethod( INetURLObject::decode(aMacro.copy( nHashPos+1 ), '%', INetURLObject::DECODE_WITH_CHARSET) );
OUString aArgs;
if ( -1 != nArgsPos )
{
@@ -316,7 +316,7 @@ ErrCode SfxMacroLoader::loadMacro( const OUString& rURL, com::sun::star::uno::An
{
// direct API call on a specified object
OUStringBuffer aCall;
- aCall.append('[').append(INetURLObject::decode(aMacro.copy(6), INET_HEX_ESCAPE,
+ aCall.append('[').append(INetURLObject::decode(aMacro.copy(6), '%',
INetURLObject::DECODE_WITH_CHARSET));
aCall.append(']');
pAppMgr->GetLib(0)->Execute(aCall.makeStringAndClear());
diff --git a/sfx2/source/doc/objmisc.cxx b/sfx2/source/doc/objmisc.cxx
index c339155..46f0c21 100644
--- a/sfx2/source/doc/objmisc.cxx
+++ b/sfx2/source/doc/objmisc.cxx
@@ -919,7 +919,7 @@ OUString SfxObjectShell::GetTitle
else if ( nMaxLength == SFX_TITLE_FILENAME )
{
OUString aName( aURL.GetBase() );
- aName = INetURLObject::decode( aName, INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET );
+ aName = INetURLObject::decode( aName, '%', INetURLObject::DECODE_WITH_CHARSET );
if( aName.isEmpty() )
aName = aURL.GetURLNoPass();
return X(aName);
diff --git a/sfx2/source/notify/eventsupplier.cxx b/sfx2/source/notify/eventsupplier.cxx
index 7dbf539..6d92c0e 100644
--- a/sfx2/source/notify/eventsupplier.cxx
+++ b/sfx2/source/notify/eventsupplier.cxx
@@ -444,7 +444,7 @@ void SfxEvents_Impl::NormalizeMacro( const ::comphelper::NamedValueCollection& i
sal_Int32 nArgsPos = aScript.indexOf( '(' );
if ( ( nHashPos != -1 ) && ( nArgsPos == -1 || nHashPos < nArgsPos ) )
{
- OUString aBasMgrName( INetURLObject::decode( aScript.copy( 8, nHashPos-8 ), INET_HEX_ESCAPE, INetURLObject::DECODE_WITH_CHARSET ) );
+ OUString aBasMgrName( INetURLObject::decode( aScript.copy( 8, nHashPos-8 ), '%', INetURLObject::DECODE_WITH_CHARSET ) );
if ( aBasMgrName == "." )
aLibrary = pDoc->GetTitle();
else
diff --git a/sw/source/core/doc/docdde.cxx b/sw/source/core/doc/docdde.cxx
index 927699e..05f40aee 100644
--- a/sw/source/core/doc/docdde.cxx
+++ b/sw/source/core/doc/docdde.cxx
@@ -291,7 +291,7 @@ bool SwDoc::SelectServerObj( const OUString& rStr, SwPaM*& rpPam,
rpPam = 0;
rpRange = 0;
- OUString sItem( INetURLObject::decode( rStr, INET_HEX_ESCAPE,
+ OUString sItem( INetURLObject::decode( rStr, '%',
INetURLObject::DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8 ));
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index bacbbd7..57047c9 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -1659,7 +1659,7 @@ void SwEnhancedPDFExportHelper::EnhancedPDFExport()
// than one link to this destination:
OUString aURL( INetURLObject::decode(
p->rINetAttr.GetINetFmt().GetValue(),
- INET_HEX_ESCAPE,
+ '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ) );
diff --git a/sw/source/core/uibase/dbui/dbmgr.cxx b/sw/source/core/uibase/dbui/dbmgr.cxx
index 21eb9e2..057aeeb 100644
--- a/sw/source/core/uibase/dbui/dbmgr.cxx
+++ b/sw/source/core/uibase/dbui/dbmgr.cxx
@@ -2298,7 +2298,7 @@ OUString SwNewDBMgr::LoadAndRegisterDataSource()
Reference<XDatabaseContext> xDBContext = DatabaseContext::create(xContext);
OUString sNewName = INetURLObject::decode( aURL.getName(),
- INET_HEX_ESCAPE,
+ '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 );
sal_Int32 nExtLen = aURL.GetExtension().getLength();
diff --git a/sw/source/core/uibase/shells/grfsh.cxx b/sw/source/core/uibase/shells/grfsh.cxx
index eb5c5ca..5538251 100644
--- a/sw/source/core/uibase/shells/grfsh.cxx
+++ b/sw/source/core/uibase/shells/grfsh.cxx
@@ -271,7 +271,7 @@ void SwGrfShell::Execute(SfxRequest &rReq)
if( !sGrfNm.isEmpty() )
{
aSet.Put( SvxBrushItem( INetURLObject::decode( sGrfNm,
- INET_HEX_ESCAPE,
+ '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ),
sFilterNm, GPOS_LT,
diff --git a/sw/source/core/uibase/uiview/view2.cxx b/sw/source/core/uibase/uiview/view2.cxx
index 1fcf58a..ccfd4f7 100644
--- a/sw/source/core/uibase/uiview/view2.cxx
+++ b/sw/source/core/uibase/uiview/view2.cxx
@@ -1918,7 +1918,7 @@ bool SwView::JumpToSwMark( const OUString& rMark )
const SwFmtINetFmt* pINet;
OUString sCmp;
- OUString sMark( INetURLObject::decode( rMark, INET_HEX_ESCAPE,
+ OUString sMark( INetURLObject::decode( rMark, '%',
INetURLObject::DECODE_WITH_CHARSET,
RTL_TEXTENCODING_UTF8 ));
diff --git a/sw/source/core/uibase/utlui/content.cxx b/sw/source/core/uibase/utlui/content.cxx
index c30f987..2fa15b5 100644
--- a/sw/source/core/uibase/utlui/content.cxx
+++ b/sw/source/core/uibase/utlui/content.cxx
@@ -363,7 +363,7 @@ void SwContentType::Init(sal_Bool* pbInvalidateWindow)
p->sText,
INetURLObject::decode(
p->rINetAttr.GetINetFmt().GetValue(),
- INET_HEX_ESCAPE,
+ '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ),
&p->rINetAttr,
@@ -566,7 +566,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged)
OUString sLink;
pWrtShell->GetGrfNms( &sLink, 0, (SwFlyFrmFmt*) pFrmFmt);
pCnt = new SwGraphicContent(this, sFrmName,
- INetURLObject::decode( sLink, INET_HEX_ESCAPE,
+ INetURLObject::decode( sLink, '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ),
pFrmFmt->FindLayoutRect(sal_False, &aNullPt).Top());
@@ -668,7 +668,7 @@ void SwContentType::FillMemberList(sal_Bool* pbLevelOrVisibilityChanged)
p->sText,
INetURLObject::decode(
p->rINetAttr.GetINetFmt().GetValue(),
- INET_HEX_ESCAPE,
+ '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ),
&p->rINetAttr,
diff --git a/sw/source/filter/html/htmlgrin.cxx b/sw/source/filter/html/htmlgrin.cxx
index 4a3f179..8dfb212 100644
--- a/sw/source/filter/html/htmlgrin.cxx
+++ b/sw/source/filter/html/htmlgrin.cxx
@@ -1138,7 +1138,7 @@ ANCHOR_SETEVENT:
// wir hier ganz rigoros raus.
if( !aName.isEmpty() )
{
- OUString sDecoded( INetURLObject::decode( aName, INET_HEX_ESCAPE,
+ OUString sDecoded( INetURLObject::decode( aName, '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ));
sal_Int32 nPos = sDecoded.lastIndexOf( cMarkSeparator );
diff --git a/sw/source/ui/chrdlg/chardlg.cxx b/sw/source/ui/chrdlg/chardlg.cxx
index 50012a5..454440b 100644
--- a/sw/source/ui/chrdlg/chardlg.cxx
+++ b/sw/source/ui/chrdlg/chardlg.cxx
@@ -198,7 +198,7 @@ void SwCharURLPage::Reset(const SfxItemSet& rSet)
{
const SwFmtINetFmt* pINetFmt = (const SwFmtINetFmt*) pItem;
m_pURLED->SetText(INetURLObject::decode(pINetFmt->GetValue(),
- INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS,
+ '%', INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8));
m_pURLED->SaveValue();
m_pURLED->SetText(pINetFmt->GetName());
diff --git a/sw/source/ui/dialog/uiregionsw.cxx b/sw/source/ui/dialog/uiregionsw.cxx
index 24e5630..fc7af67 100644
--- a/sw/source/ui/dialog/uiregionsw.cxx
+++ b/sw/source/ui/dialog/uiregionsw.cxx
@@ -208,7 +208,7 @@ SectRepr::SectRepr( sal_uInt16 nPos, SwSection& rSect )
void SectRepr::SetFile( const OUString& rFile )
{
- OUString sNewFile( INetURLObject::decode( rFile, INET_HEX_ESCAPE,
+ OUString sNewFile( INetURLObject::decode( rFile, '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ));
OUString sOldFileName( m_SectionData.GetLinkFileName() );
@@ -293,7 +293,7 @@ OUString SectRepr::GetFile() const
}
else
sLinkFile = INetURLObject::decode( sLinkFile.getToken( 0, sfx2::cTokenSeparator ),
- INET_HEX_ESCAPE,
+ '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 );
}
@@ -1821,7 +1821,7 @@ IMPL_LINK( SwInsertSectionTabPage, DlgClosedHdl, sfx2::FileDialogHelper *, _pFil
if ( SFX_ITEM_SET == pMedium->GetItemSet()->GetItemState( SID_PASSWORD, false, &pItem ) )
m_sFilePasswd = ( (SfxStringItem*)pItem )->GetValue();
m_pFileNameED->SetText( INetURLObject::decode(
- m_sFileName, INET_HEX_ESCAPE, INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_UTF8 ) );
+ m_sFileName, '%', INetURLObject::DECODE_UNAMBIGUOUS, RTL_TEXTENCODING_UTF8 ) );
::lcl_ReadSections(*pMedium, *m_pSubRegionED);
delete pMedium;
}
diff --git a/sw/source/ui/frmdlg/frmpage.cxx b/sw/source/ui/frmdlg/frmpage.cxx
index ffadcf8..5c168e4 100644
--- a/sw/source/ui/frmdlg/frmpage.cxx
+++ b/sw/source/ui/frmdlg/frmpage.cxx
@@ -2574,7 +2574,7 @@ IMPL_LINK_NOARG(SwGrfExtPage, BrowseHdl)
{ // remember selected filter
aFilterName = pGrfDlg->GetCurrentFilter();
aNewGrfName = INetURLObject::decode( pGrfDlg->GetPath(),
- INET_HEX_ESCAPE,
+ '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 );
m_pConnectED->SetModifyFlag();
@@ -2761,7 +2761,7 @@ void SwFrmURLPage::Reset( const SfxItemSet &rSet )
{
const SwFmtURL* pFmtURL = (const SwFmtURL*)pItem;
pURLED->SetText( INetURLObject::decode( pFmtURL->GetURL(),
- INET_HEX_ESCAPE,
+ '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 ));
pNameED->SetText( pFmtURL->GetName());
diff --git a/sw/source/ui/index/cnttab.cxx b/sw/source/ui/index/cnttab.cxx
index b3041b8..b904bd8 100644
--- a/sw/source/ui/index/cnttab.cxx
+++ b/sw/source/ui/index/cnttab.cxx
@@ -1224,7 +1224,7 @@ void SwTOXSelectTabPage::Reset( const SfxItemSet& )
m_pTypeLB->SelectEntryPos(m_pTypeLB->GetEntryPos((void*)nData));
sAutoMarkURL = INetURLObject::decode( rSh.GetTOIAutoMarkURL(),
- INET_HEX_ESCAPE,
+ '%',
INetURLObject::DECODE_UNAMBIGUOUS,
RTL_TEXTENCODING_UTF8 );
m_pFromFileCB->Check( !sAutoMarkURL.isEmpty() );
commit a401d9356e4ab3d8349b5a737a1f7e78f05f3f7e
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Apr 1 08:42:50 2014 +0300
Bin pointless INET_MARK_TOKEN
Change-Id: Id95a2bd8ba08e06284709a4c7fa2582382f8aeae
diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx
index 0902372..d400d51 100644
--- a/include/tools/urlobj.hxx
+++ b/include/tools/urlobj.hxx
@@ -31,7 +31,6 @@ namespace com { namespace sun { namespace star { namespace util {
} } } }
// Special tokens:
-#define INET_MARK_TOKEN '#'
#define INET_HEX_ESCAPE '%'
// Common URL prefixes for various schemes:
diff --git a/sw/source/core/doc/visiturl.cxx b/sw/source/core/doc/visiturl.cxx
index 4c26121..22850ea 100644
--- a/sw/source/core/doc/visiturl.cxx
+++ b/sw/source/core/doc/visiturl.cxx
@@ -52,7 +52,7 @@ void SwURLStateChanged::Notify( SfxBroadcaster& , const SfxHint& rHint )
if( pDoc->GetDocShell() && pDoc->GetDocShell()->GetMedium() &&
// If this is our Doc, we can also have local jumps!
pDoc->GetDocShell()->GetMedium()->GetName().equals(sURL) )
- sBkmk = OUString(INET_MARK_TOKEN) + pIURL->GetMark();
+ sBkmk = "#" + pIURL->GetMark();
bool bAction = false, bUnLockView = false;
sal_uInt32 nMaxItems = pDoc->GetAttrPool().GetItemCount2( RES_TXTATR_INETFMT );
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index abe9360..b78848c 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -830,7 +830,7 @@ bool AttributeOutputBase::AnalyzeURL( const OUString& rUrl, const OUString& /*rT
OUString sMark;
OUString sURL;
- if ( rUrl.getLength() > 1 && rUrl[0] == INET_MARK_TOKEN )
+ if ( rUrl.getLength() > 1 && rUrl[0] == '#' )
{
sMark = BookmarkToWriter( rUrl.copy(1) );
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 3461271..b97f66d 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -2852,7 +2852,7 @@ void WW8Export::StoreDoc1()
void MSWordExportBase::AddLinkTarget(const OUString& rURL)
{
- if( rURL.isEmpty() || rURL[0] != INET_MARK_TOKEN )
+ if( rURL.isEmpty() || rURL[0] != '#' )
return;
OUString aURL( BookmarkToWriter( rURL.copy( 1 ) ) );
diff --git a/sw/source/filter/ww8/ww8par5.cxx b/sw/source/filter/ww8/ww8par5.cxx
index 562ad9e..db9a826 100644
--- a/sw/source/filter/ww8/ww8par5.cxx
+++ b/sw/source/filter/ww8/ww8par5.cxx
@@ -2059,7 +2059,7 @@ eF_ResT SwWW8ImplReader::Read_F_PgRef( WW8FieldDesc*, OUString& rStr )
{
sBookmarkName = sName;
}
- OUString sURL = OUString(INET_MARK_TOKEN) + sBookmarkName;
+ OUString sURL = "#" + sBookmarkName;
const OUString sTarget;
SwFmtINetFmt aURL( sURL, sTarget );
const OUString sLinkStyle("Index Link");
@@ -3422,7 +3422,7 @@ eF_ResT SwWW8ImplReader::Read_F_Hyperlink( WW8FieldDesc* /*pF*/, OUString& rStr
OSL_ENSURE(!sURL.isEmpty() || !sMark.isEmpty(), "WW8: Empty URL");
if( !sMark.isEmpty() )
- ( sURL += OUString(INET_MARK_TOKEN) ) += sMark;
+ ( sURL += "#" ) += sMark;
SwFmtINetFmt aURL( sURL, sTarget );
// If on loading TOC field, change the default style into the "index link"
commit b6dbe2be875d181d4d926ba95e52820d7d0d6240
Author: Tor Lillqvist <tml at collabora.com>
Date: Tue Apr 1 08:40:44 2014 +0300
Bin pointless INET_PATH_TOKEN
There is nothing mnemonic in the name 'INET_PATH_TOKEN' that would tell the
code reader that it simply means '/'.
Change-Id: I89ce72e8be5cf0ef2c66b23ad6e721ad49105648
diff --git a/fpicker/source/office/iodlg.cxx b/fpicker/source/office/iodlg.cxx
index 7e3184f..dbd0e6a 100644
--- a/fpicker/source/office/iodlg.cxx
+++ b/fpicker/source/office/iodlg.cxx
@@ -2165,7 +2165,7 @@ short SvtFileDialog::PrepareExecute()
OUString aFileName( aFolderURL.getName( INetURLObject::LAST_SEGMENT, false ) );
sal_Int32 nFileNameLen = aFileName.getLength();
bool bFileToSelect = nFileNameLen != 0;
- if ( bFileToSelect && aFileName[ nFileNameLen - 1 ] != INET_PATH_TOKEN )
+ if ( bFileToSelect && aFileName[ nFileNameLen - 1 ] != '/' )
{
_pImp->_pEdFileName->SetText( GET_DECODED_NAME( aFolderURL ) );
aFolderURL.removeSegment();
@@ -2507,7 +2507,7 @@ sal_Bool SvtFileDialog::IsolateFilterFromPath_Impl( OUString& rPath, OUString& r
if ( nWildCardPos != -1 )
{
- sal_Int32 nPathTokenPos = aReversePath.indexOf( INET_PATH_TOKEN );
+ sal_Int32 nPathTokenPos = aReversePath.indexOf( '/' );
if ( nPathTokenPos == -1 )
{
diff --git a/include/tools/urlobj.hxx b/include/tools/urlobj.hxx
index 88b8ecd..0902372 100644
--- a/include/tools/urlobj.hxx
+++ b/include/tools/urlobj.hxx
@@ -31,7 +31,6 @@ namespace com { namespace sun { namespace star { namespace util {
} } } }
// Special tokens:
-#define INET_PATH_TOKEN '/'
#define INET_MARK_TOKEN '#'
#define INET_HEX_ESCAPE '%'
diff --git a/svtools/source/misc/imagemgr.cxx b/svtools/source/misc/imagemgr.cxx
index 3e01565..06c78f5 100644
--- a/svtools/source/misc/imagemgr.cxx
+++ b/svtools/source/misc/imagemgr.cxx
@@ -359,7 +359,7 @@ static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, bool bDetectFol
if ( rObject.GetProtocol() == INET_PROT_PRIVATE )
{
OUString aURLPath = sURL.copy( URL_PREFIX_PRIV_SOFFICE_LEN );
- OUString aType = aURLPath.getToken( 0, INET_PATH_TOKEN );
+ OUString aType = aURLPath.getToken( 0, '/' );
if ( aType == "factory" )
{
// detect an image id for our "private:factory" urls
@@ -369,7 +369,7 @@ static sal_uInt16 GetImageId_Impl( const INetURLObject& rObject, bool bDetectFol
return nImage;
}
else if ( aType == "image" )
- nImage = (sal_uInt16)aURLPath.getToken( 1, INET_PATH_TOKEN ).toInt32();
+ nImage = (sal_uInt16)aURLPath.getToken( 1, '/' ).toInt32();
}
else
{
@@ -530,10 +530,10 @@ OUString SvFileInformationManager::GetDescription_Impl( const INetURLObject& rOb
if ( rObject.GetProtocol() == INET_PROT_PRIVATE )
{
OUString aURLPath = sURL.copy( URL_PREFIX_PRIV_SOFFICE_LEN );
- OUString aType = aURLPath.getToken( 0, INET_PATH_TOKEN );
+ OUString aType = aURLPath.getToken( 0, '/' );
if ( aType == "factory" )
{
- sDescription = GetDescriptionByFactory_Impl( aURLPath.copy( aURLPath.indexOf( INET_PATH_TOKEN ) + 1 ) );
+ sDescription = GetDescriptionByFactory_Impl( aURLPath.copy( aURLPath.indexOf( '/' ) + 1 ) );
bDetected = true;
}
}
diff --git a/sw/source/core/doc/tblafmt.cxx b/sw/source/core/doc/tblafmt.cxx
index be9b1f1..0dedd8b 100644
--- a/sw/source/core/doc/tblafmt.cxx
+++ b/sw/source/core/doc/tblafmt.cxx
@@ -1118,7 +1118,7 @@ sal_Bool SwTableAutoFmtTbl::Load()
sal_Bool SwTableAutoFmtTbl::Save() const
{
SvtPathOptions aPathOpt;
- const OUString sNm( aPathOpt.GetUserConfigPath() + OUString(INET_PATH_TOKEN) + AUTOTABLE_FORMAT_NAME );
+ const OUString sNm( aPathOpt.GetUserConfigPath() + "/" + AUTOTABLE_FORMAT_NAME );
SfxMedium aStream(sNm, STREAM_STD_WRITE );
return Save( *aStream.GetOutStream() ) && aStream.Commit();
}
diff --git a/sw/source/core/uibase/config/uinums.cxx b/sw/source/core/uibase/config/uinums.cxx
index 8871d2b..c2157f6 100644
--- a/sw/source/core/uibase/config/uinums.cxx
+++ b/sw/source/core/uibase/config/uinums.cxx
@@ -70,9 +70,7 @@ SwBaseNumRules::~SwBaseNumRules()
if( bModified )
{
SvtPathOptions aPathOpt;
- OUString sNm( aPathOpt.GetUserConfigPath() );
- sNm += OUString(INET_PATH_TOKEN);
- sNm += sFileName;
+ OUString sNm( aPathOpt.GetUserConfigPath() + "/" + sFileName );
INetURLObject aTempObj(sNm);
sNm = aTempObj.GetFull();
SfxMedium aStrm( sNm, STREAM_WRITE | STREAM_TRUNC |
diff --git a/sw/source/core/uibase/misc/glosdoc.cxx b/sw/source/core/uibase/misc/glosdoc.cxx
index 575e17a..66d0198 100644
--- a/sw/source/core/uibase/misc/glosdoc.cxx
+++ b/sw/source/core/uibase/misc/glosdoc.cxx
@@ -52,7 +52,7 @@ namespace
inline OUString lcl_FullPathName(const OUString& sPath, const OUString& sName)
{
- return sPath + OUString(INET_PATH_TOKEN) + sName + SwGlossaries::GetExtension();
+ return sPath + "/" + sName + SwGlossaries::GetExtension();
}
OUString lcl_CheckFileName( const OUString& rNewFilePath,
diff --git a/sw/source/core/uibase/uno/unomailmerge.cxx b/sw/source/core/uibase/uno/unomailmerge.cxx
index cc4923d..b516594 100644
--- a/sw/source/core/uibase/uno/unomailmerge.cxx
+++ b/sw/source/core/uibase/uno/unomailmerge.cxx
@@ -723,7 +723,7 @@ uno::Any SAL_CALL SwXMailMerge::execute(
aURLObj.SetSmartURL( aCurOutputURL );
OUString aPath = aURLObj.GetMainURL( INetURLObject::DECODE_TO_IURI );
- const OUString aDelim = OUString(INET_PATH_TOKEN);
+ const OUString aDelim( "/" );
if (!aPath.isEmpty() && !aPath.endsWith(aDelim))
aPath += aDelim;
if (bCurFileNameFromColumn)
diff --git a/sw/source/core/uibase/utlui/gloslst.cxx b/sw/source/core/uibase/utlui/gloslst.cxx
index 518a1ed..0e54a573 100644
--- a/sw/source/core/uibase/utlui/gloslst.cxx
+++ b/sw/source/core/uibase/utlui/gloslst.cxx
@@ -261,7 +261,7 @@ void SwGlossaryList::Update()
pGroup->sName = sGrpName;
FillGroup(pGroup, pGlossaries);
- OUString sName = rPathArr[nPath] + OUString(INET_PATH_TOKEN) +
+ OUString sName = rPathArr[nPath] + "/" +
pGroup->sName.getToken(0, GLOS_DELIM) + sExt;
FStatHelper::GetModifiedDateTimeOfFile( sName,
&pGroup->aDateModified,
diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx
index 8f9be8a..5fa938f 100644
--- a/sw/source/ui/envelp/mailmrge.cxx
+++ b/sw/source/ui/envelp/mailmrge.cxx
@@ -664,9 +664,8 @@ bool SwMailMergeDlg::ExecQryShell()
aAbs, aPathED.GetText(), URIHelper::GetMaybeFileHdl()));
pModOpt->SetMailingPath(sPath);
- const OUString sDelim(INET_PATH_TOKEN);
- if (!sPath.endsWith(sDelim))
- sPath += sDelim;
+ if (!sPath.endsWith("/"))
+ sPath += "/";
pModOpt->SetIsNameFromColumn(aGenerateFromDataBaseCB.IsChecked());
diff --git a/sw/source/ui/misc/glosbib.cxx b/sw/source/ui/misc/glosbib.cxx
index 216d335..6015164 100644
--- a/sw/source/ui/misc/glosbib.cxx
+++ b/sw/source/ui/misc/glosbib.cxx
@@ -419,7 +419,7 @@ void SwGlossaryGroupTLB::RequestHelp( const HelpEvent& rHEvt )
aPos = OutputToScreenPixel(aPos);
Rectangle aItemRect( aPos, aSize );
GlosBibUserData* pData = (GlosBibUserData*)pEntry->GetUserData();
- const OUString sMsg = pData->sPath + OUString(INET_PATH_TOKEN)
+ const OUString sMsg = pData->sPath + "/"
+ pData->sGroupName.getToken(0, GLOS_DELIM)
+ SwGlossaries::GetExtension();
diff --git a/sw/source/ui/misc/glossary.cxx b/sw/source/ui/misc/glossary.cxx
index eedcf51..0989836 100644
--- a/sw/source/ui/misc/glossary.cxx
+++ b/sw/source/ui/misc/glossary.cxx
@@ -878,7 +878,7 @@ void SwGlTreeListBox::RequestHelp( const HelpEvent& rHEvt )
if( !rPathArr.empty() )
{
INetURLObject aTmp(rPathArr[pData->nPathIdx]
- + OUString(INET_PATH_TOKEN)
+ + "/"
+ pData->sGroupName
+ SwGlossaries::GetExtension());
sMsg = aTmp.GetPath();
More information about the Libreoffice-commits
mailing list