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
3f4553a6
Kaydet (Commit)
3f4553a6
authored
Ock 22, 2015
tarafından
Caolán McNamara
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
fix mangled indent
Change-Id: Ie7ff70660a95711bcedc96da72694e5c46717274
üst
cac3f3e4
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
130 additions
and
127 deletions
+130
-127
fltini.cxx
sw/source/filter/basflt/fltini.cxx
+130
-127
No files found.
sw/source/filter/basflt/fltini.cxx
Dosyayı görüntüle @
3f4553a6
...
@@ -176,14 +176,16 @@ SwRead GetReader( const OUString& rFltName )
...
@@ -176,14 +176,16 @@ SwRead GetReader( const OUString& rFltName )
{
{
SwRead
pRead
=
0
;
SwRead
pRead
=
0
;
for
(
sal_uInt16
n
=
0
;
n
<
MAXFILTER
;
++
n
)
for
(
sal_uInt16
n
=
0
;
n
<
MAXFILTER
;
++
n
)
{
if
(
aFilterDetect
[
n
].
IsFilter
(
rFltName
)
)
if
(
aFilterDetect
[
n
].
IsFilter
(
rFltName
)
)
{
{
pRead
=
aReaderWriter
[
n
].
GetReader
();
pRead
=
aReaderWriter
[
n
].
GetReader
();
// add special treatment for some readers
// add special treatment for some readers
if
(
pRead
)
if
(
pRead
)
pRead
->
SetFltName
(
rFltName
);
pRead
->
SetFltName
(
rFltName
);
break
;
break
;
}
}
}
return
pRead
;
return
pRead
;
}
}
...
@@ -246,33 +248,35 @@ bool SwReader::CheckPasswd( const OUString& /*rPasswd*/, const Reader& /*rOption
...
@@ -246,33 +248,35 @@ bool SwReader::CheckPasswd( const OUString& /*rPasswd*/, const Reader& /*rOption
SwFilterOptions
::
SwFilterOptions
(
sal_uInt16
nCnt
,
const
sal_Char
**
ppNames
,
SwFilterOptions
::
SwFilterOptions
(
sal_uInt16
nCnt
,
const
sal_Char
**
ppNames
,
sal_uInt32
*
pValues
)
sal_uInt32
*
pValues
)
:
ConfigItem
(
FILTER_OPTION_ROOT
)
:
ConfigItem
(
FILTER_OPTION_ROOT
)
{
{
GetValues
(
nCnt
,
ppNames
,
pValues
);
GetValues
(
nCnt
,
ppNames
,
pValues
);
}
}
void
SwFilterOptions
::
GetValues
(
sal_uInt16
nCnt
,
const
sal_Char
**
ppNames
,
void
SwFilterOptions
::
GetValues
(
sal_uInt16
nCnt
,
const
sal_Char
**
ppNames
,
sal_uInt32
*
pValues
)
sal_uInt32
*
pValues
)
{
{
Sequence
<
OUString
>
aNames
(
nCnt
);
Sequence
<
OUString
>
aNames
(
nCnt
);
OUString
*
pNames
=
aNames
.
getArray
();
OUString
*
pNames
=
aNames
.
getArray
();
sal_uInt16
n
;
sal_uInt16
n
;
for
(
n
=
0
;
n
<
nCnt
;
++
n
)
for
(
n
=
0
;
n
<
nCnt
;
++
n
)
pNames
[
n
]
=
OUString
::
createFromAscii
(
ppNames
[
n
]
);
pNames
[
n
]
=
OUString
::
createFromAscii
(
ppNames
[
n
]
);
Sequence
<
Any
>
aValues
=
GetProperties
(
aNames
);
Sequence
<
Any
>
aValues
=
GetProperties
(
aNames
);
if
(
nCnt
==
aValues
.
getLength
()
)
if
(
nCnt
==
aValues
.
getLength
()
)
{
{
const
Any
*
pAnyValues
=
aValues
.
getConstArray
();
const
Any
*
pAnyValues
=
aValues
.
getConstArray
();
for
(
n
=
0
;
n
<
nCnt
;
++
n
)
for
(
n
=
0
;
n
<
nCnt
;
++
n
)
pValues
[
n
]
=
pAnyValues
[
n
].
hasValue
()
pValues
[
n
]
=
pAnyValues
[
n
].
hasValue
()
?
*
(
sal_uInt32
*
)
pAnyValues
[
n
].
getValue
()
?
*
(
sal_uInt32
*
)
pAnyValues
[
n
].
getValue
()
:
0
;
:
0
;
}
}
else
else
for
(
n
=
0
;
n
<
nCnt
;
++
n
)
{
pValues
[
n
]
=
0
;
for
(
n
=
0
;
n
<
nCnt
;
++
n
)
pValues
[
n
]
=
0
;
}
}
}
void
SwFilterOptions
::
Commit
()
{}
void
SwFilterOptions
::
Commit
()
{}
...
@@ -280,137 +284,136 @@ void SwFilterOptions::Notify( const ::com::sun::star::uno::Sequence< OUString >&
...
@@ -280,137 +284,136 @@ void SwFilterOptions::Notify( const ::com::sun::star::uno::Sequence< OUString >&
void
StgReader
::
SetFltName
(
const
OUString
&
rFltNm
)
void
StgReader
::
SetFltName
(
const
OUString
&
rFltNm
)
{
{
if
(
SW_STORAGE_READER
&
GetReaderType
()
)
if
(
SW_STORAGE_READER
&
GetReaderType
()
)
aFltName
=
rFltNm
;
aFltName
=
rFltNm
;
}
}
SwRelNumRuleSpaces
::
SwRelNumRuleSpaces
(
SwDoc
&
rDoc
,
bool
bNDoc
)
SwRelNumRuleSpaces
::
SwRelNumRuleSpaces
(
SwDoc
&
rDoc
,
bool
bNDoc
)
{
{
pNumRuleTbl
=
new
SwNumRuleTbl
();
pNumRuleTbl
=
new
SwNumRuleTbl
();
pNumRuleTbl
->
reserve
(
8
);
pNumRuleTbl
->
reserve
(
8
);
if
(
!
bNDoc
)
if
(
!
bNDoc
)
pNumRuleTbl
->
insert
(
pNumRuleTbl
->
begin
(),
pNumRuleTbl
->
insert
(
pNumRuleTbl
->
begin
(),
rDoc
.
GetNumRuleTbl
().
begin
(),
rDoc
.
GetNumRuleTbl
().
end
()
);
rDoc
.
GetNumRuleTbl
().
begin
(),
rDoc
.
GetNumRuleTbl
().
end
()
);
}
}
SwRelNumRuleSpaces
::~
SwRelNumRuleSpaces
()
SwRelNumRuleSpaces
::~
SwRelNumRuleSpaces
()
{
{
if
(
pNumRuleTbl
)
if
(
pNumRuleTbl
)
{
{
pNumRuleTbl
->
clear
();
pNumRuleTbl
->
clear
();
delete
pNumRuleTbl
;
delete
pNumRuleTbl
;
}
}
}
}
void
CalculateFlySize
(
SfxItemSet
&
rFlySet
,
const
SwNodeIndex
&
rAnchor
,
void
CalculateFlySize
(
SfxItemSet
&
rFlySet
,
const
SwNodeIndex
&
rAnchor
,
SwTwips
nPageWidth
)
SwTwips
nPageWidth
)
{
{
const
SfxPoolItem
*
pItem
=
0
;
const
SfxPoolItem
*
pItem
=
0
;
if
(
SfxItemState
::
SET
!=
rFlySet
.
GetItemState
(
RES_FRM_SIZE
,
true
,
&
pItem
)
||
if
(
SfxItemState
::
SET
!=
rFlySet
.
GetItemState
(
RES_FRM_SIZE
,
true
,
&
pItem
)
||
MINFLY
>
static_cast
<
const
SwFmtFrmSize
*>
(
pItem
)
->
GetWidth
()
)
MINFLY
>
static_cast
<
const
SwFmtFrmSize
*>
(
pItem
)
->
GetWidth
()
)
{
SwFmtFrmSize
aSz
(
static_cast
<
const
SwFmtFrmSize
&>
(
rFlySet
.
Get
(
RES_FRM_SIZE
,
true
)));
if
(
pItem
)
aSz
=
static_cast
<
const
SwFmtFrmSize
&>
(
*
pItem
);
SwTwips
nWidth
;
// determine the width; if there is a table use the width of the table;
// otherwise use the width of the page
const
SwTableNode
*
pTblNd
=
rAnchor
.
GetNode
().
FindTableNode
();
if
(
pTblNd
)
nWidth
=
pTblNd
->
GetTable
().
GetFrmFmt
()
->
GetFrmSize
().
GetWidth
();
else
nWidth
=
nPageWidth
;
const
SwNodeIndex
*
pSttNd
=
static_cast
<
const
SwFmtCntnt
&>
(
rFlySet
.
Get
(
RES_CNTNT
)).
GetCntntIdx
();
if
(
pSttNd
)
{
{
SwFmtFrmSize
aSz
(
static_cast
<
const
SwFmtFrmSize
&>
(
rFlySet
.
Get
(
RES_FRM_SIZE
,
true
)));
bool
bOnlyOneNode
=
true
;
if
(
pItem
)
sal_uLong
nMinFrm
=
0
;
aSz
=
static_cast
<
const
SwFmtFrmSize
&>
(
*
pItem
);
sal_uLong
nMaxFrm
=
0
;
SwTxtNode
*
pFirstTxtNd
=
0
;
SwTwips
nWidth
;
SwNodeIndex
aIdx
(
*
pSttNd
,
1
);
// determine the width; if there is a table use the width of the table;
SwNodeIndex
aEnd
(
*
pSttNd
->
GetNode
().
EndOfSectionNode
()
);
// otherwise use the width of the page
while
(
aIdx
<
aEnd
)
const
SwTableNode
*
pTblNd
=
rAnchor
.
GetNode
().
FindTableNode
();
{
if
(
pTblNd
)
SwTxtNode
*
pTxtNd
=
aIdx
.
GetNode
().
GetTxtNode
();
nWidth
=
pTblNd
->
GetTable
().
GetFrmFmt
()
->
GetFrmSize
().
GetWidth
();
if
(
pTxtNd
)
else
{
nWidth
=
nPageWidth
;
if
(
!
pFirstTxtNd
)
pFirstTxtNd
=
pTxtNd
;
else
if
(
pFirstTxtNd
!=
pTxtNd
)
{
// forget it
bOnlyOneNode
=
false
;
break
;
}
sal_uLong
nAbsMinCnts
;
pTxtNd
->
GetMinMaxSize
(
aIdx
.
GetIndex
(),
nMinFrm
,
nMaxFrm
,
nAbsMinCnts
);
}
++
aIdx
;
}
const
SwNodeIndex
*
pSttNd
=
static_cast
<
const
SwFmtCntnt
&>
(
rFlySet
.
Get
(
RES_CNTNT
)).
if
(
bOnlyOneNode
)
GetCntntIdx
();
{
if
(
pSt
tNd
)
if
(
nMinFrm
<
MINLAY
&&
pFirstTx
tNd
)
{
{
bool
bOnlyOneNode
=
true
;
// if the first node dont contained any content, then
sal_uLong
nMinFrm
=
0
;
// insert one char in it calc again and delete once again
sal_uLong
nMaxFrm
=
0
;
SwIndex
aNdIdx
(
pFirstTxtNd
);
SwTxtNode
*
pFirstTxtNd
=
0
;
pFirstTxtNd
->
InsertText
(
OUString
(
"MM"
),
aNdIdx
);
SwNodeIndex
aIdx
(
*
pSttNd
,
1
);
sal_uLong
nAbsMinCnts
;
SwNodeIndex
aEnd
(
*
pSttNd
->
GetNode
().
EndOfSectionNode
()
);
pFirstTxtNd
->
GetMinMaxSize
(
pFirstTxtNd
->
GetIndex
(),
while
(
aIdx
<
aEnd
)
nMinFrm
,
nMaxFrm
,
nAbsMinCnts
);
{
aNdIdx
-=
2
;
SwTxtNode
*
pTxtNd
=
aIdx
.
GetNode
().
GetTxtNode
();
if
(
pTxtNd
)
{
if
(
!
pFirstTxtNd
)
pFirstTxtNd
=
pTxtNd
;
else
if
(
pFirstTxtNd
!=
pTxtNd
)
{
// forget it
bOnlyOneNode
=
false
;
break
;
}
sal_uLong
nAbsMinCnts
;
pTxtNd
->
GetMinMaxSize
(
aIdx
.
GetIndex
(),
nMinFrm
,
nMaxFrm
,
nAbsMinCnts
);
}
++
aIdx
;
}
if
(
bOnlyOneNode
)
{
if
(
nMinFrm
<
MINLAY
&&
pFirstTxtNd
)
{
// if the first node dont contained any content, then
// insert one char in it calc again and delete once again
SwIndex
aNdIdx
(
pFirstTxtNd
);
pFirstTxtNd
->
InsertText
(
OUString
(
"MM"
),
aNdIdx
);
sal_uLong
nAbsMinCnts
;
pFirstTxtNd
->
GetMinMaxSize
(
pFirstTxtNd
->
GetIndex
(),
nMinFrm
,
nMaxFrm
,
nAbsMinCnts
);
aNdIdx
-=
2
;
pFirstTxtNd
->
EraseText
(
aNdIdx
,
2
);
pFirstTxtNd
->
EraseText
(
aNdIdx
,
2
);
}
}
// consider border and distance to content
// consider border and distance to content
const
SvxBoxItem
&
rBoxItem
=
static_cast
<
const
SvxBoxItem
&>
(
rFlySet
.
Get
(
RES_BOX
));
const
SvxBoxItem
&
rBoxItem
=
static_cast
<
const
SvxBoxItem
&>
(
rFlySet
.
Get
(
RES_BOX
));
sal_uInt16
nLine
=
BOX_LINE_LEFT
;
sal_uInt16
nLine
=
BOX_LINE_LEFT
;
for
(
int
i
=
0
;
i
<
2
;
++
i
)
for
(
int
i
=
0
;
i
<
2
;
++
i
)
{
{
const
editeng
::
SvxBorderLine
*
pLn
=
rBoxItem
.
GetLine
(
nLine
);
const
editeng
::
SvxBorderLine
*
pLn
=
rBoxItem
.
GetLine
(
nLine
);
if
(
pLn
)
if
(
pLn
)
{
{
sal_uInt16
nWidthTmp
=
pLn
->
GetOutWidth
()
+
pLn
->
GetInWidth
();
sal_uInt16
nWidthTmp
=
pLn
->
GetOutWidth
()
+
pLn
->
GetInWidth
();
nWidthTmp
=
nWidthTmp
+
rBoxItem
.
GetDistance
(
nLine
);
nWidthTmp
=
nWidthTmp
+
rBoxItem
.
GetDistance
(
nLine
);
nMinFrm
+=
nWidthTmp
;
nMinFrm
+=
nWidthTmp
;
nMaxFrm
+=
nWidthTmp
;
nMaxFrm
+=
nWidthTmp
;
}
}
nLine
=
BOX_LINE_RIGHT
;
nLine
=
BOX_LINE_RIGHT
;
}
// enforce minimum width for contents
if
(
nMinFrm
<
MINLAY
)
nMinFrm
=
MINLAY
;
if
(
nMaxFrm
<
MINLAY
)
nMaxFrm
=
MINLAY
;
if
(
nWidth
>
(
sal_uInt16
)
nMaxFrm
)
nWidth
=
nMaxFrm
;
else
if
(
nWidth
>
(
sal_uInt16
)
nMinFrm
)
nWidth
=
nMinFrm
;
}
}
}
if
(
MINFLY
>
nWidth
)
// enforce minimum width for contents
nWidth
=
MINFLY
;
if
(
nMinFrm
<
MINLAY
)
nMinFrm
=
MINLAY
;
if
(
nMaxFrm
<
MINLAY
)
nMaxFrm
=
MINLAY
;
aSz
.
SetWidth
(
nWidth
);
if
(
nWidth
>
(
sal_uInt16
)
nMaxFrm
)
if
(
MINFLY
>
aSz
.
GetHeight
()
)
nWidth
=
nMaxFrm
;
aSz
.
SetHeight
(
MINFLY
);
else
if
(
nWidth
>
(
sal_uInt16
)
nMinFrm
)
rFlySet
.
Put
(
aSz
);
nWidth
=
nMinFrm
;
}
}
else
if
(
MINFLY
>
static_cast
<
const
SwFmtFrmSize
*>
(
pItem
)
->
GetHeight
()
)
{
SwFmtFrmSize
aSz
(
*
static_cast
<
const
SwFmtFrmSize
*>
(
pItem
)
);
aSz
.
SetHeight
(
MINFLY
);
rFlySet
.
Put
(
aSz
);
}
}
if
(
MINFLY
>
nWidth
)
nWidth
=
MINFLY
;
aSz
.
SetWidth
(
nWidth
);
if
(
MINFLY
>
aSz
.
GetHeight
()
)
aSz
.
SetHeight
(
MINFLY
);
rFlySet
.
Put
(
aSz
);
}
else
if
(
MINFLY
>
static_cast
<
const
SwFmtFrmSize
*>
(
pItem
)
->
GetHeight
()
)
{
SwFmtFrmSize
aSz
(
*
static_cast
<
const
SwFmtFrmSize
*>
(
pItem
)
);
aSz
.
SetHeight
(
MINFLY
);
rFlySet
.
Put
(
aSz
);
}
}
}
namespace
namespace
...
...
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