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
0231617f
Kaydet (Commit)
0231617f
authored
Ock 21, 2012
tarafından
Michael Stahl
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
sw: tweak translation
60c8a970
üst
a1e4a112
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
76 additions
and
85 deletions
+76
-85
fecopy.cxx
sw/source/core/frmedt/fecopy.cxx
+13
-14
fetab.cxx
sw/source/core/frmedt/fetab.cxx
+14
-16
fews.cxx
sw/source/core/frmedt/fews.cxx
+3
-4
tblsel.cxx
sw/source/core/frmedt/tblsel.cxx
+46
-51
No files found.
sw/source/core/frmedt/fecopy.cxx
Dosyayı görüntüle @
0231617f
...
@@ -292,12 +292,11 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
...
@@ -292,12 +292,11 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
{
{
sal_Bool
bRet
=
sal_True
;
sal_Bool
bRet
=
sal_True
;
// The list should be copied, while new objects below
// The list should be copied, because below new objects will be selected
// were selected
const
SdrMarkList
aMrkList
(
Imp
()
->
GetDrawView
()
->
GetMarkedObjectList
()
);
const
SdrMarkList
aMrkList
(
Imp
()
->
GetDrawView
()
->
GetMarkedObjectList
()
);
sal_uLong
nMarkCount
=
aMrkList
.
GetMarkCount
();
sal_uLong
nMarkCount
=
aMrkList
.
GetMarkCount
();
if
(
!
pDestShell
->
Imp
()
->
GetDrawView
()
)
if
(
!
pDestShell
->
Imp
()
->
GetDrawView
()
)
// should
be generated
// should
create it now
pDestShell
->
MakeDrawView
();
pDestShell
->
MakeDrawView
();
else
if
(
bSelectInsert
)
else
if
(
bSelectInsert
)
pDestShell
->
Imp
()
->
GetDrawView
()
->
UnmarkAll
();
pDestShell
->
Imp
()
->
GetDrawView
()
->
UnmarkAll
();
...
@@ -322,7 +321,7 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
...
@@ -322,7 +321,7 @@ sal_Bool SwFEShell::CopyDrawSel( SwFEShell* pDestShell, const Point& rSttPt,
if
(
pDestDrwView
->
IsGroupEntered
()
)
if
(
pDestDrwView
->
IsGroupEntered
()
)
{
{
// insert into the group, when it belongs to an entered group
// insert into the group, when it belongs to an entered group
// or when the object is not
coupled to
a character
// or when the object is not
anchored as
a character
if
(
pSrcDrwView
->
IsGroupEntered
()
||
if
(
pSrcDrwView
->
IsGroupEntered
()
||
(
FLY_AS_CHAR
!=
rAnchor
.
GetAnchorId
())
)
(
FLY_AS_CHAR
!=
rAnchor
.
GetAnchorId
())
)
...
@@ -470,14 +469,14 @@ sal_Bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
...
@@ -470,14 +469,14 @@ sal_Bool SwFEShell::Copy( SwFEShell* pDestShell, const Point& rSttPt,
// Shift references
// Shift references
sal_Bool
bCopyIsMove
=
pDoc
->
IsCopyIsMove
();
sal_Bool
bCopyIsMove
=
pDoc
->
IsCopyIsMove
();
if
(
bIsMove
)
if
(
bIsMove
)
// set a flag in Doc,
therefore
in TextNodes
// set a flag in Doc,
handled
in TextNodes
pDoc
->
SetCopyIsMove
(
sal_True
);
pDoc
->
SetCopyIsMove
(
sal_True
);
RedlineMode_t
eOldRedlMode
=
pDestShell
->
GetDoc
()
->
GetRedlineMode
();
RedlineMode_t
eOldRedlMode
=
pDestShell
->
GetDoc
()
->
GetRedlineMode
();
pDestShell
->
GetDoc
()
->
SetRedlineMode_intern
(
(
RedlineMode_t
)(
eOldRedlMode
|
nsRedlineMode_t
::
REDLINE_DELETE_REDLINES
));
pDestShell
->
GetDoc
()
->
SetRedlineMode_intern
(
(
RedlineMode_t
)(
eOldRedlMode
|
nsRedlineMode_t
::
REDLINE_DELETE_REDLINES
));
//
Are the
re table formulas in the area, then display the table first
//
If there a
re table formulas in the area, then display the table first
// s
uch
that the table formula can calculate a new value first
// s
o
that the table formula can calculate a new value first
// (individual boxes in the area are retrieved via the layout)
// (individual boxes in the area are retrieved via the layout)
SwFieldType
*
pTblFldTyp
=
pDestShell
->
GetDoc
()
->
GetSysFldType
(
RES_TABLEFLD
);
SwFieldType
*
pTblFldTyp
=
pDestShell
->
GetDoc
()
->
GetSysFldType
(
RES_TABLEFLD
);
...
@@ -699,8 +698,8 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
...
@@ -699,8 +698,8 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
SwNodeIndex
aIdx
(
pClpDoc
->
GetNodes
().
GetEndOfExtras
(),
2
);
SwNodeIndex
aIdx
(
pClpDoc
->
GetNodes
().
GetEndOfExtras
(),
2
);
SwPaM
aCpyPam
(
aIdx
);
//DocStart
SwPaM
aCpyPam
(
aIdx
);
//DocStart
//
Are the
re table formulas in the area, then display the table first
//
If there a
re table formulas in the area, then display the table first
// s
uch
that the table formula can calculate a new value first
// s
o
that the table formula can calculate a new value first
// (individual boxes in the area are retrieved via the layout)
// (individual boxes in the area are retrieved via the layout)
SwFieldType
*
pTblFldTyp
=
GetDoc
()
->
GetSysFldType
(
RES_TABLEFLD
);
SwFieldType
*
pTblFldTyp
=
GetDoc
()
->
GetSysFldType
(
RES_TABLEFLD
);
...
@@ -899,7 +898,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
...
@@ -899,7 +898,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
else
if
(
*
aCpyPam
.
GetPoint
()
==
*
aCpyPam
.
GetMark
()
&&
else
if
(
*
aCpyPam
.
GetPoint
()
==
*
aCpyPam
.
GetMark
()
&&
pClpDoc
->
GetSpzFrmFmts
()
->
Count
()
)
pClpDoc
->
GetSpzFrmFmts
()
->
Count
()
)
{
{
//
draw a DrawView this slo
w
//
we need a DrawVie
w
if
(
!
Imp
()
->
GetDrawView
()
)
if
(
!
Imp
()
->
GetDrawView
()
)
MakeDrawView
();
MakeDrawView
();
...
@@ -994,7 +993,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
...
@@ -994,7 +993,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
if
(
pFlyFrm
)
if
(
pFlyFrm
)
SelectFlyFrm
(
*
pFlyFrm
,
sal_True
);
SelectFlyFrm
(
*
pFlyFrm
,
sal_True
);
// always pick the first FlyFrame only; the others
// always pick the first FlyFrame only; the others
// were
via Fly in Fly copied to the clipboard
// were
copied to the clipboard via Fly in Fly
break
;
break
;
}
}
else
else
...
@@ -1036,7 +1035,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
...
@@ -1036,7 +1035,7 @@ sal_Bool SwFEShell::Paste( SwDoc* pClpDoc, sal_Bool bIncludingPageFrames )
pBoxNd
->
GetIndex
()
&&
pBoxNd
->
GetIndex
()
&&
aCpyPam
.
GetPoint
()
->
nNode
!=
aCpyPam
.
GetMark
()
->
nNode
)
aCpyPam
.
GetPoint
()
->
nNode
!=
aCpyPam
.
GetMark
()
->
nNode
)
{
{
// Copy more
as
1 node in the current box. But
// Copy more
than
1 node in the current box. But
// then the BoxAttribute should be removed
// then the BoxAttribute should be removed
GetDoc
()
->
ClearBoxNumAttrs
(
rInsPos
.
nNode
);
GetDoc
()
->
ClearBoxNumAttrs
(
rInsPos
.
nNode
);
}
}
...
@@ -1275,8 +1274,8 @@ sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
...
@@ -1275,8 +1274,8 @@ sal_Bool SwFEShell::GetDrawObjGraphic( sal_uLong nFmt, Graphic& rGrf ) const
else
else
{
{
// fix(23806): not the origial size, but the current one.
// fix(23806): not the origial size, but the current one.
// Otherwise it could
occur the for vector
graphics
// Otherwise it could
happen that for vector
graphics
// many MB's
are requested
// many MB's
of memory are allocated.
const
Size
aSz
(
FindFlyFrm
()
->
Prt
().
SSize
()
);
const
Size
aSz
(
FindFlyFrm
()
->
Prt
().
SSize
()
);
VirtualDevice
aVirtDev
(
*
GetWin
()
);
VirtualDevice
aVirtDev
(
*
GetWin
()
);
...
...
sw/source/core/frmedt/fetab.cxx
Dosyayı görüntüle @
0231617f
...
@@ -202,7 +202,7 @@ void SwFEShell::ParkCursorInTab()
...
@@ -202,7 +202,7 @@ void SwFEShell::ParkCursorInTab()
#***********************************************************************/
#***********************************************************************/
sal_Bool
SwFEShell
::
InsertRow
(
sal_uInt16
nCnt
,
sal_Bool
bBehind
)
sal_Bool
SwFEShell
::
InsertRow
(
sal_uInt16
nCnt
,
sal_Bool
bBehind
)
{
{
// check if
Sp
oint/Mark of current cursor are in a table
// check if
P
oint/Mark of current cursor are in a table
SwFrm
*
pFrm
=
GetCurrFrm
();
SwFrm
*
pFrm
=
GetCurrFrm
();
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
return
sal_False
;
return
sal_False
;
...
@@ -233,7 +233,7 @@ sal_Bool SwFEShell::InsertRow( sal_uInt16 nCnt, sal_Bool bBehind )
...
@@ -233,7 +233,7 @@ sal_Bool SwFEShell::InsertRow( sal_uInt16 nCnt, sal_Bool bBehind )
sal_Bool
SwFEShell
::
InsertCol
(
sal_uInt16
nCnt
,
sal_Bool
bBehind
)
sal_Bool
SwFEShell
::
InsertCol
(
sal_uInt16
nCnt
,
sal_Bool
bBehind
)
{
{
// check if
Sp
oint/Mark of current cursor are in a table
// check if
P
oint/Mark of current cursor are in a table
SwFrm
*
pFrm
=
GetCurrFrm
();
SwFrm
*
pFrm
=
GetCurrFrm
();
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
return
sal_False
;
return
sal_False
;
...
@@ -295,7 +295,7 @@ sal_Bool SwFEShell::IsLastCellInRow() const
...
@@ -295,7 +295,7 @@ sal_Bool SwFEShell::IsLastCellInRow() const
sal_Bool
SwFEShell
::
DeleteCol
()
sal_Bool
SwFEShell
::
DeleteCol
()
{
{
// check if
Sp
oint/Mark of current cursor are in a table
// check if
P
oint/Mark of current cursor are in a table
SwFrm
*
pFrm
=
GetCurrFrm
();
SwFrm
*
pFrm
=
GetCurrFrm
();
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
return
sal_False
;
return
sal_False
;
...
@@ -341,7 +341,7 @@ sal_Bool SwFEShell::DeleteCol()
...
@@ -341,7 +341,7 @@ sal_Bool SwFEShell::DeleteCol()
sal_Bool
SwFEShell
::
DeleteRow
()
sal_Bool
SwFEShell
::
DeleteRow
()
{
{
// check if
Sp
oint/Mark of current cursor are in a table
// check if
P
oint/Mark of current cursor are in a table
SwFrm
*
pFrm
=
GetCurrFrm
();
SwFrm
*
pFrm
=
GetCurrFrm
();
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
return
sal_False
;
return
sal_False
;
...
@@ -365,11 +365,11 @@ sal_Bool SwFEShell::DeleteRow()
...
@@ -365,11 +365,11 @@ sal_Bool SwFEShell::DeleteRow()
{
{
TblWait
(
aBoxes
.
size
(),
pFrm
,
*
GetDoc
()
->
GetDocShell
()
);
TblWait
(
aBoxes
.
size
(),
pFrm
,
*
GetDoc
()
->
GetDocShell
()
);
// Delete c
rsr
from the deletion area.
// Delete c
ursors
from the deletion area.
// Then the cursor is:
// Then the cursor is:
//
- there is one line next to
this
//
1. the following row, if there is another row after
this
//
- there is one line previous to
this
//
2. the preceding row, if there is another row before
this
//
- otherwise always next
//
3. otherwise below the table
{
{
SwTableNode
*
pTblNd
=
((
SwCntntFrm
*
)
pFrm
)
->
GetNode
()
->
FindTableNode
();
SwTableNode
*
pTblNd
=
((
SwCntntFrm
*
)
pFrm
)
->
GetNode
()
->
FindTableNode
();
...
@@ -430,7 +430,7 @@ sal_Bool SwFEShell::DeleteRow()
...
@@ -430,7 +430,7 @@ sal_Bool SwFEShell::DeleteRow()
sal_uLong
nIdx
;
sal_uLong
nIdx
;
if
(
pNextBox
)
// put cursor here
if
(
pNextBox
)
// put cursor here
nIdx
=
pNextBox
->
GetSttIdx
()
+
1
;
nIdx
=
pNextBox
->
GetSttIdx
()
+
1
;
else
// otherwise be
hind
the table
else
// otherwise be
low
the table
nIdx
=
pTblNd
->
EndOfSectionIndex
()
+
1
;
nIdx
=
pTblNd
->
EndOfSectionIndex
()
+
1
;
SwNodeIndex
aIdx
(
GetDoc
()
->
GetNodes
(),
nIdx
);
SwNodeIndex
aIdx
(
GetDoc
()
->
GetNodes
(),
nIdx
);
...
@@ -467,7 +467,7 @@ sal_Bool SwFEShell::DeleteRow()
...
@@ -467,7 +467,7 @@ sal_Bool SwFEShell::DeleteRow()
sal_uInt16
SwFEShell
::
MergeTab
()
sal_uInt16
SwFEShell
::
MergeTab
()
{
{
// check if
Sp
oint/Mark of current cursor are in a table
// check if
P
oint/Mark of current cursor are in a table
sal_uInt16
nRet
=
TBLMERGE_NOSELECTION
;
sal_uInt16
nRet
=
TBLMERGE_NOSELECTION
;
if
(
IsTableMode
()
)
if
(
IsTableMode
()
)
{
{
...
@@ -498,7 +498,7 @@ sal_uInt16 SwFEShell::MergeTab()
...
@@ -498,7 +498,7 @@ sal_uInt16 SwFEShell::MergeTab()
sal_Bool
SwFEShell
::
SplitTab
(
sal_Bool
bVert
,
sal_uInt16
nCnt
,
sal_Bool
bSameHeight
)
sal_Bool
SwFEShell
::
SplitTab
(
sal_Bool
bVert
,
sal_uInt16
nCnt
,
sal_Bool
bSameHeight
)
{
{
// check if
Sp
oint/Mark of current cursor are in a table
// check if
P
oint/Mark of current cursor are in a table
SwFrm
*
pFrm
=
GetCurrFrm
();
SwFrm
*
pFrm
=
GetCurrFrm
();
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
return
sal_False
;
return
sal_False
;
...
@@ -549,7 +549,6 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
...
@@ -549,7 +549,6 @@ void SwFEShell::_GetTabCols( SwTabCols &rToFill, const SwFrm *pBox ) const
const
SwTabFrm
*
pTab
=
pBox
->
FindTabFrm
();
const
SwTabFrm
*
pTab
=
pBox
->
FindTabFrm
();
if
(
pLastCols
)
if
(
pLastCols
)
{
{
// assure few small things
sal_Bool
bDel
=
sal_True
;
sal_Bool
bDel
=
sal_True
;
if
(
pColumnCacheLastTable
==
pTab
->
GetTable
()
)
if
(
pColumnCacheLastTable
==
pTab
->
GetTable
()
)
{
{
...
@@ -627,7 +626,6 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
...
@@ -627,7 +626,6 @@ void SwFEShell::_GetTabRows( SwTabCols &rToFill, const SwFrm *pBox ) const
const
SwTabFrm
*
pTab
=
pBox
->
FindTabFrm
();
const
SwTabFrm
*
pTab
=
pBox
->
FindTabFrm
();
if
(
pLastRows
)
if
(
pLastRows
)
{
{
// assure few things
sal_Bool
bDel
=
sal_True
;
sal_Bool
bDel
=
sal_True
;
if
(
pRowCacheLastTable
==
pTab
->
GetTable
()
)
if
(
pRowCacheLastTable
==
pTab
->
GetTable
()
)
{
{
...
@@ -1223,7 +1221,7 @@ void SwFEShell::AdjustCellWidth( sal_Bool bBalance )
...
@@ -1223,7 +1221,7 @@ void SwFEShell::AdjustCellWidth( sal_Bool bBalance )
sal_Bool
SwFEShell
::
IsAdjustCellWidthAllowed
(
sal_Bool
bBalance
)
const
sal_Bool
SwFEShell
::
IsAdjustCellWidthAllowed
(
sal_Bool
bBalance
)
const
{
{
// at least one
line
with content should be contained in the selection
// at least one
row
with content should be contained in the selection
SwFrm
*
pFrm
=
GetCurrFrm
();
SwFrm
*
pFrm
=
GetCurrFrm
();
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
if
(
!
pFrm
||
!
pFrm
->
IsInTab
()
)
...
@@ -1266,7 +1264,7 @@ sal_Bool SwFEShell::IsAdjustCellWidthAllowed( sal_Bool bBalance ) const
...
@@ -1266,7 +1264,7 @@ sal_Bool SwFEShell::IsAdjustCellWidthAllowed( sal_Bool bBalance ) const
return
sal_False
;
return
sal_False
;
}
}
// AutoFormat for the table/table
s selections
// AutoFormat for the table/table
selection
sal_Bool
SwFEShell
::
SetTableAutoFmt
(
const
SwTableAutoFmt
&
rNew
)
sal_Bool
SwFEShell
::
SetTableAutoFmt
(
const
SwTableAutoFmt
&
rNew
)
{
{
SwTableNode
*
pTblNd
=
(
SwTableNode
*
)
IsCrsrInTbl
();
SwTableNode
*
pTblNd
=
(
SwTableNode
*
)
IsCrsrInTbl
();
...
@@ -1352,7 +1350,7 @@ sal_Bool SwFEShell::DeleteTblSel()
...
@@ -1352,7 +1350,7 @@ sal_Bool SwFEShell::DeleteTblSel()
SET_CURR_SHELL
(
this
);
SET_CURR_SHELL
(
this
);
StartAllAction
();
StartAllAction
();
// search boxes via the layout
// search boxes via the layout
sal_Bool
bRet
;
sal_Bool
bRet
;
SwSelBoxes
aBoxes
;
SwSelBoxes
aBoxes
;
GetTblSelCrs
(
*
this
,
aBoxes
);
GetTblSelCrs
(
*
this
,
aBoxes
);
...
...
sw/source/core/frmedt/fews.cxx
Dosyayı görüntüle @
0231617f
...
@@ -457,8 +457,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
...
@@ -457,8 +457,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
const
String
&
rCharacterStyle
,
const
String
&
rCharacterStyle
,
const
sal_Bool
bCpyBrd
)
const
sal_Bool
bCpyBrd
)
{
{
// get CrsrPosition of NodeIndex, remaining stuff can
// get node index of cursor position, SwDoc can do everything else itself
// be done by the document self
SwCntntFrm
*
pCnt
=
LTYPE_DRAW
==
eType
?
0
:
GetCurrFrm
(
sal_False
);
SwCntntFrm
*
pCnt
=
LTYPE_DRAW
==
eType
?
0
:
GetCurrFrm
(
sal_False
);
if
(
LTYPE_DRAW
==
eType
||
pCnt
)
if
(
LTYPE_DRAW
==
eType
||
pCnt
)
{
{
...
@@ -524,7 +523,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
...
@@ -524,7 +523,7 @@ void SwFEShell::InsertLabel( const SwLabelType eType, const String &rTxt, const
}
}
break
;
break
;
default
:
default
:
OSL_ENSURE
(
!
this
,
"Crsr
both not
in table nor in fly."
);
OSL_ENSURE
(
!
this
,
"Crsr
neither
in table nor in fly."
);
}
}
if
(
nIdx
)
if
(
nIdx
)
...
@@ -557,7 +556,7 @@ sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt)
...
@@ -557,7 +556,7 @@ sal_Bool SwFEShell::Sort(const SwSortOptions& rOpt)
if
(
IsTableMode
())
if
(
IsTableMode
())
{
{
// Sort table
// Sort table
// check if
S
Point/Mark of current Crsr are in one table
// check if Point/Mark of current Crsr are in one table
SwFrm
*
pFrm
=
GetCurrFrm
(
sal_False
);
SwFrm
*
pFrm
=
GetCurrFrm
(
sal_False
);
OSL_ENSURE
(
pFrm
->
FindTabFrm
(),
"Crsr not in table."
);
OSL_ENSURE
(
pFrm
->
FindTabFrm
(),
"Crsr not in table."
);
...
...
sw/source/core/frmedt/tblsel.cxx
Dosyayı görüntüle @
0231617f
...
@@ -61,9 +61,9 @@
...
@@ -61,9 +61,9 @@
// see also swtable.cxx
// see also swtable.cxx
#define COLFUZZY 20L
#define COLFUZZY 20L
//
defines, determining how tabl
es are merged:
//
macros, determining how table box
es are merged:
// - 1. remove empty lines, all boxes separated with blanks,
// - 1. remove empty lines, all boxes separated with blanks,
// all
empty
lines separated with ParaBreak
// all lines separated with ParaBreak
// - 2. remove all empty lines and remove all empty boxes at beginning and end,
// - 2. remove all empty lines and remove all empty boxes at beginning and end,
// all boxes separated with Blank,
// all boxes separated with Blank,
// all lines separated with ParaBreak
// all lines separated with ParaBreak
...
@@ -132,7 +132,7 @@ const SwLayoutFrm *lcl_FindCellFrm( const SwLayoutFrm *pLay )
...
@@ -132,7 +132,7 @@ const SwLayoutFrm *lcl_FindCellFrm( const SwLayoutFrm *pLay )
const
SwLayoutFrm
*
lcl_FindNextCellFrm
(
const
SwLayoutFrm
*
pLay
)
const
SwLayoutFrm
*
lcl_FindNextCellFrm
(
const
SwLayoutFrm
*
pLay
)
{
{
//
assure cell is left (area
s)
//
ensure we leave the cell (section
s)
const
SwLayoutFrm
*
pTmp
=
pLay
;
const
SwLayoutFrm
*
pTmp
=
pLay
;
do
{
do
{
pTmp
=
pTmp
->
GetNextLayoutLeaf
();
pTmp
=
pTmp
->
GetNextLayoutLeaf
();
...
@@ -173,7 +173,7 @@ void GetTblSelCrs( const SwTableCursor& rTblCrsr, SwSelBoxes& rBoxes )
...
@@ -173,7 +173,7 @@ void GetTblSelCrs( const SwTableCursor& rTblCrsr, SwSelBoxes& rBoxes )
void
GetTblSel
(
const
SwCrsrShell
&
rShell
,
SwSelBoxes
&
rBoxes
,
void
GetTblSel
(
const
SwCrsrShell
&
rShell
,
SwSelBoxes
&
rBoxes
,
const
SwTblSearchType
eSearchType
)
const
SwTblSearchType
eSearchType
)
{
{
// get start
- and endcell and request next.
// get start
and end cell
if
(
!
rShell
.
IsTableMode
()
)
if
(
!
rShell
.
IsTableMode
()
)
rShell
.
GetCrsr
();
rShell
.
GetCrsr
();
...
@@ -183,7 +183,7 @@ void GetTblSel( const SwCrsrShell& rShell, SwSelBoxes& rBoxes,
...
@@ -183,7 +183,7 @@ void GetTblSel( const SwCrsrShell& rShell, SwSelBoxes& rBoxes,
void
GetTblSel
(
const
SwCursor
&
rCrsr
,
SwSelBoxes
&
rBoxes
,
void
GetTblSel
(
const
SwCursor
&
rCrsr
,
SwSelBoxes
&
rBoxes
,
const
SwTblSearchType
eSearchType
)
const
SwTblSearchType
eSearchType
)
{
{
// get start
- and endcell and request next.
// get start
and end cell
OSL_ENSURE
(
rCrsr
.
GetCntntNode
()
&&
rCrsr
.
GetCntntNode
(
sal_False
),
OSL_ENSURE
(
rCrsr
.
GetCntntNode
()
&&
rCrsr
.
GetCntntNode
(
sal_False
),
"Tabselection not on Cnt."
);
"Tabselection not on Cnt."
);
...
@@ -287,7 +287,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
...
@@ -287,7 +287,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
do
{
do
{
bTblIsValid
=
sal_True
;
bTblIsValid
=
sal_True
;
// First
we search for tables and squar
es
// First
, compute tables and rectangl
es
SwSelUnions
aUnions
;
SwSelUnions
aUnions
;
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
,
eSearchType
);
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
,
eSearchType
);
...
@@ -415,8 +415,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
...
@@ -415,8 +415,7 @@ void GetTblSel( const SwLayoutFrm* pStart, const SwLayoutFrm* pEnd,
SwDeletionChecker
aDelCheck
(
pStart
);
SwDeletionChecker
aDelCheck
(
pStart
);
// otherwise quickly "calculate" the table layout
// otherwise quickly "calculate" the table layout and start over
// and set it up again
SwTabFrm
*
pTable
=
aUnions
[
0
]
->
GetTable
();
SwTabFrm
*
pTable
=
aUnions
[
0
]
->
GetTable
();
while
(
pTable
)
while
(
pTable
)
{
{
...
@@ -497,7 +496,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
...
@@ -497,7 +496,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
sal_uInt16
nRowCells
=
USHRT_MAX
;
sal_uInt16
nRowCells
=
USHRT_MAX
;
// First
we search for tables and squar
es
// First
, compute tables and rectangl
es
SwSelUnions
aUnions
;
SwSelUnions
aUnions
;
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
,
nsSwTblSearchType
::
TBLSEARCH_NO_UNION_CORRECT
);
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
,
nsSwTblSearchType
::
TBLSEARCH_NO_UNION_CORRECT
);
...
@@ -566,8 +565,8 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
...
@@ -566,8 +565,8 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
{
{
// ok, rUnion is _not_ completely outside of rFrmRect
// ok, rUnion is _not_ completely outside of rFrmRect
// if not completely
outside the union, then for Chart
// if not completely
inside the union, then
// it is an invalid selection
//
for Chart
it is an invalid selection
if
(
rUnion
.
Left
()
<=
rFrmRect
.
Left
()
+
nXFuzzy
&&
if
(
rUnion
.
Left
()
<=
rFrmRect
.
Left
()
+
nXFuzzy
&&
rFrmRect
.
Left
()
<=
nUnionRight
&&
rFrmRect
.
Left
()
<=
nUnionRight
&&
rUnion
.
Left
()
<=
nFrmRight
&&
rUnion
.
Left
()
<=
nFrmRight
&&
...
@@ -601,7 +600,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
...
@@ -601,7 +600,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
if
(
!
bValidChartSel
)
if
(
!
bValidChartSel
)
break
;
break
;
// all cells of the (part) table together. Now check
o
f
// all cells of the (part) table together. Now check
i
f
// they're all adjacent
// they're all adjacent
size_t
n
,
nCellCnt
=
0
;
size_t
n
,
nCellCnt
=
0
;
long
nYPos
=
LONG_MAX
;
long
nYPos
=
LONG_MAX
;
...
@@ -616,7 +615,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
...
@@ -616,7 +615,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
// new row
// new row
if
(
n
)
if
(
n
)
{
{
if
(
USHRT_MAX
==
nRowCells
)
// 1. row
ex
change
if
(
USHRT_MAX
==
nRowCells
)
// 1. row change
nRowCells
=
nCellCnt
;
nRowCells
=
nCellCnt
;
else
if
(
nRowCells
!=
nCellCnt
)
else
if
(
nRowCells
!=
nCellCnt
)
{
{
...
@@ -678,7 +677,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
...
@@ -678,7 +677,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
if
(
bTblIsValid
)
if
(
bTblIsValid
)
break
;
break
;
// otherwise quickly "calculate" table layout and s
et it up again
// otherwise quickly "calculate" table layout and s
tart over
SwTabFrm
*
pTable
=
aUnions
[
0
]
->
GetTable
();
SwTabFrm
*
pTable
=
aUnions
[
0
]
->
GetTable
();
for
(
i
=
0
;
i
<
aUnions
.
Count
();
++
i
)
for
(
i
=
0
;
i
<
aUnions
.
Count
();
++
i
)
{
{
...
@@ -695,7 +694,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
...
@@ -695,7 +694,7 @@ sal_Bool ChkChartSel( const SwNode& rSttNd, const SwNode& rEndNd,
pGetCLines
->
DeleteAndDestroy
(
0
,
pGetCLines
->
Count
()
);
pGetCLines
->
DeleteAndDestroy
(
0
,
pGetCLines
->
Count
()
);
}
while
(
sal_True
);
}
while
(
sal_True
);
OSL_ENSURE
(
nLoopMax
,
"table layout is still invalid
e
!"
);
OSL_ENSURE
(
nLoopMax
,
"table layout is still invalid!"
);
if
(
!
bValidChartSel
&&
pGetCLines
)
if
(
!
bValidChartSel
&&
pGetCLines
)
pGetCLines
->
DeleteAndDestroy
(
0
,
pGetCLines
->
Count
()
);
pGetCLines
->
DeleteAndDestroy
(
0
,
pGetCLines
->
Count
()
);
...
@@ -742,16 +741,16 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
...
@@ -742,16 +741,16 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
while
(
pSttCell
&&
!
pSttCell
->
IsCellFrm
()
)
while
(
pSttCell
&&
!
pSttCell
->
IsCellFrm
()
)
pSttCell
=
pSttCell
->
GetUpper
();
pSttCell
=
pSttCell
->
GetUpper
();
//
first we search for tables and squar
es
//
First, compute tables and rectangl
es
SwSelUnions
aUnions
;
SwSelUnions
aUnions
;
//
then we test for above and
to the left
//
by default, first test above and then
to the left
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
,
nsSwTblSearchType
::
TBLSEARCH_COL
);
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
,
nsSwTblSearchType
::
TBLSEARCH_COL
);
sal_Bool
bTstRow
=
sal_True
,
bFound
=
sal_False
;
sal_Bool
bTstRow
=
sal_True
,
bFound
=
sal_False
;
sal_uInt16
i
;
sal_uInt16
i
;
// 1. check if box above contains value
s/formulas
// 1. check if box above contains value
/formula
for
(
i
=
0
;
i
<
aUnions
.
Count
();
++
i
)
for
(
i
=
0
;
i
<
aUnions
.
Count
();
++
i
)
{
{
SwSelUnion
*
pUnion
=
aUnions
[
i
];
SwSelUnion
*
pUnion
=
aUnions
[
i
];
...
@@ -780,7 +779,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
...
@@ -780,7 +779,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
break
;
break
;
// all boxes together, do not check the
// all boxes together, do not check the
// row, if a formula o
f values
was found
// row, if a formula o
r value
was found
bTstRow
=
0
==
nWhichId
||
USHRT_MAX
==
nWhichId
;
bTstRow
=
0
==
nWhichId
||
USHRT_MAX
==
nWhichId
;
bFound
=
sal_True
;
bFound
=
sal_True
;
break
;
break
;
...
@@ -849,7 +848,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
...
@@ -849,7 +848,7 @@ sal_Bool GetAutoSumSel( const SwCrsrShell& rShell, SwCellFrms& rBoxes )
break
;
break
;
// all boxes together, do not check the
// all boxes together, do not check the
// row
, if a formula of values
was found
// row
if a formula or value
was found
bFound
=
0
!=
nWhichId
&&
USHRT_MAX
!=
nWhichId
;
bFound
=
0
!=
nWhichId
&&
USHRT_MAX
!=
nWhichId
;
bTstRow
=
sal_False
;
bTstRow
=
sal_False
;
break
;
break
;
...
@@ -963,7 +962,6 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
...
@@ -963,7 +962,6 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
{
{
rBoxes
.
clear
();
rBoxes
.
clear
();
// first we check for tables and squares
OSL_ENSURE
(
rPam
.
GetCntntNode
()
&&
rPam
.
GetCntntNode
(
sal_False
),
OSL_ENSURE
(
rPam
.
GetCntntNode
()
&&
rPam
.
GetCntntNode
(
sal_False
),
"Tabselection not on Cnt."
);
"Tabselection not on Cnt."
);
...
@@ -979,6 +977,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
...
@@ -979,6 +977,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
const
SwLayoutFrm
*
pEnd
=
pCntNd
->
getLayoutFrm
(
pCntNd
->
GetDoc
()
->
GetCurrentLayout
(),
const
SwLayoutFrm
*
pEnd
=
pCntNd
->
getLayoutFrm
(
pCntNd
->
GetDoc
()
->
GetCurrentLayout
(),
&
aPt
)
->
GetUpper
();
&
aPt
)
->
GetUpper
();
// First, compute tables and rectangles
SwSelUnions
aUnions
;
SwSelUnions
aUnions
;
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
);
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
);
if
(
!
aUnions
.
Count
()
)
if
(
!
aUnions
.
Count
()
)
...
@@ -1178,11 +1177,11 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
...
@@ -1178,11 +1177,11 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
if
(
1
>=
rBoxes
.
size
()
)
if
(
1
>=
rBoxes
.
size
()
)
return
;
return
;
// now search all adjacent boxes and connect
// now search all
horizontally
adjacent boxes and connect
// their contents with blanks. All
underneath
will be tied
// their contents with blanks. All
vertically adjacent
will be tied
// together as paragraphs
// together as paragraphs
// 1. Solution: map array and all on same Y-
plane
// 1. Solution: map array and all on same Y-
level
// are separated with blanks
// are separated with blanks
// all others are separated with paragraphs
// all others are separated with paragraphs
sal_Bool
bCalcWidth
=
sal_True
;
sal_Bool
bCalcWidth
=
sal_True
;
...
@@ -1202,7 +1201,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
...
@@ -1202,7 +1201,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
for
(
n
=
0
;
n
<
aPosArr
.
Count
();
++
n
)
for
(
n
=
0
;
n
<
aPosArr
.
Count
();
++
n
)
{
{
const
_CmpLPt
&
rPt
=
aPosArr
[
n
];
const
_CmpLPt
&
rPt
=
aPosArr
[
n
];
if
(
n
&&
aPosArr
[
n
-
1
].
Y
()
==
rPt
.
Y
()
)
// same
plane
?
if
(
n
&&
aPosArr
[
n
-
1
].
Y
()
==
rPt
.
Y
()
)
// same
Y level
?
{
{
if
(
bEmptyLine
&&
!
IsEmptyBox
(
*
rPt
.
pSelBox
,
aPam
))
if
(
bEmptyLine
&&
!
IsEmptyBox
(
*
rPt
.
pSelBox
,
aPam
))
bEmptyLine
=
sal_False
;
bEmptyLine
=
sal_False
;
...
@@ -1246,7 +1245,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
...
@@ -1246,7 +1245,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
for
(
n
=
0
;
n
<
aPosArr
.
Count
();
++
n
)
for
(
n
=
0
;
n
<
aPosArr
.
Count
();
++
n
)
{
{
const
_CmpLPt
&
rPt
=
aPosArr
[
n
];
const
_CmpLPt
&
rPt
=
aPosArr
[
n
];
if
(
n
&&
aPosArr
[
n
-
1
].
Y
()
==
rPt
.
Y
()
)
// same
plane
?
if
(
n
&&
aPosArr
[
n
-
1
].
Y
()
==
rPt
.
Y
()
)
// same
Y level
?
{
{
sal_Bool
bEmptyBox
=
IsEmptyBox
(
*
rPt
.
pSelBox
,
aPam
);
sal_Bool
bEmptyBox
=
IsEmptyBox
(
*
rPt
.
pSelBox
,
aPam
);
if
(
bEmptyBox
)
if
(
bEmptyBox
)
...
@@ -1341,7 +1340,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
...
@@ -1341,7 +1340,7 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
const
_CmpLPt
&
rPt
=
aPosArr
[
n
];
const
_CmpLPt
&
rPt
=
aPosArr
[
n
];
if
(
bCalcWidth
)
if
(
bCalcWidth
)
{
{
if
(
nY
==
(
bVert
?
rPt
.
X
()
:
rPt
.
Y
()
)
)
// same plane
?
if
(
nY
==
(
bVert
?
rPt
.
X
()
:
rPt
.
Y
()
)
)
// same Y level
?
nWidth
+=
rPt
.
pSelBox
->
GetFrmFmt
()
->
GetFrmSize
().
GetWidth
();
nWidth
+=
rPt
.
pSelBox
->
GetFrmFmt
()
->
GetFrmSize
().
GetWidth
();
else
else
bCalcWidth
=
sal_False
;
// one line ready
bCalcWidth
=
sal_False
;
// one line ready
...
@@ -1367,12 +1366,12 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
...
@@ -1367,12 +1366,12 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
lcl_InsTblBox
(
pTblNd
,
pDoc
,
pTmpBox
,
nInsPos
);
lcl_InsTblBox
(
pTblNd
,
pDoc
,
pTmpBox
,
nInsPos
);
(
*
ppMergeBox
)
=
pInsLine
->
GetTabBoxes
()[
nInsPos
];
(
*
ppMergeBox
)
=
pInsLine
->
GetTabBoxes
()[
nInsPos
];
pInsLine
->
GetTabBoxes
().
Remove
(
nInsPos
);
// deliver
again
pInsLine
->
GetTabBoxes
().
Remove
(
nInsPos
);
// remove
again
(
*
ppMergeBox
)
->
SetUpper
(
0
);
(
*
ppMergeBox
)
->
SetUpper
(
0
);
(
*
ppMergeBox
)
->
ClaimFrmFmt
();
(
*
ppMergeBox
)
->
ClaimFrmFmt
();
// define the border:
of the first box the upper-left of the
// define the border:
the upper/left side of the first box,
//
last box the lower-right corner
:
//
the lower/right side of the last box
:
if
(
pLastBox
&&
pFirstBox
)
if
(
pLastBox
&&
pFirstBox
)
{
{
SvxBoxItem
aBox
(
pFirstBox
->
GetFrmFmt
()
->
GetBox
()
);
SvxBoxItem
aBox
(
pFirstBox
->
GetFrmFmt
()
->
GetBox
()
);
...
@@ -1404,8 +1403,8 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
...
@@ -1404,8 +1403,8 @@ void GetMergeSel( const SwPaM& rPam, SwSelBoxes& rBoxes,
aPam
.
GetPoint
()
->
nContent
.
Assign
(
pCNd
,
nL
);
aPam
.
GetPoint
()
->
nContent
.
Assign
(
pCNd
,
nL
);
SwNodeIndex
aSttNdIdx
(
*
rPt
.
pSelBox
->
GetSttNd
(),
1
);
SwNodeIndex
aSttNdIdx
(
*
rPt
.
pSelBox
->
GetSttNd
(),
1
);
// one node should be kept in the box (
otherwise the
// one node should be kept in the box (otherwise the
// se
lection would be deleted during a move
// se
ction would be deleted during a move)
bool
const
bUndo
(
pDoc
->
GetIDocumentUndoRedo
().
DoesUndo
());
bool
const
bUndo
(
pDoc
->
GetIDocumentUndoRedo
().
DoesUndo
());
if
(
pUndo
)
if
(
pUndo
)
{
{
...
@@ -1535,8 +1534,8 @@ sal_uInt16 CheckMergeSel( const SwSelBoxes& rBoxes )
...
@@ -1535,8 +1534,8 @@ sal_uInt16 CheckMergeSel( const SwSelBoxes& rBoxes )
return
eRet
;
return
eRet
;
}
}
// Determines tables a
nd union-squares affected by a table selection
// Determines tables a
ffected by a table selection and union rectangles
//
also for splitt tables
//
of the selection (also for split tables)
SV_IMPL_PTRARR
(
SwSelUnions
,
SwSelUnion
*
);
SV_IMPL_PTRARR
(
SwSelUnions
,
SwSelUnion
*
);
SwTwips
lcl_CalcWish
(
const
SwLayoutFrm
*
pCell
,
long
nWish
,
SwTwips
lcl_CalcWish
(
const
SwLayoutFrm
*
pCell
,
long
nWish
,
...
@@ -1782,7 +1781,7 @@ void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
...
@@ -1782,7 +1781,7 @@ void lcl_FindStartEndCol( const SwLayoutFrm *&rpStart,
if
(
!
pTmpLeaf
||
!
pTmpTab
->
IsAnLower
(
pTmpLeaf
)
)
if
(
!
pTmpLeaf
||
!
pTmpTab
->
IsAnLower
(
pTmpLeaf
)
)
{
{
pTmpTab
=
(
const
SwTabFrm
*
)
pTmpTab
->
FindPrev
();
pTmpTab
=
(
const
SwTabFrm
*
)
pTmpTab
->
FindPrev
();
OSL_ENSURE
(
pTmpTab
->
IsTabFrm
(),
"Predecessor of Follow not
in
Master."
);
OSL_ENSURE
(
pTmpTab
->
IsTabFrm
(),
"Predecessor of Follow not Master."
);
rpEnd
=
pTmpTab
->
FindLastCntnt
()
->
GetUpper
();
rpEnd
=
pTmpTab
->
FindLastCntnt
()
->
GetUpper
();
while
(
!
rpEnd
->
IsCellFrm
()
)
while
(
!
rpEnd
->
IsCellFrm
()
)
rpEnd
=
rpEnd
->
GetUpper
();
rpEnd
=
rpEnd
->
GetUpper
();
...
@@ -1819,7 +1818,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
...
@@ -1819,7 +1818,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
{
{
if
(
!
pTable
->
IsAnFollow
(
pEndTable
)
)
if
(
!
pTable
->
IsAnFollow
(
pEndTable
)
)
{
{
OSL_ENSURE
(
pEndTable
->
IsAnFollow
(
pTable
),
"Tabchain
linked
."
);
OSL_ENSURE
(
pEndTable
->
IsAnFollow
(
pTable
),
"Tabchain
in knots
."
);
bExchange
=
sal_True
;
bExchange
=
sal_True
;
}
}
}
}
...
@@ -1847,7 +1846,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
...
@@ -1847,7 +1846,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
}
}
// Beginning and end now nicely sorted, if required we
// Beginning and end now nicely sorted, if required we
// should
transfer
them
// should
move
them
if
(
nsSwTblSearchType
::
TBLSEARCH_ROW
==
((
~
nsSwTblSearchType
::
TBLSEARCH_PROTECT
)
&
eSearchType
)
)
if
(
nsSwTblSearchType
::
TBLSEARCH_ROW
==
((
~
nsSwTblSearchType
::
TBLSEARCH_PROTECT
)
&
eSearchType
)
)
::
lcl_FindStartEndRow
(
pStart
,
pEnd
,
nsSwTblSearchType
::
TBLSEARCH_PROTECT
&
eSearchType
);
::
lcl_FindStartEndRow
(
pStart
,
pEnd
,
nsSwTblSearchType
::
TBLSEARCH_PROTECT
&
eSearchType
);
else
if
(
nsSwTblSearchType
::
TBLSEARCH_COL
==
((
~
nsSwTblSearchType
::
TBLSEARCH_PROTECT
)
&
eSearchType
)
)
else
if
(
nsSwTblSearchType
::
TBLSEARCH_COL
==
((
~
nsSwTblSearchType
::
TBLSEARCH_PROTECT
)
&
eSearchType
)
)
...
@@ -1855,7 +1854,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
...
@@ -1855,7 +1854,7 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
if
(
!
pEnd
)
return
;
// Made code robust.
if
(
!
pEnd
)
return
;
// Made code robust.
// retrieve again, as they have been
transferr
ed
// retrieve again, as they have been
mov
ed
pTable
=
pStart
->
FindTabFrm
();
pTable
=
pStart
->
FindTabFrm
();
pEndTable
=
pEnd
->
FindTabFrm
();
pEndTable
=
pEnd
->
FindTabFrm
();
...
@@ -1913,13 +1912,12 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
...
@@ -1913,13 +1912,12 @@ void MakeSelUnions( SwSelUnions& rUnions, const SwLayoutFrm *pStart,
SwRect
aUnion
(
aSt
,
Size
(
aDiff
.
X
(),
aDiff
.
Y
()
)
);
SwRect
aUnion
(
aSt
,
Size
(
aDiff
.
X
(),
aDiff
.
Y
()
)
);
aUnion
.
Justify
();
aUnion
.
Justify
();
// for
if
(
!
(
nsSwTblSearchType
::
TBLSEARCH_NO_UNION_CORRECT
&
eSearchType
))
if
(
!
(
nsSwTblSearchType
::
TBLSEARCH_NO_UNION_CORRECT
&
eSearchType
))
{
{
//
Pity the union contains rounding errors
, therefore
//
Unfortunately the union contains rounding errors now
, therefore
// erroneous results could occur during split/merge.
// erroneous results could occur during split/merge.
// To prevent these we will determine the first and last row
// To prevent these we will determine the first and last row
// within the union and use their values for
the
new union
// within the union and use their values for
a
new union
const
SwLayoutFrm
*
pRow
=
pTable
->
IsFollow
()
?
const
SwLayoutFrm
*
pRow
=
pTable
->
IsFollow
()
?
pTable
->
GetFirstNonHeadlineRow
()
:
pTable
->
GetFirstNonHeadlineRow
()
:
(
const
SwLayoutFrm
*
)
pTable
->
Lower
();
(
const
SwLayoutFrm
*
)
pTable
->
Lower
();
...
@@ -2006,7 +2004,7 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
...
@@ -2006,7 +2004,7 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
sal_uInt16
nMinValue
=
nDiv
*
MINLAY
;
sal_uInt16
nMinValue
=
nDiv
*
MINLAY
;
// Get start
- and end cell and request next
// Get start
and end cell
Point
aPtPos
,
aMkPos
;
Point
aPtPos
,
aMkPos
;
const
SwShellCrsr
*
pShCrsr
=
dynamic_cast
<
const
SwShellCrsr
*>
(
&
rCrsr
);
const
SwShellCrsr
*
pShCrsr
=
dynamic_cast
<
const
SwShellCrsr
*>
(
&
rCrsr
);
if
(
pShCrsr
)
if
(
pShCrsr
)
...
@@ -2024,7 +2022,7 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
...
@@ -2024,7 +2022,7 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
SWRECTFN
(
pStart
->
GetUpper
()
)
SWRECTFN
(
pStart
->
GetUpper
()
)
//
first we search for tables and squar
es
//
First, compute tables and rectangl
es
SwSelUnions
aUnions
;
SwSelUnions
aUnions
;
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
,
eSearchType
);
::
MakeSelUnions
(
aUnions
,
pStart
,
pEnd
,
eSearchType
);
...
@@ -2072,11 +2070,8 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
...
@@ -2072,11 +2070,8 @@ sal_Bool CheckSplitCells( const SwCursor& rCrsr, sal_uInt16 nDiv,
}
}
// -------------------------------------------------------------------
// -------------------------------------------------------------------
// Diese Klassen kopieren die aktuelle Tabellen-Selektion (rBoxes)
// unter Beibehaltung der Tabellen-Struktur in eine eigene Struktur
// neu: SS zum gezielten Loeschen/Retaurieren des Layouts.
// These Classes copy the current table selections (rBoxes),
// These Classes copy the current table selections (rBoxes),
//
retaining the table structure in a own
structure
//
into a new structure, retaining the table
structure
// new: SS for targeted erasing/restoring of the layout
// new: SS for targeted erasing/restoring of the layout
void
lcl_InsertRow
(
SwTableLine
&
rLine
,
SwLayoutFrm
*
pUpper
,
SwFrm
*
pSibling
)
void
lcl_InsertRow
(
SwTableLine
&
rLine
,
SwLayoutFrm
*
pUpper
,
SwFrm
*
pSibling
)
...
@@ -2284,7 +2279,7 @@ void _FndBox::DelFrms( SwTable &rTable )
...
@@ -2284,7 +2279,7 @@ void _FndBox::DelFrms( SwTable &rTable )
else
if
(
pFollow
)
else
if
(
pFollow
)
::
UnsetFollow
(
pFollow
);
::
UnsetFollow
(
pFollow
);
// A Tab
ellen
Frm should always remain!
// A Tab
le
Frm should always remain!
if
(
pPrev
||
pFollow
)
if
(
pPrev
||
pFollow
)
{
{
// OD 26.08.2003 #i18103# - if table is in a section,
// OD 26.08.2003 #i18103# - if table is in a section,
...
@@ -2443,9 +2438,9 @@ void _FndBox::MakeFrms( SwTable &rTable )
...
@@ -2443,9 +2438,9 @@ void _FndBox::MakeFrms( SwTable &rTable )
void
_FndBox
::
MakeNewFrms
(
SwTable
&
rTable
,
const
sal_uInt16
nNumber
,
void
_FndBox
::
MakeNewFrms
(
SwTable
&
rTable
,
const
sal_uInt16
nNumber
,
const
sal_Bool
bBehind
)
const
sal_Bool
bBehind
)
{
{
// Create Frms for new inserted lines
// Create Frms for new
ly
inserted lines
// bBehind == sal_True: before pLineBehind
// bBehind == sal_True: before pLineBehind
// == sal_False: af
er
pLineBefore
// == sal_False: af
ter
pLineBefore
const
sal_uInt16
nBfPos
=
pLineBefore
?
const
sal_uInt16
nBfPos
=
pLineBefore
?
rTable
.
GetTabLines
().
GetPos
(
(
const
SwTableLine
*&
)
pLineBefore
)
:
rTable
.
GetTabLines
().
GetPos
(
(
const
SwTableLine
*&
)
pLineBefore
)
:
USHRT_MAX
;
USHRT_MAX
;
...
@@ -2454,7 +2449,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
...
@@ -2454,7 +2449,7 @@ void _FndBox::MakeNewFrms( SwTable &rTable, const sal_uInt16 nNumber,
USHRT_MAX
;
USHRT_MAX
;
//nNumber: how often did we insert
//nNumber: how often did we insert
//nCnt: how many
nNumber were inserted
//nCnt: how many
were inserted nNumber times
const
sal_uInt16
nCnt
=
const
sal_uInt16
nCnt
=
((
nBhPos
!=
USHRT_MAX
?
nBhPos
:
rTable
.
GetTabLines
().
Count
())
-
((
nBhPos
!=
USHRT_MAX
?
nBhPos
:
rTable
.
GetTabLines
().
Count
())
-
...
...
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