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
ee8fad64
Kaydet (Commit)
ee8fad64
authored
Eki 07, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
ContentInfo to store svl::SharedString instead of OUString.
Change-Id: I633e3bb633317eeb61cd804faf20e79312f569f7
üst
80df5277
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
32 additions
and
9 deletions
+32
-9
editobj.cxx
editeng/source/editeng/editobj.cxx
+11
-8
editobj2.hxx
editeng/source/editeng/editobj2.hxx
+2
-1
sharedstring.hxx
include/svl/sharedstring.hxx
+2
-0
sharedstring.cxx
svl/source/misc/sharedstring.cxx
+17
-0
No files found.
editeng/source/editeng/editobj.cxx
Dosyayı görüntüle @
ee8fad64
...
...
@@ -121,7 +121,7 @@ ContentInfo::ContentInfo( SfxItemPool& rPool ) :
// the real Copy constructor is nonsens, since I have to work with another Pool!
ContentInfo
::
ContentInfo
(
const
ContentInfo
&
rCopyFrom
,
SfxItemPool
&
rPoolToUse
)
:
aText
(
rCopyFrom
.
aText
),
maText
(
rCopyFrom
.
m
aText
),
aStyle
(
rCopyFrom
.
aStyle
),
eFamily
(
rCopyFrom
.
eFamily
),
aParaAttribs
(
rPoolToUse
,
EE_PARA_START
,
EE_CHAR_END
)
...
...
@@ -151,27 +151,30 @@ ContentInfo::~ContentInfo()
void
ContentInfo
::
NormalizeString
(
svl
::
SharedStringPool
&
rPool
)
{
aText
=
OUString
(
rPool
.
intern
(
aText
).
getData
(
));
maText
=
rPool
.
intern
(
OUString
(
maText
.
getData
()
));
}
sal_uIntPtr
ContentInfo
::
GetStringID
(
const
svl
::
SharedStringPool
&
rPool
)
const
{
return
rPool
.
getIdentifier
(
aText
);
rtl_uString
*
p
=
const_cast
<
rtl_uString
*>
(
maText
.
getData
());
return
rPool
.
getIdentifier
(
OUString
(
p
));
}
sal_uIntPtr
ContentInfo
::
GetStringIDIgnoreCase
(
const
svl
::
SharedStringPool
&
rPool
)
const
{
return
rPool
.
getIdentifierIgnoreCase
(
aText
);
rtl_uString
*
p
=
const_cast
<
rtl_uString
*>
(
maText
.
getData
());
return
rPool
.
getIdentifierIgnoreCase
(
OUString
(
p
));
}
OUString
ContentInfo
::
GetText
()
const
{
return
aText
;
rtl_uString
*
p
=
const_cast
<
rtl_uString
*>
(
maText
.
getData
());
return
OUString
(
p
);
}
void
ContentInfo
::
SetText
(
const
OUString
&
rStr
)
{
aText
=
rStr
;
maText
=
svl
::
SharedString
(
rStr
.
pData
,
NULL
)
;
}
const
WrongList
*
ContentInfo
::
GetWrongList
()
const
...
...
@@ -200,7 +203,7 @@ bool ContentInfo::isWrongListEqual(const ContentInfo& rCompare) const
void
ContentInfo
::
Dump
()
const
{
cout
<<
"--"
<<
endl
;
cout
<<
"text: '"
<<
aText
<<
"'"
<<
endl
;
cout
<<
"text: '"
<<
OUString
(
maText
.
getData
())
<<
"'"
<<
endl
;
cout
<<
"style: '"
<<
aStyle
<<
"'"
<<
endl
;
XEditAttributesType
::
const_iterator
it
=
aAttribs
.
begin
(),
itEnd
=
aAttribs
.
end
();
...
...
@@ -216,7 +219,7 @@ void ContentInfo::Dump() const
bool
ContentInfo
::
operator
==
(
const
ContentInfo
&
rCompare
)
const
{
if
(
(
aText
==
rCompare
.
aText
)
&&
if
(
(
maText
==
rCompare
.
m
aText
)
&&
(
aStyle
==
rCompare
.
aStyle
)
&&
(
aAttribs
.
size
()
==
rCompare
.
aAttribs
.
size
())
&&
(
eFamily
==
rCompare
.
eFamily
)
&&
...
...
editeng/source/editeng/editobj2.hxx
Dosyayı görüntüle @
ee8fad64
...
...
@@ -24,6 +24,7 @@
#include <editdoc.hxx>
#include <unotools/fontcvt.hxx>
#include "svl/sharedstring.hxx"
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/noncopyable.hpp>
...
...
@@ -128,7 +129,7 @@ public:
typedef
boost
::
ptr_vector
<
XEditAttribute
>
XEditAttributesType
;
private
:
OUString
aText
;
svl
::
SharedString
m
aText
;
OUString
aStyle
;
XEditAttributesType
aAttribs
;
...
...
include/svl/sharedstring.hxx
Dosyayı görüntüle @
ee8fad64
...
...
@@ -27,6 +27,8 @@ public:
SharedString
&
operator
=
(
const
SharedString
&
r
);
bool
operator
==
(
const
SharedString
&
r
)
const
;
rtl_uString
*
getData
();
const
rtl_uString
*
getData
()
const
;
...
...
svl/source/misc/sharedstring.cxx
Dosyayı görüntüle @
ee8fad64
...
...
@@ -56,6 +56,23 @@ SharedString& SharedString::operator= ( const SharedString& r )
return
*
this
;
}
bool
SharedString
::
operator
==
(
const
SharedString
&
r
)
const
{
// Only compare case sensitive strings.
if
(
mpData
)
{
if
(
!
r
.
mpData
)
return
false
;
if
(
mpData
->
length
!=
r
.
mpData
->
length
)
return
false
;
return
rtl_ustr_compare_WithLength
(
mpData
->
buffer
,
mpData
->
length
,
r
.
mpData
->
buffer
,
r
.
mpData
->
length
);
}
return
!
r
.
mpData
;
}
rtl_uString
*
SharedString
::
getData
()
{
return
mpData
;
...
...
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