Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ae957038
Kaydet (Commit)
ae957038
authored
Eki 09, 2013
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Related: fdo#38838 remove UniString::SetToken & UniString::SearchAscii
Change-Id: I5219578fbeb40a0fe363f03c64021a83f7e505fb
üst
36c1239a
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
32 additions
and
129 deletions
+32
-129
string.hxx
include/tools/string.hxx
+0
-4
authfld.cxx
sw/source/core/fields/authfld.cxx
+2
-2
unosect.cxx
sw/source/core/unocore/unosect.cxx
+9
-9
applab.cxx
sw/source/ui/app/applab.cxx
+1
-1
mmoutputpage.cxx
sw/source/ui/dbui/mmoutputpage.cxx
+12
-12
regionsw.cxx
sw/source/ui/dialog/regionsw.cxx
+5
-3
envlop1.cxx
sw/source/ui/envelp/envlop1.cxx
+3
-1
strascii.cxx
tools/source/string/strascii.cxx
+0
-58
tustring.cxx
tools/source/string/tustring.cxx
+0
-38
unusedcode.easy
unusedcode.easy
+0
-1
No files found.
include/tools/string.hxx
Dosyayı görüntüle @
ae957038
...
...
@@ -105,8 +105,6 @@ private:
TOOLS_DLLPRIVATE
inline
void
ImplCopyData
();
TOOLS_DLLPRIVATE
inline
sal_Unicode
*
ImplCopyStringData
(
sal_Unicode
*
);
TOOLS_DLLPRIVATE
xub_StrLen
SearchAscii
(
const
sal_Char
*
pAsciiStr
,
xub_StrLen
nIndex
)
const
;
UniString
(
const
int
*
pDummy
);
// not implemented: to prevent UniString( NULL )
UniString
(
int
);
// not implemented; to detect misuses of
// UniString(sal_Unicode)
...
...
@@ -243,8 +241,6 @@ public:
xub_StrLen
SearchAndReplace
(
const
UniString
&
rStr
,
const
UniString
&
rRepStr
,
xub_StrLen
nIndex
=
0
);
void
SetToken
(
xub_StrLen
nToken
,
sal_Unicode
cTok
,
const
UniString
&
rStr
,
xub_StrLen
nIndex
=
0
);
UniString
GetToken
(
xub_StrLen
nToken
,
sal_Unicode
cTok
,
sal_Int32
&
rIndex
)
const
;
UniString
GetToken
(
xub_StrLen
nToken
,
sal_Unicode
cTok
=
';'
)
const
;
...
...
sw/source/core/fields/authfld.cxx
Dosyayı görüntüle @
ae957038
...
...
@@ -668,7 +668,7 @@ bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ )
OUStringBuffer
sBuf
;
comphelper
::
string
::
padToLength
(
sBuf
,
AUTH_FIELD_ISBN
,
TOX_STYLE_DELIMITER
);
String
sToSet
(
sBuf
.
makeStringAndClear
());
OU
String
sToSet
(
sBuf
.
makeStringAndClear
());
const
PropertyValue
*
pParam
=
aParam
.
getConstArray
();
for
(
sal_Int32
i
=
0
;
i
<
aParam
.
getLength
();
i
++
)
{
...
...
@@ -684,7 +684,7 @@ bool SwAuthorityField::PutValue( const Any& rAny, sal_uInt16 /*nWhichId*/ )
}
else
pParam
[
i
].
Value
>>=
sContent
;
sToSet
.
SetToken
(
nFound
,
TOX_STYLE_DELIMITER
,
sContent
);
sToSet
=
comphelper
::
string
::
setToken
(
sToSet
,
nFound
,
TOX_STYLE_DELIMITER
,
sContent
);
}
}
...
...
sw/source/core/unocore/unosect.cxx
Dosyayı görüntüle @
ae957038
...
...
@@ -614,9 +614,8 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
case
WID_SECT_DDE_FILE
:
case
WID_SECT_DDE_ELEMENT
:
{
OUString
uTmp
;
pValues
[
nProperty
]
>>=
uTmp
;
String
sTmp
(
uTmp
);
OUString
sTmp
;
pValues
[
nProperty
]
>>=
sTmp
;
if
(
m_bIsDescriptor
)
{
if
(
!
m_pProps
->
m_bDDE
)
...
...
@@ -627,9 +626,9 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
m_pProps
->
m_sLinkFileName
=
buf
.
makeStringAndClear
();
m_pProps
->
m_bDDE
=
true
;
}
String
sLinkFileName
(
m_pProps
->
m_sLinkFileName
);
sLinkFileName
.
SetToken
(
pEntry
->
nWID
-
WID_SECT_DDE_TYPE
,
sfx2
::
cTokenSeparator
,
sTmp
);
OU
String
sLinkFileName
(
m_pProps
->
m_sLinkFileName
);
sLinkFileName
=
comphelper
::
string
::
setToken
(
sLinkFileName
,
pEntry
->
nWID
-
WID_SECT_DDE_TYPE
,
sfx2
::
cTokenSeparator
,
sTmp
);
m_pProps
->
m_sLinkFileName
=
sLinkFileName
;
}
else
...
...
@@ -641,7 +640,8 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
sLinkFileName
+=
sfx2
::
cTokenSeparator
;
pSectionData
->
SetType
(
DDE_LINK_SECTION
);
}
sLinkFileName
.
SetToken
(
pEntry
->
nWID
-
WID_SECT_DDE_TYPE
,
sLinkFileName
=
comphelper
::
string
::
setToken
(
sLinkFileName
,
pEntry
->
nWID
-
WID_SECT_DDE_TYPE
,
sfx2
::
cTokenSeparator
,
sTmp
);
pSectionData
->
SetLinkFileName
(
sLinkFileName
);
}
...
...
@@ -725,12 +725,12 @@ throw (beans::UnknownPropertyException, beans::PropertyVetoException,
{
pSectionData
->
SetType
(
FILE_LINK_SECTION
);
}
String
sSectLink
(
pSectionData
->
GetLinkFileName
());
OU
String
sSectLink
(
pSectionData
->
GetLinkFileName
());
while
(
3
<
comphelper
::
string
::
getTokenCount
(
sSectLink
,
sfx2
::
cTokenSeparator
))
{
sSectLink
+=
sfx2
::
cTokenSeparator
;
}
sSectLink
.
SetToken
(
2
,
sfx2
::
cTokenSeparator
,
sLink
);
sSectLink
=
comphelper
::
string
::
setToken
(
sSectLink
,
2
,
sfx2
::
cTokenSeparator
,
sLink
);
pSectionData
->
SetLinkFileName
(
sSectLink
);
if
(
sSectLink
.
Len
()
<
3
)
{
...
...
sw/source/ui/app/applab.cxx
Dosyayı görüntüle @
ae957038
...
...
@@ -142,7 +142,7 @@ static const SwFrmFmt *lcl_InsertLabText( SwWrtShell& rSh, const SwLabItem& rIte
String
sDBName
;
if
(
(
!
rItem
.
bSynchron
||
!
(
nCol
|
nRow
))
&&
(
sDBName
=
InsertLabEnvText
(
rSh
,
rFldMgr
,
rItem
.
aWriting
)).
Len
()
&&
!
bLast
)
{
sDBName
.
SetToken
(
3
,
DB_DELIM
,
OUString
(
"True"
)
);
sDBName
=
comphelper
::
string
::
setToken
(
sDBName
,
3
,
DB_DELIM
,
"True"
);
SwInsertFld_Data
aData
(
TYP_DBNEXTSETFLD
,
0
,
sDBName
,
aEmptyStr
,
0
,
&
rSh
);
rFldMgr
.
InsertFld
(
aData
);
}
...
...
sw/source/ui/dbui/mmoutputpage.cxx
Dosyayı görüntüle @
ae957038
...
...
@@ -896,17 +896,17 @@ IMPL_LINK(SwMailMergeOutputPage, SendTypeHdl_Impl, ListBox*, pBox)
if
(
bEnable
)
{
//add the correct extension
String
sAttach
(
m_aAttachmentED
.
GetText
());
OU
String
sAttach
(
m_aAttachmentED
.
GetText
());
//do nothing if the user has removed the name - the warning will come early enough
if
(
sAttach
.
Len
())
if
(
!
sAttach
.
isEmpty
())
{
xub_StrLen
nTokenCount
=
comphelper
::
string
::
getTokenCount
(
sAttach
,
'.'
);
sal_Int32
nTokenCount
=
comphelper
::
string
::
getTokenCount
(
sAttach
,
'.'
);
if
(
2
>
nTokenCount
)
{
sAttach
+=
'.'
;
++
nTokenCount
;
}
sAttach
.
SetToken
(
nTokenCount
-
1
,
'.'
,
lcl_GetExtensionForDocType
(
nDocType
));
sAttach
=
comphelper
::
string
::
setToken
(
sAttach
,
nTokenCount
-
1
,
'.'
,
lcl_GetExtensionForDocType
(
nDocType
));
m_aAttachmentED
.
SetText
(
sAttach
);
}
}
...
...
@@ -1054,14 +1054,14 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
aQuery
.
SetIsEmptyTextAllowed
(
false
);
if
(
RET_OK
==
aQuery
.
Execute
())
{
String
sAttach
(
aQuery
.
GetValue
());
xub_StrLen
nTokenCount
=
comphelper
::
string
::
getTokenCount
(
sAttach
,
'.'
);
if
(
2
>
nTokenCount
)
OU
String
sAttach
(
aQuery
.
GetValue
());
sal_Int32
nTokenCount
=
comphelper
::
string
::
getTokenCount
(
sAttach
,
'.'
);
if
(
2
>
nTokenCount
)
{
sAttach
+=
'.'
;
++
nTokenCount
;
}
sAttach
.
SetToken
(
nTokenCount
-
1
,
'.'
,
lcl_GetExtensionForDocType
(
sAttach
=
comphelper
::
string
::
setToken
(
sAttach
,
nTokenCount
-
1
,
'.'
,
lcl_GetExtensionForDocType
(
(
sal_uLong
)
m_aSendAsLB
.
GetEntryData
(
m_aSendAsLB
.
GetSelectEntryPos
())));
m_aAttachmentED
.
SetText
(
sAttach
);
}
...
...
@@ -1194,12 +1194,12 @@ IMPL_LINK(SwMailMergeOutputPage, SendDocumentsHdl_Impl, PushButton*, pButton)
{
sBody
=
m_sBody
;
aDesc
.
sAttachmentURL
=
aName
.
GetValue
();
String
sAttachment
(
m_aAttachmentED
.
GetText
());
xub_StrLen
nTokenCount
=
comphelper
::
string
::
getTokenCount
(
sAttachment
,
'.'
);
if
(
2
>
nTokenCount
)
OU
String
sAttachment
(
m_aAttachmentED
.
GetText
());
sal_Int32
nTokenCount
=
comphelper
::
string
::
getTokenCount
(
sAttachment
,
'.'
);
if
(
2
>
nTokenCount
)
{
sAttachment
+=
'.'
;
sAttachment
.
SetToken
(
nTokenCount
,
'.'
,
sExtension
);
sAttachment
=
comphelper
::
string
::
setToken
(
sAttachment
,
nTokenCount
,
'.'
,
sExtension
);
}
else
if
(
sAttachment
.
GetToken
(
nTokenCount
-
1
,
'.'
)
!=
sExtension
)
sAttachment
+=
sExtension
;
...
...
sw/source/ui/dialog/regionsw.cxx
Dosyayı görüntüle @
ae957038
...
...
@@ -158,14 +158,16 @@ void SwBaseShell::InsertRegionDialog(SfxRequest& rReq)
if
(
aFile
.
Len
()
||
aSub
.
Len
())
{
String
sLinkFileName
=
OUString
(
sfx2
::
cTokenSeparator
);
OU
String
sLinkFileName
=
OUString
(
sfx2
::
cTokenSeparator
);
sLinkFileName
+=
sfx2
::
cTokenSeparator
;
sLinkFileName
.
SetToken
(
0
,
sfx2
::
cTokenSeparator
,
aFile
);
sLinkFileName
=
comphelper
::
string
::
setToken
(
sLinkFileName
,
0
,
sfx2
::
cTokenSeparator
,
aFile
);
if
(
SFX_ITEM_SET
==
pSet
->
GetItemState
(
FN_PARAM_2
,
sal_True
,
&
pItem
))
sLinkFileName
.
SetToken
(
1
,
sfx2
::
cTokenSeparator
,
{
sLinkFileName
=
comphelper
::
string
::
setToken
(
sLinkFileName
,
1
,
sfx2
::
cTokenSeparator
,
((
const
SfxStringItem
*
)
pItem
)
->
GetValue
());
}
sLinkFileName
+=
aSub
;
aSection
.
SetType
(
FILE_LINK_SECTION
);
...
...
sw/source/ui/envelp/envlop1.cxx
Dosyayı görüntüle @
ae957038
...
...
@@ -246,7 +246,9 @@ IMPL_LINK( SwEnvPage, DatabaseHdl, ListBox *, pListBox )
sActDBName
+=
DB_DELIM
;
}
else
sActDBName
.
SetToken
(
1
,
DB_DELIM
,
m_pTableLB
->
GetSelectEntry
());
{
sActDBName
=
comphelper
::
string
::
setToken
(
sActDBName
,
1
,
DB_DELIM
,
m_pTableLB
->
GetSelectEntry
());
}
pSh
->
GetNewDBMgr
()
->
GetColumnNames
(
m_pDBFieldLB
,
m_pDatabaseLB
->
GetSelectEntry
(),
m_pTableLB
->
GetSelectEntry
());
return
0
;
...
...
tools/source/string/strascii.cxx
Dosyayı görüntüle @
ae957038
...
...
@@ -63,21 +63,6 @@ static sal_Int32 ImplStringCompareAscii( const sal_Unicode* pStr1, const sal_Cha
return
nRet
;
}
static
sal_Int32
ImplStringCompareWithoutZeroAscii
(
const
sal_Unicode
*
pStr1
,
const
sal_Char
*
pStr2
,
xub_StrLen
nCount
)
{
sal_Int32
nRet
=
0
;
while
(
nCount
&&
((
nRet
=
((
sal_Int32
)
*
pStr1
)
-
((
sal_Int32
)((
unsigned
char
)
*
pStr2
)))
==
0
)
)
{
++
pStr1
,
++
pStr2
,
--
nCount
;
}
return
nRet
;
}
UniString
&
UniString
::
AppendAscii
(
const
sal_Char
*
pAsciiStr
)
{
DBG_CHKTHIS
(
UniString
,
DbgCheckUniString
);
...
...
@@ -168,47 +153,4 @@ StringCompare UniString::CompareToAscii( const sal_Char* pAsciiStr,
return
COMPARE_GREATER
;
}
xub_StrLen
UniString
::
SearchAscii
(
const
sal_Char
*
pAsciiStr
,
xub_StrLen
nIndex
)
const
{
DBG_CHKTHIS
(
UniString
,
DbgCheckUniString
);
DBG_ASSERT
(
ImplDbgCheckAsciiStr
(
pAsciiStr
,
STRING_LEN
),
"UniString::SearchAscii() - pAsciiStr include characters > 127"
);
sal_Int32
nLen
=
mpData
->
mnLen
;
xub_StrLen
nStrLen
=
ImplStringLen
(
pAsciiStr
);
// If length of pAsciiStr is 0 or index exceeds length, it was not found
if
(
!
nStrLen
||
(
nIndex
>=
nLen
)
)
return
STRING_NOTFOUND
;
const
sal_Unicode
*
pStr
=
mpData
->
maStr
;
pStr
+=
nIndex
;
if
(
nStrLen
==
1
)
{
sal_Unicode
cSearch
=
(
unsigned
char
)
*
pAsciiStr
;
while
(
nIndex
<
nLen
)
{
if
(
*
pStr
==
cSearch
)
return
nIndex
;
++
pStr
,
++
nIndex
;
}
}
else
{
// Only search within string
while
(
nLen
-
nIndex
>=
nStrLen
)
{
// Check if string matches
if
(
ImplStringCompareWithoutZeroAscii
(
pStr
,
pAsciiStr
,
nStrLen
)
==
0
)
return
nIndex
;
++
pStr
,
++
nIndex
;
}
}
return
STRING_NOTFOUND
;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
tools/source/string/tustring.cxx
Dosyayı görüntüle @
ae957038
...
...
@@ -235,44 +235,6 @@ xub_StrLen STRING::Match( const STRING& rStr ) const
return
STRING_MATCH
;
}
void
STRING
::
SetToken
(
xub_StrLen
nToken
,
STRCODE
cTok
,
const
STRING
&
rStr
,
xub_StrLen
nIndex
)
{
DBG_CHKTHIS
(
STRING
,
DBGCHECKSTRING
);
DBG_CHKOBJ
(
&
rStr
,
STRING
,
DBGCHECKSTRING
);
const
STRCODE
*
pStr
=
mpData
->
maStr
;
xub_StrLen
nLen
=
(
xub_StrLen
)
mpData
->
mnLen
;
xub_StrLen
nTok
=
0
;
xub_StrLen
nFirstChar
=
nIndex
;
xub_StrLen
i
=
nFirstChar
;
// Determine token position and length
pStr
+=
i
;
while
(
i
<
nLen
)
{
// Increase token count if match
if
(
*
pStr
==
cTok
)
{
++
nTok
;
if
(
nTok
==
nToken
)
nFirstChar
=
i
+
1
;
else
{
if
(
nTok
>
nToken
)
break
;
}
}
++
pStr
,
++
i
;
}
if
(
nTok
>=
nToken
)
Replace
(
nFirstChar
,
i
-
nFirstChar
,
rStr
);
}
STRING
STRING
::
GetToken
(
xub_StrLen
nToken
,
STRCODE
cTok
,
sal_Int32
&
rIndex
)
const
{
DBG_CHKTHIS
(
STRING
,
DBGCHECKSTRING
);
...
...
unusedcode.easy
Dosyayı görüntüle @
ae957038
...
...
@@ -66,7 +66,6 @@ String::Append(unsigned short const*)
String::Append(unsigned short const*, unsigned short)
String::Assign(unsigned short const*)
String::Insert(String const&, unsigned short, unsigned short, unsigned short)
String::SearchAscii(char const*, unsigned short) const
String::String(char)
SvdProgressInfo::ReportError()
SvpSalInstance::PostEvent(SalFrame const*, void*, unsigned short)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment