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
befe83a7
Kaydet (Commit)
befe83a7
authored
Nis 30, 2015
tarafından
Jan Holesovsky
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: Decouple ND_SECTIONDUMMY from ND_SECTIONNODE, and rename it.
Change-Id: Ic88a133d20336ce0548154847edd9900cb5b7691
üst
1475ee32
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
22 deletions
+22
-22
ndtyp.hxx
sw/inc/ndtyp.hxx
+3
-4
node.hxx
sw/inc/node.hxx
+9
-8
docnew.cxx
sw/source/core/doc/docnew.cxx
+1
-1
nodes.cxx
sw/source/core/docnode/nodes.cxx
+9
-9
No files found.
sw/inc/ndtyp.hxx
Dosyayı görüntüle @
befe83a7
...
@@ -26,13 +26,12 @@
...
@@ -26,13 +26,12 @@
// in base class.
// in base class.
const
sal_uInt8
ND_ENDNODE
=
0x01
;
const
sal_uInt8
ND_ENDNODE
=
0x01
;
const
sal_uInt8
ND_STARTNODE
=
0x02
;
const
sal_uInt8
ND_STARTNODE
=
0x02
;
const
sal_uInt8
ND_TABLENODE
=
0x04
|
ND_STARTNODE
;
//
SwTableNode is derived from SwStartNode
const
sal_uInt8
ND_TABLENODE
=
0x04
|
ND_STARTNODE
;
//
/< SwTableNode is derived from SwStartNode.
const
sal_uInt8
ND_TEXTNODE
=
0x08
;
const
sal_uInt8
ND_TEXTNODE
=
0x08
;
const
sal_uInt8
ND_GRFNODE
=
0x10
;
const
sal_uInt8
ND_GRFNODE
=
0x10
;
const
sal_uInt8
ND_OLENODE
=
0x20
;
const
sal_uInt8
ND_OLENODE
=
0x20
;
const
sal_uInt8
ND_SECTIONDUMMY
=
0x40
;
//(ND_SECTIONNODE & ~ND_STARTNODE);
const
sal_uInt8
ND_SECTIONNODE
=
0x40
|
ND_STARTNODE
;
///< SwSectionNode is derived from SwStartNode.
const
sal_uInt8
ND_PLACEHOLDER
=
0x80
;
const
sal_uInt8
ND_SECTIONNODE
=
ND_SECTIONDUMMY
|
ND_STARTNODE
;
// NoTxtNode (if any of the 2 bits are set).
// NoTxtNode (if any of the 2 bits are set).
const
sal_uInt8
ND_NOTXTNODE
=
ND_GRFNODE
|
ND_OLENODE
;
const
sal_uInt8
ND_NOTXTNODE
=
ND_GRFNODE
|
ND_OLENODE
;
...
...
sw/inc/node.hxx
Dosyayı görüntüle @
befe83a7
...
@@ -567,15 +567,16 @@ public:
...
@@ -567,15 +567,16 @@ public:
};
};
/** This class is internal. And quite frankly I don't know what ND_SECTIONDUMMY is for,
/** This class is internal, used only during DocumentContentOperationsManager::CopyWithFlyInFly(), and for undo.
the class has been merely created to replace "SwNode( ND_SECTIONDUMMY )", the only case
of instantiating SwNode directly. Now SwNode can be an abstract base class. */
Some of the nodes are then replaced with SwPlaceholderNode, and at the end of the operation, removed again.
class
SwDummySectionNode
FIXME find out if this is really necessary, and if we can avoid creation of the SwPlaceholderNodes in the first place.
:
private
SwNode
*/
class
SwPlaceholderNode
:
private
SwNode
{
{
private
:
private
:
friend
class
SwNodes
;
friend
class
SwNodes
;
Sw
DummySectionNode
(
const
SwNodeIndex
&
rWhere
);
Sw
PlaceholderNode
(
const
SwNodeIndex
&
rWhere
);
};
};
inline
SwEndNode
*
SwNode
::
GetEndNode
()
inline
SwEndNode
*
SwNode
::
GetEndNode
()
...
@@ -731,8 +732,8 @@ inline const SfxPoolItem& SwCntntNode::GetAttr( sal_uInt16 nWhich,
...
@@ -731,8 +732,8 @@ inline const SfxPoolItem& SwCntntNode::GetAttr( sal_uInt16 nWhich,
return
GetSwAttrSet
().
Get
(
nWhich
,
bInParents
);
return
GetSwAttrSet
().
Get
(
nWhich
,
bInParents
);
}
}
inline
Sw
DummySectionNode
::
SwDummySectionNode
(
const
SwNodeIndex
&
rWhere
)
inline
Sw
PlaceholderNode
::
SwPlaceholderNode
(
const
SwNodeIndex
&
rWhere
)
:
SwNode
(
rWhere
,
ND_SECTIONDUMMY
)
:
SwNode
(
rWhere
,
ND_PLACEHOLDER
)
{
{
}
}
...
...
sw/source/core/doc/docnew.cxx
Dosyayı görüntüle @
befe83a7
...
@@ -942,7 +942,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu
...
@@ -942,7 +942,7 @@ SwNodeIndex SwDoc::AppendDoc(const SwDoc& rSource, sal_uInt16 const nStartPageNu
#endif
#endif
pTargetShell
->
StartAllAction
();
pTargetShell
->
StartAllAction
();
// Otherwise we have to handle Sw
DummySection
Nodes as first node
// Otherwise we have to handle Sw
Placeholder
Nodes as first node
if
(
pTargetPageDesc
)
{
if
(
pTargetPageDesc
)
{
OUString
name
=
pTargetPageDesc
->
GetName
();
OUString
name
=
pTargetPageDesc
->
GetName
();
pTargetShell
->
InsertPageBreak
(
&
name
,
nStartPageNumber
);
pTargetShell
->
InsertPageBreak
(
&
name
,
nStartPageNumber
);
...
...
sw/source/core/docnode/nodes.cxx
Dosyayı görüntüle @
befe83a7
...
@@ -622,7 +622,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
...
@@ -622,7 +622,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
rNodes
))
rNodes
))
{
{
// use placeholder in UndoNodes array
// use placeholder in UndoNodes array
new
Sw
DummySectionNode
(
aIdx
);
new
Sw
PlaceholderNode
(
aIdx
);
}
}
else
else
{
{
...
@@ -694,7 +694,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
...
@@ -694,7 +694,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
aIdx
-=
nInsPos
;
aIdx
-=
nInsPos
;
nInsPos
=
0
;
nInsPos
=
0
;
}
}
new
Sw
DummySectionNode
(
aIdx
);
new
Sw
PlaceholderNode
(
aIdx
);
--
aRg
.
aEnd
;
--
aRg
.
aEnd
;
--
aIdx
;
--
aIdx
;
break
;
break
;
...
@@ -814,7 +814,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
...
@@ -814,7 +814,7 @@ bool SwNodes::_MoveNodes( const SwNodeRange& aRange, SwNodes & rNodes,
}
}
break
;
break
;
case
ND_
SECTIONDUMMY
:
case
ND_
PLACEHOLDER
:
if
(
GetDoc
()
->
GetIDocumentUndoRedo
().
IsUndoNodes
(
*
this
))
if
(
GetDoc
()
->
GetIDocumentUndoRedo
().
IsUndoNodes
(
*
this
))
{
{
if
(
&
rNodes
==
this
)
// inside UndoNodesArray
if
(
&
rNodes
==
this
)
// inside UndoNodesArray
...
@@ -1753,7 +1753,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
...
@@ -1753,7 +1753,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
// insert a DummyNode for a TableNode
// insert a DummyNode for a TableNode
if
(
bTblInsDummyNode
)
if
(
bTblInsDummyNode
)
new
Sw
DummySectionNode
(
aInsPos
);
new
Sw
PlaceholderNode
(
aInsPos
);
// copy all of the table's nodes into the current cell
// copy all of the table's nodes into the current cell
for
(
++
aRg
.
aStart
;
aRg
.
aStart
.
GetIndex
()
<
for
(
++
aRg
.
aStart
;
aRg
.
aStart
.
GetIndex
()
<
...
@@ -1762,7 +1762,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
...
@@ -1762,7 +1762,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
{
{
// insert a DummyNode for the box-StartNode?
// insert a DummyNode for the box-StartNode?
if
(
bTblInsDummyNode
)
if
(
bTblInsDummyNode
)
new
Sw
DummySectionNode
(
aInsPos
);
new
Sw
PlaceholderNode
(
aInsPos
);
SwStartNode
*
pSttNd
=
aRg
.
aStart
.
GetNode
().
GetStartNode
();
SwStartNode
*
pSttNd
=
aRg
.
aStart
.
GetNode
().
GetStartNode
();
_CopyNodes
(
SwNodeRange
(
*
pSttNd
,
+
1
,
_CopyNodes
(
SwNodeRange
(
*
pSttNd
,
+
1
,
...
@@ -1771,12 +1771,12 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
...
@@ -1771,12 +1771,12 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
// insert a DummyNode for the box-EndNode?
// insert a DummyNode for the box-EndNode?
if
(
bTblInsDummyNode
)
if
(
bTblInsDummyNode
)
new
Sw
DummySectionNode
(
aInsPos
);
new
Sw
PlaceholderNode
(
aInsPos
);
aRg
.
aStart
=
*
pSttNd
->
EndOfSectionNode
();
aRg
.
aStart
=
*
pSttNd
->
EndOfSectionNode
();
}
}
// insert a DummyNode for the table-EndNode
// insert a DummyNode for the table-EndNode
if
(
bTblInsDummyNode
)
if
(
bTblInsDummyNode
)
new
Sw
DummySectionNode
(
aInsPos
);
new
Sw
PlaceholderNode
(
aInsPos
);
aRg
.
aStart
=
*
pAktNode
->
EndOfSectionNode
();
aRg
.
aStart
=
*
pAktNode
->
EndOfSectionNode
();
}
}
else
else
...
@@ -1862,7 +1862,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
...
@@ -1862,7 +1862,7 @@ void SwNodes::_CopyNodes( const SwNodeRange& rRange,
}
}
break
;
break
;
case
ND_
SECTIONDUMMY
:
case
ND_
PLACEHOLDER
:
if
(
GetDoc
()
->
GetIDocumentUndoRedo
().
IsUndoNodes
(
*
this
))
if
(
GetDoc
()
->
GetIDocumentUndoRedo
().
IsUndoNodes
(
*
this
))
{
{
// than a SectionNode (start/end) is needed at the current
// than a SectionNode (start/end) is needed at the current
...
@@ -1889,7 +1889,7 @@ void SwNodes::_DelDummyNodes( const SwNodeRange& rRg )
...
@@ -1889,7 +1889,7 @@ void SwNodes::_DelDummyNodes( const SwNodeRange& rRg )
SwNodeIndex
aIdx
(
rRg
.
aStart
);
SwNodeIndex
aIdx
(
rRg
.
aStart
);
while
(
aIdx
.
GetIndex
()
<
rRg
.
aEnd
.
GetIndex
()
)
while
(
aIdx
.
GetIndex
()
<
rRg
.
aEnd
.
GetIndex
()
)
{
{
if
(
ND_SECTIONDUMMY
==
aIdx
.
GetNode
().
GetNodeType
()
)
if
(
ND_PLACEHOLDER
==
aIdx
.
GetNode
().
GetNodeType
()
)
RemoveNode
(
aIdx
.
GetIndex
(),
1
,
true
);
RemoveNode
(
aIdx
.
GetIndex
(),
1
,
true
);
else
else
++
aIdx
;
++
aIdx
;
...
...
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