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
c180c944
Kaydet (Commit)
c180c944
authored
Eki 19, 2018
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw_redlinehide_3: add second SwNodeNum to SwTextNode
Change-Id: I62ebdb92ee384905bba9ef3865fcdb306775baf2
üst
ccac1f17
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
24 deletions
+70
-24
ndtxt.hxx
sw/inc/ndtxt.hxx
+7
-12
ndtxt.cxx
sw/source/core/txtnode/ndtxt.cxx
+63
-12
No files found.
sw/inc/ndtxt.hxx
Dosyayı görüntüle @
c180c944
...
...
@@ -92,6 +92,7 @@ class SW_DLLPUBLIC SwTextNode
std
::
unique_ptr
<
SwpHints
>
m_pSwpHints
;
mutable
SwNodeNum
*
mpNodeNum
;
///< Numbering for this paragraph.
mutable
SwNodeNum
*
mpNodeNumRLHidden
;
///< Numbering for this paragraph (hidden redlines)
OUString
m_Text
;
...
...
@@ -165,12 +166,6 @@ class SW_DLLPUBLIC SwTextNode
SAL_DLLPRIVATE
void
InitSwParaStatistics
(
bool
bNew
);
/** create number for this text node, if not already existing
@return number of this node
*/
SwNodeNum
*
CreateNum
()
const
;
inline
void
TryDeleteSwpHints
();
SAL_DLLPRIVATE
void
impl_FormatToTextAttr
(
const
SfxItemSet
&
i_rAttrSet
);
...
...
@@ -428,12 +423,9 @@ public:
*/
SwNumRule
*
GetNumRule
(
bool
bInParent
=
true
)
const
;
const
SwNodeNum
*
GetNum
()
const
{
return
mpNodeNum
;
}
const
SwNodeNum
*
GetNum
(
SwRootFrame
const
*
pLayout
=
nullptr
)
const
;
SwNumberTree
::
tNumberVector
GetNumberVector
()
const
;
SwNumberTree
::
tNumberVector
GetNumberVector
(
SwRootFrame
const
*
pLayout
=
nullptr
)
const
;
/**
Returns if this text node is an outline.
...
...
@@ -467,7 +459,8 @@ public:
MAXLEVEL
*/
OUString
GetNumString
(
const
bool
_bInclPrefixAndSuffixStrings
=
true
,
const
unsigned
int
_nRestrictToThisLevel
=
MAXLEVEL
)
const
;
const
unsigned
int
_nRestrictToThisLevel
=
MAXLEVEL
,
SwRootFrame
const
*
pLayout
=
nullptr
)
const
;
/**
Returns the additional indents of this text node and its numbering.
...
...
@@ -773,7 +766,9 @@ public:
bool
IsCountedInList
()
const
;
void
AddToList
();
void
AddToListRLHidden
();
void
RemoveFromList
();
void
RemoveFromListRLHidden
();
bool
IsInList
()
const
;
bool
IsFirstOfNumRule
()
const
;
...
...
sw/source/core/txtnode/ndtxt.cxx
Dosyayı görüntüle @
c180c944
...
...
@@ -201,6 +201,7 @@ SwTextNode *SwNodes::MakeTextNode( const SwNodeIndex & rWhere,
SwTextNode
::
SwTextNode
(
const
SwNodeIndex
&
rWhere
,
SwTextFormatColl
*
pTextColl
,
const
SfxItemSet
*
pAutoAttr
)
:
SwContentNode
(
rWhere
,
SwNodeType
::
Text
,
pTextColl
),
mpNodeNum
(
nullptr
),
mpNodeNumRLHidden
(
nullptr
),
m_Text
(),
m_pParaIdleData_Impl
(
nullptr
),
m_bContainsHiddenChars
(
false
),
...
...
@@ -2865,6 +2866,7 @@ void SwTextNode::NumRuleChgd()
if
(
pNumRule
&&
pNumRule
!=
GetNum
()
->
GetNumRule
()
)
{
mpNodeNum
->
ChangeNumRule
(
*
pNumRule
);
mpNodeNumRLHidden
->
ChangeNumRule
(
*
pNumRule
);
}
}
...
...
@@ -3131,14 +3133,15 @@ bool SwTextNode::HasBullet() const
// #128041# - introduce parameter <_bInclPrefixAndSuffixStrings>
//i53420 added max outline parameter
OUString
SwTextNode
::
GetNumString
(
const
bool
_bInclPrefixAndSuffixStrings
,
const
unsigned
int
_nRestrictToThisLevel
)
const
const
unsigned
int
_nRestrictToThisLevel
,
SwRootFrame
const
*
const
pLayout
)
const
{
if
(
GetDoc
()
->
IsClipBoard
()
&&
m_pNumStringCache
.
get
())
{
// #i111677# do not expand number strings in clipboard documents
return
*
m_pNumStringCache
;
}
const
SwNumRule
*
pRule
=
GetNum
(
)
?
GetNum
(
)
->
GetNumRule
()
:
nullptr
;
const
SwNumRule
*
pRule
=
GetNum
(
pLayout
)
?
GetNum
(
pLayout
)
->
GetNumRule
()
:
nullptr
;
if
(
pRule
&&
IsCountedInList
()
)
{
...
...
@@ -3148,7 +3151,7 @@ OUString SwTextNode::GetNumString( const bool _bInclPrefixAndSuffixStrings,
(
style
::
NumberingType
::
NUMBER_NONE
==
rNumberType
.
GetNumberingType
()))
{
return
pRule
->
MakeNumString
(
GetNum
()
->
GetNumberVector
(),
return
pRule
->
MakeNumString
(
GetNum
(
pLayout
)
->
GetNumberVector
(),
_bInclPrefixAndSuffixStrings
,
false
,
_nRestrictToThisLevel
,
...
...
@@ -3957,20 +3960,19 @@ SwFormatColl* SwTextNode::ChgFormatColl( SwFormatColl *pNewColl )
return
pOldColl
;
}
SwNodeNum
*
SwTextNode
::
CreateNum
(
)
const
const
SwNodeNum
*
SwTextNode
::
GetNum
(
SwRootFrame
const
*
const
pLayout
)
const
{
if
(
!
mpNodeNum
)
{
mpNodeNum
=
new
SwNodeNum
(
const_cast
<
SwTextNode
*>
(
this
),
false
);
}
return
mpNodeNum
;
// invariant: it's only in list in Hide mode if it's in list in normal mode
assert
(
mpNodeNum
||
!
mpNodeNumRLHidden
);
return
pLayout
&&
pLayout
->
IsHideRedlines
()
?
mpNodeNumRLHidden
:
mpNodeNum
;
}
SwNumberTree
::
tNumberVector
SwTextNode
::
GetNumberVector
()
const
SwNumberTree
::
tNumberVector
SwTextNode
::
GetNumberVector
(
SwRootFrame
const
*
const
pLayout
)
const
{
if
(
GetNum
()
)
if
(
SwNodeNum
const
*
const
pNum
=
GetNum
(
pLayout
)
)
{
return
GetNum
()
->
GetNumberVector
();
return
pNum
->
GetNumberVector
();
}
else
{
...
...
@@ -4076,6 +4078,8 @@ int SwTextNode::GetAttrListLevel() const
int
SwTextNode
::
GetActualListLevel
()
const
{
assert
(
!
GetNum
()
||
!
mpNodeNumRLHidden
||
// must be in sync
GetNum
()
->
GetLevelInListTree
()
==
mpNodeNumRLHidden
->
GetLevelInListTree
());
return
GetNum
()
?
GetNum
()
->
GetLevelInListTree
()
:
-
1
;
}
...
...
@@ -4260,11 +4264,45 @@ void SwTextNode::AddToList()
assert
(
!
mpNodeNum
);
mpNodeNum
=
new
SwNodeNum
(
this
,
false
);
pList
->
InsertListItem
(
*
mpNodeNum
,
false
,
GetAttrListLevel
());
// iterate all frames & if there's one with hidden layout...
SwIterator
<
SwTextFrame
,
SwTextNode
,
sw
::
IteratorMode
::
UnwrapMulti
>
iter
(
*
this
);
for
(
SwTextFrame
*
pFrame
=
iter
.
First
();
pFrame
;
pFrame
=
iter
.
Next
())
{
if
(
pFrame
->
getRootFrame
()
->
IsHideRedlines
())
{
sw
::
MergedPara
const
*
const
pMerged
=
pFrame
->
GetMergedPara
();
if
(
!
pMerged
||
this
==
pMerged
->
pParaPropsNode
)
{
AddToListRLHidden
();
}
break
;
// assume it's consistent, need to check only once
}
}
}
}
void
SwTextNode
::
AddToListRLHidden
()
{
if
(
mpNodeNumRLHidden
)
{
assert
(
false
);
OSL_FAIL
(
"<SwTextNode::AddToListRLHidden()> - the text node is already added to a list. Serious defect"
);
return
;
}
SwList
*
const
pList
(
FindList
(
this
));
if
(
pList
)
{
assert
(
!
mpNodeNumRLHidden
);
mpNodeNumRLHidden
=
new
SwNodeNum
(
this
,
true
);
pList
->
InsertListItem
(
*
mpNodeNumRLHidden
,
true
,
GetAttrListLevel
());
}
}
void
SwTextNode
::
RemoveFromList
()
{
// sw_redlinehide: ensure it's removed from the other half too!
RemoveFromListRLHidden
();
if
(
IsInList
()
)
{
SwList
::
RemoveListItem
(
*
mpNodeNum
);
...
...
@@ -4275,6 +4313,19 @@ void SwTextNode::RemoveFromList()
}
}
void
SwTextNode
::
RemoveFromListRLHidden
()
{
if
(
mpNodeNumRLHidden
)
// direct access because RemoveFromList doesn't have layout
{
assert
(
mpNodeNumRLHidden
->
GetParent
()
||
!
GetNodes
().
IsDocNodes
());
SwList
::
RemoveListItem
(
*
mpNodeNumRLHidden
);
delete
mpNodeNumRLHidden
;
mpNodeNumRLHidden
=
nullptr
;
SetWordCountDirty
(
true
);
}
}
bool
SwTextNode
::
IsInList
()
const
{
return
GetNum
()
!=
nullptr
&&
GetNum
()
->
GetParent
()
!=
nullptr
;
...
...
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