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
0960ec3e
Kaydet (Commit)
0960ec3e
authored
Kas 18, 2011
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Simplified & clarified the connection logic.
üst
d540bdcc
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
17 deletions
+31
-17
xmlfilti.cxx
sc/source/filter/xml/xmlfilti.cxx
+24
-14
xmlfilti.hxx
sc/source/filter/xml/xmlfilti.hxx
+7
-3
No files found.
sc/source/filter/xml/xmlfilti.cxx
Dosyayı görüntüle @
0960ec3e
...
@@ -50,7 +50,7 @@ using namespace xmloff::token;
...
@@ -50,7 +50,7 @@ using namespace xmloff::token;
using
::
com
::
sun
::
star
::
uno
::
Reference
;
using
::
com
::
sun
::
star
::
uno
::
Reference
;
using
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
;
using
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
;
//------------------------------------------------------------------
ScXMLFilterContext
::
ConnStackItem
::
ConnStackItem
(
bool
bOr
)
:
mbOr
(
bOr
),
mnCondCount
(
0
)
{}
ScXMLFilterContext
::
ScXMLFilterContext
(
ScXMLImport
&
rImport
,
ScXMLFilterContext
::
ScXMLFilterContext
(
ScXMLImport
&
rImport
,
sal_uInt16
nPrfx
,
sal_uInt16
nPrfx
,
...
@@ -65,8 +65,6 @@ ScXMLFilterContext::ScXMLFilterContext( ScXMLImport& rImport,
...
@@ -65,8 +65,6 @@ ScXMLFilterContext::ScXMLFilterContext( ScXMLImport& rImport,
bSkipDuplicates
(
false
),
bSkipDuplicates
(
false
),
bCopyOutputData
(
false
),
bCopyOutputData
(
false
),
bUseRegularExpressions
(
false
),
bUseRegularExpressions
(
false
),
bConnectionOr
(
true
),
bNextConnectionOr
(
true
),
bConditionSourceRange
(
false
)
bConditionSourceRange
(
false
)
{
{
ScDocument
*
pDoc
(
GetScImport
().
GetDocument
());
ScDocument
*
pDoc
(
GetScImport
().
GetDocument
());
...
@@ -184,25 +182,37 @@ void ScXMLFilterContext::SetUseRegularExpressions(bool b)
...
@@ -184,25 +182,37 @@ void ScXMLFilterContext::SetUseRegularExpressions(bool b)
void
ScXMLFilterContext
::
OpenConnection
(
bool
b
)
void
ScXMLFilterContext
::
OpenConnection
(
bool
b
)
{
{
bool
bTemp
=
bConnectionOr
;
maConnStack
.
push_back
(
ConnStackItem
(
b
));
bConnectionOr
=
bNextConnectionOr
;
bNextConnectionOr
=
b
;
maOrConnectionStack
.
push_back
(
bTemp
);
}
}
void
ScXMLFilterContext
::
CloseConnection
()
void
ScXMLFilterContext
::
CloseConnection
()
{
{
bool
bTemp
=
maOrConnectionStack
.
back
();
maConnStack
.
pop_back
();
maOrConnectionStack
.
pop_back
();
bConnectionOr
=
bTemp
;
bNextConnectionOr
=
bTemp
;
}
}
bool
ScXMLFilterContext
::
GetConnection
()
bool
ScXMLFilterContext
::
GetConnection
()
{
{
bool
bTemp
=
bConnectionOr
;
// For condition items in each stack, the first one gets the connection of
bConnectionOr
=
bNextConnectionOr
;
// the last stack, while the rest of them get that of the current stack.
return
bTemp
;
if
(
maConnStack
.
empty
())
// This should never happen.
return
true
;
ConnStackItem
&
rItem
=
maConnStack
.
back
();
if
(
rItem
.
mnCondCount
)
// secondary item gets the current connection.
return
rItem
.
mbOr
;
if
(
maConnStack
.
size
()
<
2
)
// There is no last stack. Likely the first condition in the first
// stack whose connection is not used.
return
true
;
++
rItem
.
mnCondCount
;
std
::
vector
<
ConnStackItem
>::
reverse_iterator
itr
=
maConnStack
.
rbegin
();
++
itr
;
return
itr
->
mbOr
;
// connection of the last stack.
}
}
void
ScXMLFilterContext
::
AddFilterField
(
const
sheet
::
TableFilterField2
&
aFilterField
)
void
ScXMLFilterContext
::
AddFilterField
(
const
sheet
::
TableFilterField2
&
aFilterField
)
...
...
sc/source/filter/xml/xmlfilti.hxx
Dosyayı görüntüle @
0960ec3e
...
@@ -48,6 +48,12 @@ struct ScQueryParam;
...
@@ -48,6 +48,12 @@ struct ScQueryParam;
class
ScXMLFilterContext
:
public
SvXMLImportContext
class
ScXMLFilterContext
:
public
SvXMLImportContext
{
{
struct
ConnStackItem
{
bool
mbOr
;
int
mnCondCount
;
ConnStackItem
(
bool
bOr
);
};
ScQueryParam
&
mrQueryParam
;
ScQueryParam
&
mrQueryParam
;
ScXMLDatabaseRangeContext
*
pDatabaseRangeContext
;
ScXMLDatabaseRangeContext
*
pDatabaseRangeContext
;
...
@@ -59,10 +65,8 @@ class ScXMLFilterContext : public SvXMLImportContext
...
@@ -59,10 +65,8 @@ class ScXMLFilterContext : public SvXMLImportContext
bool
bCopyOutputData
;
bool
bCopyOutputData
;
bool
bUseRegularExpressions
;
bool
bUseRegularExpressions
;
bool
bEnabledUserList
;
bool
bEnabledUserList
;
bool
bConnectionOr
;
bool
bNextConnectionOr
;
bool
bConditionSourceRange
;
bool
bConditionSourceRange
;
std
::
vector
<
bool
>
maOrConnectio
nStack
;
std
::
vector
<
ConnStackItem
>
maCon
nStack
;
const
ScXMLImport
&
GetScImport
()
const
{
return
(
const
ScXMLImport
&
)
GetImport
();
}
const
ScXMLImport
&
GetScImport
()
const
{
return
(
const
ScXMLImport
&
)
GetImport
();
}
ScXMLImport
&
GetScImport
()
{
return
(
ScXMLImport
&
)
GetImport
();
}
ScXMLImport
&
GetScImport
()
{
return
(
ScXMLImport
&
)
GetImport
();
}
...
...
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