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
4da3a010
Kaydet (Commit)
4da3a010
authored
Ock 08, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Turn EditTextObjectImpl into a real impl class.
Change-Id: I0f0bba62da60a3397b733253dbc0891c69bd5b9c
üst
678de825
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
119 additions
and
111 deletions
+119
-111
editobj.hxx
editeng/inc/editeng/editobj.hxx
+55
-45
editobj.cxx
editeng/source/editeng/editobj.cxx
+0
-0
editobj2.hxx
editeng/source/editeng/editobj2.hxx
+40
-42
fieldupdater.cxx
editeng/source/editeng/fieldupdater.cxx
+1
-1
impedit.hxx
editeng/source/editeng/impedit.hxx
+2
-2
impedit4.cxx
editeng/source/editeng/impedit4.cxx
+21
-21
No files found.
editeng/inc/editeng/editobj.hxx
Dosyayı görüntüle @
4da3a010
...
@@ -42,85 +42,95 @@ class SvxFieldItem;
...
@@ -42,85 +42,95 @@ class SvxFieldItem;
namespace
editeng
{
namespace
editeng
{
class
FieldUpdater
;
class
FieldUpdater
;
class
FieldUpdaterImpl
;
}
}
class
EditTextObjectImpl
;
class
EDITENG_DLLPUBLIC
EditTextObject
:
public
SfxItemPoolUser
class
EDITENG_DLLPUBLIC
EditTextObject
:
public
SfxItemPoolUser
{
{
private
:
friend
class
EditTextObjectImpl
;
friend
class
editeng
::
FieldUpdaterImpl
;
friend
class
ImpEditEngine
;
EditTextObjectImpl
*
mpImpl
;
EDITENG_DLLPRIVATE
EditTextObject
&
operator
=
(
const
EditTextObject
&
);
EDITENG_DLLPRIVATE
EditTextObject
&
operator
=
(
const
EditTextObject
&
);
protected
:
EditTextObject
();
// disabled
EditTextObject
();
EditTextObject
(
SfxItemPool
*
pPool
);
EditTextObject
(
const
EditTextObject
&
r
);
EditTextObject
(
const
EditTextObject
&
r
);
v
irtual
void
StoreData
(
SvStream
&
rOStrea
m
)
const
;
v
oid
StoreData
(
SvStream
&
rStr
m
)
const
;
v
irtual
void
CreateData
(
SvStream
&
rIStrea
m
);
v
oid
CreateData
(
SvStream
&
rStr
m
);
public
:
public
:
virtual
~
EditTextObject
();
virtual
~
EditTextObject
();
sal_uInt16
GetUserType
()
const
;
// For OutlinerMode, it can however not save in compatible format
void
SetUserType
(
sal_uInt16
n
);
virtual
sal_uInt16
GetUserType
()
const
;
// For OutlinerMode, it can however not save in compatible format
sal_uLong
GetObjectSettings
()
const
;
v
irtual
void
SetUserType
(
sal_uInt16
n
);
v
oid
SetObjectSettings
(
sal_uLong
n
);
virtual
sal_uLong
GetObjectSettings
()
const
;
bool
IsVertical
()
const
;
v
irtual
void
SetObjectSettings
(
sal_uLong
n
);
v
oid
SetVertical
(
bool
bVertical
);
virtual
bool
IsVertical
()
const
;
sal_uInt16
GetScriptType
()
const
;
virtual
void
SetVertical
(
bool
bVertical
);
virtual
sal_uInt16
GetScriptType
()
const
;
sal_uInt16
GetVersion
()
const
;
// As long as the outliner does not store any record length.
virtual
sal_uInt16
GetVersion
()
const
;
// As long as the outliner does not store any record length.
EditTextObject
*
Clone
()
const
;
virtual
EditTextObject
*
Clone
()
const
=
0
;
bool
Store
(
SvStream
&
rOStream
)
const
;
sal_Bool
Store
(
SvStream
&
rOStream
)
const
;
static
EditTextObject
*
Create
(
static
EditTextObject
*
Create
(
SvStream
&
rIStream
,
SvStream
&
rIStream
,
SfxItemPool
*
pGlobalTextObjectPool
=
NULL
);
SfxItemPool
*
pGlobalTextObjectPool
=
0
);
virtual
size_t
GetParagraphCount
()
const
;
size_t
GetParagraphCount
()
const
;
virtual
String
GetText
(
size_t
nParagraph
)
const
;
String
GetText
(
size_t
nPara
)
const
;
v
irtual
v
oid
Insert
(
const
EditTextObject
&
rObj
,
size_t
nPara
);
void
Insert
(
const
EditTextObject
&
rObj
,
size_t
nPara
);
v
irtual
v
oid
RemoveParagraph
(
size_t
nPara
);
void
RemoveParagraph
(
size_t
nPara
);
virtual
EditTextObject
*
CreateTextObject
(
size_t
nPara
,
size_t
nParas
=
1
)
const
;
EditTextObject
*
CreateTextObject
(
size_t
nPara
,
size_t
nParas
=
1
)
const
;
virtual
sal_Bool
HasPortionInfo
()
const
;
bool
HasPortionInfo
()
const
;
v
irtual
void
ClearPortionInfo
();
v
oid
ClearPortionInfo
();
virtual
sal_Bool
HasOnlineSpellErrors
()
const
;
bool
HasOnlineSpellErrors
()
const
;
virtual
sal_Bool
HasCharAttribs
(
sal_uInt16
nWhich
=
0
)
const
;
bool
HasCharAttribs
(
sal_uInt16
nWhich
=
0
)
const
;
v
irtual
void
GetCharAttribs
(
sal_uInt16
nPara
,
std
::
vector
<
EECharAttrib
>&
rLst
)
const
;
v
oid
GetCharAttribs
(
sal_uInt16
nPara
,
std
::
vector
<
EECharAttrib
>&
rLst
)
const
;
virtual
sal_Bool
RemoveCharAttribs
(
sal_uInt16
nWhich
=
0
);
bool
RemoveCharAttribs
(
sal_uInt16
nWhich
=
0
);
virtual
sal_Bool
RemoveParaAttribs
(
sal_uInt16
nWhich
=
0
);
bool
RemoveParaAttribs
(
sal_uInt16
nWhich
=
0
);
v
irtual
void
MergeParaAttribs
(
const
SfxItemSet
&
rAttribs
,
sal_uInt16
nStart
=
EE_CHAR_START
,
sal_uInt16
nEnd
=
EE_CHAR_END
);
v
oid
MergeParaAttribs
(
const
SfxItemSet
&
rAttribs
,
sal_uInt16
nStart
=
EE_CHAR_START
,
sal_uInt16
nEnd
=
EE_CHAR_END
);
virtual
sal_Bool
IsFieldObject
()
const
;
bool
IsFieldObject
()
const
;
virtual
const
SvxFieldItem
*
GetField
()
const
;
const
SvxFieldItem
*
GetField
()
const
;
virtual
bool
HasField
(
sal_Int32
nType
=
com
::
sun
::
star
::
text
::
textfield
::
Type
::
UNSPECIFIED
)
const
=
0
;
bool
HasField
(
sal_Int32
nType
=
com
::
sun
::
star
::
text
::
textfield
::
Type
::
UNSPECIFIED
)
const
;
virtual
SfxItemSet
GetParaAttribs
(
size_t
nPara
)
const
;
const
SfxItemSet
&
GetParaAttribs
(
size_t
nPara
)
const
;
v
irtual
v
oid
SetParaAttribs
(
size_t
nPara
,
const
SfxItemSet
&
rAttribs
);
void
SetParaAttribs
(
size_t
nPara
,
const
SfxItemSet
&
rAttribs
);
virtual
sal_Bool
HasStyleSheet
(
const
XubString
&
rName
,
SfxStyleFamily
eFamily
)
const
;
bool
HasStyleSheet
(
const
XubString
&
rName
,
SfxStyleFamily
eFamily
)
const
;
v
irtual
v
oid
GetStyleSheet
(
size_t
nPara
,
String
&
rName
,
SfxStyleFamily
&
eFamily
)
const
;
void
GetStyleSheet
(
size_t
nPara
,
String
&
rName
,
SfxStyleFamily
&
eFamily
)
const
;
v
irtual
v
oid
SetStyleSheet
(
size_t
nPara
,
const
String
&
rName
,
const
SfxStyleFamily
&
eFamily
);
void
SetStyleSheet
(
size_t
nPara
,
const
String
&
rName
,
const
SfxStyleFamily
&
eFamily
);
virtual
sal_Bool
ChangeStyleSheets
(
const
XubString
&
rOldName
,
SfxStyleFamily
eOldFamily
,
bool
ChangeStyleSheets
(
const
XubString
&
rNewName
,
SfxStyleFamily
eNewFamily
);
const
XubString
&
rOldName
,
SfxStyleFamily
eOldFamily
,
const
XubString
&
rNewName
,
SfxStyleFamily
eNewFamily
);
v
irtual
void
ChangeStyleSheetName
(
SfxStyleFamily
eFamily
,
const
XubString
&
rOldName
,
const
XubString
&
rNewName
);
v
oid
ChangeStyleSheetName
(
SfxStyleFamily
eFamily
,
const
XubString
&
rOldName
,
const
XubString
&
rNewName
);
virtual
editeng
::
FieldUpdater
GetFieldUpdater
()
=
0
;
editeng
::
FieldUpdater
GetFieldUpdater
()
;
bool
operator
==
(
const
EditTextObject
&
rCompare
)
const
;
bool
operator
==
(
const
EditTextObject
&
rCompare
)
const
;
// #i102062#
// #i102062#
bool
isWrongListEqual
(
const
EditTextObject
&
rCompare
)
const
;
bool
isWrongListEqual
(
const
EditTextObject
&
rCompare
)
const
;
virtual
void
ObjectInDestruction
(
const
SfxItemPool
&
rSfxItemPool
)
=
0
;
virtual
void
ObjectInDestruction
(
const
SfxItemPool
&
rSfxItemPool
);
};
};
#endif // _EDITOBJ_HXX
#endif // _EDITOBJ_HXX
...
...
editeng/source/editeng/editobj.cxx
Dosyayı görüntüle @
4da3a010
This diff is collapsed.
Click to expand it.
editeng/source/editeng/editobj2.hxx
Dosyayı görüntüle @
4da3a010
...
@@ -26,6 +26,7 @@
...
@@ -26,6 +26,7 @@
#include <unotools/fontcvt.hxx>
#include <unotools/fontcvt.hxx>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/ptr_container/ptr_vector.hpp>
#include <boost/noncopyable.hpp>
class
XEditAttribute
class
XEditAttribute
{
{
...
@@ -150,15 +151,14 @@ public:
...
@@ -150,15 +151,14 @@ public:
bool
isWrongListEqual
(
const
ContentInfo
&
rCompare
)
const
;
bool
isWrongListEqual
(
const
ContentInfo
&
rCompare
)
const
;
};
};
class
EditTextObjectImpl
:
public
EditTextObject
class
EditTextObjectImpl
:
boost
::
noncopyable
{
{
using
EditTextObject
::
operator
==
;
using
EditTextObject
::
isWrongListEqual
;
public
:
public
:
typedef
boost
::
ptr_vector
<
ContentInfo
>
ContentInfosType
;
typedef
boost
::
ptr_vector
<
ContentInfo
>
ContentInfosType
;
private
:
private
:
EditTextObject
*
mpFront
;
ContentInfosType
aContents
;
ContentInfosType
aContents
;
SfxItemPool
*
pPool
;
SfxItemPool
*
pPool
;
XParaPortionList
*
pPortionInfo
;
XParaPortionList
*
pPortionInfo
;
...
@@ -173,21 +173,19 @@ private:
...
@@ -173,21 +173,19 @@ private:
bool
bVertical
:
1
;
bool
bVertical
:
1
;
bool
bStoreUnicodeStrings
:
1
;
bool
bStoreUnicodeStrings
:
1
;
protected
:
bool
ImpChangeStyleSheets
(
const
String
&
rOldName
,
SfxStyleFamily
eOldFamily
,
virtual
void
StoreData
(
SvStream
&
rOStream
)
const
;
const
String
&
rNewName
,
SfxStyleFamily
eNewFamily
);
virtual
void
CreateData
(
SvStream
&
rIStream
);
sal_Bool
ImpChangeStyleSheets
(
const
String
&
rOldName
,
SfxStyleFamily
eOldFamily
,
const
String
&
rNewName
,
SfxStyleFamily
eNewFamily
);
public
:
public
:
EditTextObjectImpl
(
SfxItemPool
*
pPool
);
void
StoreData
(
SvStream
&
rOStream
)
const
;
EditTextObjectImpl
(
const
EditTextObjectImpl
&
);
void
CreateData
(
SvStream
&
rIStream
);
virtual
~
EditTextObjectImpl
();
virtual
EditTextObject
*
Clone
()
const
;
EditTextObjectImpl
(
EditTextObject
*
pFront
,
SfxItemPool
*
pPool
);
EditTextObjectImpl
(
EditTextObject
*
pFront
,
const
EditTextObjectImpl
&
r
);
~
EditTextObjectImpl
();
sal_uInt16
GetUserType
()
const
;
sal_uInt16
GetUserType
()
const
;
void
SetUserType
(
sal_uInt16
n
);
void
SetUserType
(
sal_uInt16
n
);
sal_uLong
GetObjectSettings
()
const
;
sal_uLong
GetObjectSettings
()
const
;
void
SetObjectSettings
(
sal_uLong
n
);
void
SetObjectSettings
(
sal_uLong
n
);
...
@@ -211,57 +209,57 @@ public:
...
@@ -211,57 +209,57 @@ public:
void
SetPortionInfo
(
XParaPortionList
*
pP
)
void
SetPortionInfo
(
XParaPortionList
*
pP
)
{
pPortionInfo
=
pP
;
}
{
pPortionInfo
=
pP
;
}
virtual
size_t
GetParagraphCount
()
const
;
size_t
GetParagraphCount
()
const
;
virtual
String
GetText
(
size_t
nParagraph
)
const
;
String
GetText
(
size_t
nParagraph
)
const
;
v
irtual
v
oid
Insert
(
const
EditTextObject
&
rObj
,
size_t
nPara
);
void
Insert
(
const
EditTextObject
&
rObj
,
size_t
nPara
);
virtual
EditTextObject
*
CreateTextObject
(
size_t
nPara
,
size_t
nParas
=
1
)
const
;
EditTextObject
*
CreateTextObject
(
size_t
nPara
,
size_t
nParas
=
1
)
const
;
virtual
void
RemoveParagraph
(
size_t
nPara
);
virtual
void
RemoveParagraph
(
size_t
nPara
);
virtual
sal_Bool
HasPortionInfo
()
const
;
bool
HasPortionInfo
()
const
;
v
irtual
void
ClearPortionInfo
();
v
oid
ClearPortionInfo
();
virtual
sal_Bool
HasOnlineSpellErrors
()
const
;
bool
HasOnlineSpellErrors
()
const
;
virtual
sal_Bool
HasCharAttribs
(
sal_uInt16
nWhich
=
0
)
const
;
bool
HasCharAttribs
(
sal_uInt16
nWhich
=
0
)
const
;
v
irtual
void
GetCharAttribs
(
sal_uInt16
nPara
,
std
::
vector
<
EECharAttrib
>&
rLst
)
const
;
v
oid
GetCharAttribs
(
sal_uInt16
nPara
,
std
::
vector
<
EECharAttrib
>&
rLst
)
const
;
virtual
sal_Bool
RemoveCharAttribs
(
sal_uInt16
nWhich
=
0
);
bool
RemoveCharAttribs
(
sal_uInt16
nWhich
=
0
);
virtual
sal_Bool
RemoveParaAttribs
(
sal_uInt16
nWhich
=
0
);
bool
RemoveParaAttribs
(
sal_uInt16
nWhich
=
0
);
v
irtual
void
MergeParaAttribs
(
const
SfxItemSet
&
rAttribs
,
sal_uInt16
nStart
,
sal_uInt16
nEnd
);
v
oid
MergeParaAttribs
(
const
SfxItemSet
&
rAttribs
,
sal_uInt16
nStart
,
sal_uInt16
nEnd
);
virtual
sal_Bool
IsFieldObject
()
const
;
bool
IsFieldObject
()
const
;
virtual
const
SvxFieldItem
*
GetField
()
const
;
const
SvxFieldItem
*
GetField
()
const
;
virtual
bool
HasField
(
sal_Int32
nType
=
com
::
sun
::
star
::
text
::
textfield
::
Type
::
UNSPECIFIED
)
const
;
bool
HasField
(
sal_Int32
nType
=
com
::
sun
::
star
::
text
::
textfield
::
Type
::
UNSPECIFIED
)
const
;
virtual
SfxItemSet
GetParaAttribs
(
size_t
nPara
)
const
;
const
SfxItemSet
&
GetParaAttribs
(
size_t
nPara
)
const
;
v
irtual
v
oid
SetParaAttribs
(
size_t
nPara
,
const
SfxItemSet
&
rAttribs
);
void
SetParaAttribs
(
size_t
nPara
,
const
SfxItemSet
&
rAttribs
);
virtual
sal_Bool
HasStyleSheet
(
const
XubString
&
rName
,
SfxStyleFamily
eFamily
)
const
;
bool
HasStyleSheet
(
const
XubString
&
rName
,
SfxStyleFamily
eFamily
)
const
;
v
irtual
v
oid
GetStyleSheet
(
size_t
nPara
,
String
&
rName
,
SfxStyleFamily
&
eFamily
)
const
;
void
GetStyleSheet
(
size_t
nPara
,
String
&
rName
,
SfxStyleFamily
&
eFamily
)
const
;
v
irtual
v
oid
SetStyleSheet
(
size_t
nPara
,
const
String
&
rName
,
const
SfxStyleFamily
&
eFamily
);
void
SetStyleSheet
(
size_t
nPara
,
const
String
&
rName
,
const
SfxStyleFamily
&
eFamily
);
virtual
sal_Bool
ChangeStyleSheets
(
const
XubString
&
rOldName
,
SfxStyleFamily
eOldFamily
,
bool
ChangeStyleSheets
(
const
String
&
rNewName
,
SfxStyleFamily
eNewFamily
);
const
XubString
&
rOldName
,
SfxStyleFamily
eOldFamily
,
const
String
&
rNewName
,
SfxStyleFamily
eNewFamily
);
virtual
void
ChangeStyleSheetName
(
SfxStyleFamily
eFamily
,
const
XubString
&
rOldName
,
const
XubString
&
rNewName
);
virtual
void
ChangeStyleSheetName
(
SfxStyleFamily
eFamily
,
const
XubString
&
rOldName
,
const
XubString
&
rNewName
);
virtual
editeng
::
FieldUpdater
GetFieldUpdater
();
editeng
::
FieldUpdater
GetFieldUpdater
();
void
CreateData300
(
SvStream
&
rIStream
);
void
CreateData300
(
SvStream
&
rIStream
);
sal_Bool
HasMetric
()
const
{
return
nMetric
!=
0xFFFF
;
}
bool
HasMetric
()
const
{
return
nMetric
!=
0xFFFF
;
}
sal_uInt16
GetMetric
()
const
{
return
nMetric
;
}
sal_uInt16
GetMetric
()
const
{
return
nMetric
;
}
void
SetMetric
(
sal_uInt16
n
)
{
nMetric
=
n
;
}
void
SetMetric
(
sal_uInt16
n
)
{
nMetric
=
n
;
}
bool
IsOwnerOfPool
()
const
{
return
bOwnerOfPool
;
}
bool
IsOwnerOfPool
()
const
{
return
bOwnerOfPool
;
}
void
StoreUnicodeStrings
(
sal_B
ool
b
)
{
bStoreUnicodeStrings
=
b
;
}
void
StoreUnicodeStrings
(
b
ool
b
)
{
bStoreUnicodeStrings
=
b
;
}
bool
operator
==
(
const
EditTextObjectImpl
&
rCompare
)
const
;
bool
operator
==
(
const
EditTextObjectImpl
&
rCompare
)
const
;
// #i102062#
// #i102062#
bool
isWrongListEqual
(
const
EditTextObjectImpl
&
rCompare
)
const
;
bool
isWrongListEqual
(
const
EditTextObjectImpl
&
rCompare
)
const
;
// from SfxItemPoolUser
// from SfxItemPoolUser
v
irtual
v
oid
ObjectInDestruction
(
const
SfxItemPool
&
rSfxItemPool
);
void
ObjectInDestruction
(
const
SfxItemPool
&
rSfxItemPool
);
};
};
#endif // _EDITOBJ2_HXX
#endif // _EDITOBJ2_HXX
...
...
editeng/source/editeng/fieldupdater.cxx
Dosyayı görüntüle @
4da3a010
...
@@ -40,7 +40,7 @@ class FieldUpdaterImpl
...
@@ -40,7 +40,7 @@ class FieldUpdaterImpl
{
{
EditTextObjectImpl
&
mrObj
;
EditTextObjectImpl
&
mrObj
;
public
:
public
:
FieldUpdaterImpl
(
EditTextObject
&
rObj
)
:
mrObj
(
static_cast
<
EditTextObjectImpl
&>
(
rObj
)
)
{}
FieldUpdaterImpl
(
EditTextObject
&
rObj
)
:
mrObj
(
*
rObj
.
mpImpl
)
{}
FieldUpdaterImpl
(
const
FieldUpdaterImpl
&
r
)
:
mrObj
(
r
.
mrObj
)
{}
FieldUpdaterImpl
(
const
FieldUpdaterImpl
&
r
)
:
mrObj
(
r
.
mrObj
)
{}
void
updateTableFields
(
int
nTab
)
void
updateTableFields
(
int
nTab
)
...
...
editeng/source/editeng/impedit.hxx
Dosyayı görüntüle @
4da3a010
...
@@ -522,7 +522,7 @@ private:
...
@@ -522,7 +522,7 @@ private:
void
GetCharAttribs
(
sal_uInt16
nPara
,
std
::
vector
<
EECharAttrib
>&
rLst
)
const
;
void
GetCharAttribs
(
sal_uInt16
nPara
,
std
::
vector
<
EECharAttrib
>&
rLst
)
const
;
EditTextObject
*
CreateBinTextObject
(
EditSelection
aSelection
,
SfxItemPool
*
,
sal_Bool
bAllowBigObjects
=
sal_False
,
sal_uInt16
nBigObjStart
=
0
);
EditTextObject
*
CreateBinTextObject
(
EditSelection
aSelection
,
SfxItemPool
*
,
sal_Bool
bAllowBigObjects
=
sal_False
,
sal_uInt16
nBigObjStart
=
0
);
EditSelection
InsertBinTextObject
(
EditTextObjectImpl
&
,
EditPaM
aPaM
);
EditSelection
InsertBinTextObject
(
const
EditTextObject
&
,
EditPaM
aPaM
);
EditSelection
InsertText
(
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
datatransfer
::
XTransferable
>&
rxDataObj
,
const
String
&
rBaseURL
,
const
EditPaM
&
rPaM
,
sal_Bool
bUseSpecial
);
EditSelection
InsertText
(
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
datatransfer
::
XTransferable
>&
rxDataObj
,
const
String
&
rBaseURL
,
const
EditPaM
&
rPaM
,
sal_Bool
bUseSpecial
);
EditPaM
Clear
();
EditPaM
Clear
();
...
@@ -609,7 +609,7 @@ private:
...
@@ -609,7 +609,7 @@ private:
sal_uInt32
WriteRTF
(
SvStream
&
rOutput
,
EditSelection
aSel
);
sal_uInt32
WriteRTF
(
SvStream
&
rOutput
,
EditSelection
aSel
);
sal_uInt32
WriteXML
(
SvStream
&
rOutput
,
EditSelection
aSel
);
sal_uInt32
WriteXML
(
SvStream
&
rOutput
,
EditSelection
aSel
);
sal_uInt32
WriteHTML
(
SvStream
&
rOutput
,
EditSelection
aSel
);
sal_uInt32
WriteHTML
(
SvStream
&
rOutput
,
EditSelection
aSel
);
sal_uInt32
WriteBin
(
SvStream
&
rOutput
,
EditSelection
aSel
,
sal_Bool
bStoreUnicode
=
sal_F
alse
);
sal_uInt32
WriteBin
(
SvStream
&
rOutput
,
EditSelection
aSel
,
bool
bStoreUnicode
=
f
alse
);
void
WriteItemAsRTF
(
const
SfxPoolItem
&
rItem
,
SvStream
&
rOutput
,
sal_uInt16
nPara
,
sal_uInt16
nPos
,
void
WriteItemAsRTF
(
const
SfxPoolItem
&
rItem
,
SvStream
&
rOutput
,
sal_uInt16
nPara
,
sal_uInt16
nPos
,
std
::
vector
<
SvxFontItem
*>&
rFontTable
,
SvxColorList
&
rColorList
);
std
::
vector
<
SvxFontItem
*>&
rFontTable
,
SvxColorList
&
rColorList
);
...
...
editeng/source/editeng/impedit4.cxx
Dosyayı görüntüle @
4da3a010
...
@@ -77,6 +77,7 @@
...
@@ -77,6 +77,7 @@
#include <editeng/edtdlg.hxx>
#include <editeng/edtdlg.hxx>
#include <vector>
#include <vector>
#include <boost/scoped_ptr.hpp>
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
;
using
namespace
::
com
::
sun
::
star
::
uno
;
using
namespace
::
com
::
sun
::
star
::
uno
;
...
@@ -298,12 +299,11 @@ static void lcl_FindValidAttribs( ItemList& rLst, ContentNode* pNode, sal_uInt16
...
@@ -298,12 +299,11 @@ static void lcl_FindValidAttribs( ItemList& rLst, ContentNode* pNode, sal_uInt16
}
}
}
}
sal_uInt32
ImpEditEngine
::
WriteBin
(
SvStream
&
rOutput
,
EditSelection
aSel
,
sal_B
ool
bStoreUnicodeStrings
)
sal_uInt32
ImpEditEngine
::
WriteBin
(
SvStream
&
rOutput
,
EditSelection
aSel
,
b
ool
bStoreUnicodeStrings
)
{
{
EditTextObjectImpl
*
pObj
=
(
EditTextObjectImpl
*
)
CreateBinTextObject
(
aSel
,
NULL
);
boost
::
scoped_ptr
<
EditTextObject
>
pObj
(
CreateBinTextObject
(
aSel
,
NULL
));
pObj
->
StoreUnicodeStrings
(
bStoreUnicodeStrings
);
pObj
->
mpImpl
->
StoreUnicodeStrings
(
bStoreUnicodeStrings
);
pObj
->
Store
(
rOutput
);
pObj
->
Store
(
rOutput
);
delete
pObj
;
return
0
;
return
0
;
}
}
...
@@ -1022,12 +1022,12 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel )
...
@@ -1022,12 +1022,12 @@ EditTextObject* ImpEditEngine::CreateTextObject( EditSelection aSel )
EditTextObject
*
ImpEditEngine
::
CreateBinTextObject
(
EditSelection
aSel
,
SfxItemPool
*
pPool
,
sal_Bool
bAllowBigObjects
,
sal_uInt16
nBigObjectStart
)
EditTextObject
*
ImpEditEngine
::
CreateBinTextObject
(
EditSelection
aSel
,
SfxItemPool
*
pPool
,
sal_Bool
bAllowBigObjects
,
sal_uInt16
nBigObjectStart
)
{
{
EditTextObject
Impl
*
pTxtObj
=
new
EditTextObjectImpl
(
pPool
);
EditTextObject
*
pTxtObj
=
new
EditTextObject
(
pPool
);
pTxtObj
->
SetVertical
(
IsVertical
()
);
pTxtObj
->
SetVertical
(
IsVertical
()
);
MapUnit
eMapUnit
=
(
MapUnit
)
aEditDoc
.
GetItemPool
().
GetMetric
(
DEF_METRIC
);
MapUnit
eMapUnit
=
(
MapUnit
)
aEditDoc
.
GetItemPool
().
GetMetric
(
DEF_METRIC
);
pTxtObj
->
SetMetric
(
(
sal_uInt16
)
eMapUnit
);
pTxtObj
->
mpImpl
->
SetMetric
(
(
sal_uInt16
)
eMapUnit
);
if
(
pTxtObj
->
IsOwnerOfPool
()
)
if
(
pTxtObj
->
mpImpl
->
IsOwnerOfPool
()
)
pTxtObj
->
GetPool
()
->
SetDefaultMetric
(
(
SfxMapUnit
)
eMapUnit
);
pTxtObj
->
mpImpl
->
GetPool
()
->
SetDefaultMetric
(
(
SfxMapUnit
)
eMapUnit
);
sal_uInt16
nStartNode
,
nEndNode
;
sal_uInt16
nStartNode
,
nEndNode
;
sal_uInt32
nTextPortions
=
0
;
sal_uInt32
nTextPortions
=
0
;
...
@@ -1042,7 +1042,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
...
@@ -1042,7 +1042,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
// Templates are not saved!
// Templates are not saved!
// (Only the name and family, template itself must be in App!)
// (Only the name and family, template itself must be in App!)
pTxtObj
->
SetScriptType
(
GetScriptType
(
aSel
)
);
pTxtObj
->
mpImpl
->
SetScriptType
(
GetScriptType
(
aSel
)
);
// iterate over the paragraphs ...
// iterate over the paragraphs ...
sal_uInt16
nNode
;
sal_uInt16
nNode
;
...
@@ -1068,7 +1068,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
...
@@ -1068,7 +1068,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
nEndPos
=
aSel
.
Max
().
GetIndex
();
nEndPos
=
aSel
.
Max
().
GetIndex
();
ContentInfo
*
pC
=
pTxtObj
->
CreateAndInsertContent
();
ContentInfo
*
pC
=
pTxtObj
->
mpImpl
->
CreateAndInsertContent
();
// The paragraph attributes ...
// The paragraph attributes ...
pC
->
GetParaAttribs
().
Set
(
pNode
->
GetContentAttribs
().
GetItems
()
);
pC
->
GetParaAttribs
().
Set
(
pNode
->
GetContentAttribs
().
GetItems
()
);
...
@@ -1092,7 +1092,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
...
@@ -1092,7 +1092,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
if
(
bEmptyPara
||
if
(
bEmptyPara
||
(
(
pAttr
->
GetEnd
()
>
nStartPos
)
&&
(
pAttr
->
GetStart
()
<
nEndPos
)
)
)
(
(
pAttr
->
GetEnd
()
>
nStartPos
)
&&
(
pAttr
->
GetStart
()
<
nEndPos
)
)
)
{
{
XEditAttribute
*
pX
=
pTxtObj
->
CreateAttrib
(
*
pAttr
->
GetItem
(),
pAttr
->
GetStart
(),
pAttr
->
GetEnd
()
);
XEditAttribute
*
pX
=
pTxtObj
->
mpImpl
->
CreateAttrib
(
*
pAttr
->
GetItem
(),
pAttr
->
GetStart
(),
pAttr
->
GetEnd
()
);
// Possibly Correct ...
// Possibly Correct ...
if
(
(
nNode
==
nStartNode
)
&&
(
nStartPos
!=
0
)
)
if
(
(
nNode
==
nStartNode
)
&&
(
nStartPos
!=
0
)
)
{
{
...
@@ -1107,7 +1107,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
...
@@ -1107,7 +1107,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
}
}
DBG_ASSERT
(
pX
->
GetEnd
()
<=
(
nEndPos
-
nStartPos
),
"CreateBinTextObject: Attribute too long!"
);
DBG_ASSERT
(
pX
->
GetEnd
()
<=
(
nEndPos
-
nStartPos
),
"CreateBinTextObject: Attribute too long!"
);
if
(
!
pX
->
GetLen
()
&&
!
bEmptyPara
)
if
(
!
pX
->
GetLen
()
&&
!
bEmptyPara
)
pTxtObj
->
DestroyAttrib
(
pX
);
pTxtObj
->
mpImpl
->
DestroyAttrib
(
pX
);
else
else
pC
->
GetAttribs
().
push_back
(
pX
);
pC
->
GetAttribs
().
push_back
(
pX
);
}
}
...
@@ -1126,7 +1126,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
...
@@ -1126,7 +1126,7 @@ EditTextObject* ImpEditEngine::CreateBinTextObject( EditSelection aSel, SfxItemP
if
(
bAllowBigObjects
&&
bOnlyFullParagraphs
&&
IsFormatted
()
&&
GetUpdateMode
()
&&
(
nTextPortions
>=
nBigObjectStart
)
)
if
(
bAllowBigObjects
&&
bOnlyFullParagraphs
&&
IsFormatted
()
&&
GetUpdateMode
()
&&
(
nTextPortions
>=
nBigObjectStart
)
)
{
{
XParaPortionList
*
pXList
=
new
XParaPortionList
(
GetRefDevice
(),
aPaperSize
.
Width
(),
nStretchX
,
nStretchY
);
XParaPortionList
*
pXList
=
new
XParaPortionList
(
GetRefDevice
(),
aPaperSize
.
Width
(),
nStretchX
,
nStretchY
);
pTxtObj
->
SetPortionInfo
(
pXList
);
pTxtObj
->
mpImpl
->
SetPortionInfo
(
pXList
);
for
(
nNode
=
nStartNode
;
nNode
<=
nEndNode
;
nNode
++
)
for
(
nNode
=
nStartNode
;
nNode
<=
nEndNode
;
nNode
++
)
{
{
const
ParaPortion
*
pParaPortion
=
GetParaPortions
()[
nNode
];
const
ParaPortion
*
pParaPortion
=
GetParaPortions
()[
nNode
];
...
@@ -1195,19 +1195,19 @@ EditSelection ImpEditEngine::InsertText( const EditTextObject& rTextObject, Edit
...
@@ -1195,19 +1195,19 @@ EditSelection ImpEditEngine::InsertText( const EditTextObject& rTextObject, Edit
aSel
.
Adjust
(
aEditDoc
);
aSel
.
Adjust
(
aEditDoc
);
if
(
aSel
.
HasRange
()
)
if
(
aSel
.
HasRange
()
)
aSel
=
ImpDeleteSelection
(
aSel
);
aSel
=
ImpDeleteSelection
(
aSel
);
EditSelection
aNewSel
=
InsertBinTextObject
(
(
EditTextObjectImpl
&
)
rTextObject
,
aSel
.
Max
()
);
EditSelection
aNewSel
=
InsertBinTextObject
(
rTextObject
,
aSel
.
Max
()
);
LeaveBlockNotifications
();
LeaveBlockNotifications
();
return
aNewSel
;
return
aNewSel
;
}
}
EditSelection
ImpEditEngine
::
InsertBinTextObject
(
EditTextObjectImpl
&
rTextObject
,
EditPaM
aPaM
)
EditSelection
ImpEditEngine
::
InsertBinTextObject
(
const
EditTextObject
&
rTextObject
,
EditPaM
aPaM
)
{
{
// Optimize: No getPos undFindParaportion, instead calculate index!
// Optimize: No getPos undFindParaportion, instead calculate index!
EditSelection
aSel
(
aPaM
,
aPaM
);
EditSelection
aSel
(
aPaM
,
aPaM
);
DBG_ASSERT
(
!
aSel
.
DbgIsBuggy
(
aEditDoc
),
"InsertBibTextObject: Selection broken!(1)"
);
DBG_ASSERT
(
!
aSel
.
DbgIsBuggy
(
aEditDoc
),
"InsertBibTextObject: Selection broken!(1)"
);
sal_Bool
bUsePortionInfo
=
sal_False
;
sal_Bool
bUsePortionInfo
=
sal_False
;
XParaPortionList
*
pPortionInfo
=
rTextObject
.
GetPortionInfo
();
XParaPortionList
*
pPortionInfo
=
rTextObject
.
mpImpl
->
GetPortionInfo
();
if
(
pPortionInfo
&&
(
(
long
)
pPortionInfo
->
GetPaperWidth
()
==
aPaperSize
.
Width
()
)
if
(
pPortionInfo
&&
(
(
long
)
pPortionInfo
->
GetPaperWidth
()
==
aPaperSize
.
Width
()
)
&&
(
pPortionInfo
->
GetRefMapMode
()
==
GetRefDevice
()
->
GetMapMode
()
)
&&
(
pPortionInfo
->
GetRefMapMode
()
==
GetRefDevice
()
->
GetMapMode
()
)
...
@@ -1222,20 +1222,20 @@ EditSelection ImpEditEngine::InsertBinTextObject( EditTextObjectImpl& rTextObjec
...
@@ -1222,20 +1222,20 @@ EditSelection ImpEditEngine::InsertBinTextObject( EditTextObjectImpl& rTextObjec
sal_Bool
bConvertItems
=
sal_False
;
sal_Bool
bConvertItems
=
sal_False
;
MapUnit
eSourceUnit
=
MapUnit
(),
eDestUnit
=
MapUnit
();
MapUnit
eSourceUnit
=
MapUnit
(),
eDestUnit
=
MapUnit
();
if
(
rTextObject
.
HasMetric
()
)
if
(
rTextObject
.
mpImpl
->
HasMetric
()
)
{
{
eSourceUnit
=
(
MapUnit
)
rTextObject
.
GetMetric
();
eSourceUnit
=
(
MapUnit
)
rTextObject
.
mpImpl
->
GetMetric
();
eDestUnit
=
(
MapUnit
)
aEditDoc
.
GetItemPool
().
GetMetric
(
DEF_METRIC
);
eDestUnit
=
(
MapUnit
)
aEditDoc
.
GetItemPool
().
GetMetric
(
DEF_METRIC
);
if
(
eSourceUnit
!=
eDestUnit
)
if
(
eSourceUnit
!=
eDestUnit
)
bConvertItems
=
sal_True
;
bConvertItems
=
sal_True
;
}
}
size_t
nContents
=
rTextObject
.
GetContents
().
size
();
size_t
nContents
=
rTextObject
.
mpImpl
->
GetContents
().
size
();
sal_uInt16
nPara
=
aEditDoc
.
GetPos
(
aPaM
.
GetNode
()
);
sal_uInt16
nPara
=
aEditDoc
.
GetPos
(
aPaM
.
GetNode
()
);
for
(
size_t
n
=
0
;
n
<
nContents
;
++
n
,
++
nPara
)
for
(
size_t
n
=
0
;
n
<
nContents
;
++
n
,
++
nPara
)
{
{
ContentInfo
*
pC
=
&
rTextObject
.
GetContents
()[
n
];
const
ContentInfo
*
pC
=
&
rTextObject
.
mpImpl
->
GetContents
()[
n
];
sal_Bool
bNewContent
=
aPaM
.
GetNode
()
->
Len
()
?
sal_False
:
sal_True
;
sal_Bool
bNewContent
=
aPaM
.
GetNode
()
->
Len
()
?
sal_False
:
sal_True
;
sal_uInt16
nStartPos
=
aPaM
.
GetIndex
();
sal_uInt16
nStartPos
=
aPaM
.
GetIndex
();
...
...
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