summaryrefslogtreecommitdiff
path: root/editeng
diff options
context:
space:
mode:
authorKohei Yoshida <kohei.yoshida@collabora.com>2013-10-07 13:07:28 -0400
committerKohei Yoshida <kohei.yoshida@collabora.com>2013-10-08 15:44:34 -0400
commitee8fad644e28d1e298afb7c6eed4d454617e7dc7 (patch)
tree4322f6186d17fa14f3ce2ff3cfef024238bb88bd /editeng
parent80df5277585d69be5c3d5f32184db94831113f95 (diff)
ContentInfo to store svl::SharedString instead of OUString.
Change-Id: I633e3bb633317eeb61cd804faf20e79312f569f7
Diffstat (limited to 'editeng')
-rw-r--r--editeng/source/editeng/editobj.cxx19
-rw-r--r--editeng/source/editeng/editobj2.hxx3
2 files changed, 13 insertions, 9 deletions
diff --git a/editeng/source/editeng/editobj.cxx b/editeng/source/editeng/editobj.cxx
index c7d99744f9b5..0ad6d2865d48 100644
--- a/editeng/source/editeng/editobj.cxx
+++ b/editeng/source/editeng/editobj.cxx
@@ -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.maText),
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.maText) &&
(aStyle == rCompare.aStyle ) &&
(aAttribs.size() == rCompare.aAttribs.size()) &&
(eFamily == rCompare.eFamily ) &&
diff --git a/editeng/source/editeng/editobj2.hxx b/editeng/source/editeng/editobj2.hxx
index 964c97861c45..d2ac04546222 100644
--- a/editeng/source/editeng/editobj2.hxx
+++ b/editeng/source/editeng/editobj2.hxx
@@ -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 maText;
OUString aStyle;
XEditAttributesType aAttribs;