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
821521f7
Kaydet (Commit)
821521f7
authored
Şub 08, 2013
tarafından
Kohei Yoshida
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
First cut on the re-work. Lots of things are still broken.
Change-Id: Iec54d5f04cef1e17375d7414a71bec64431905d5
üst
fb61d3f8
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
258 additions
and
332 deletions
+258
-332
Library_sc.mk
sc/Library_sc.mk
+2
-1
XMLTextPContext.cxx
sc/source/filter/xml/XMLTextPContext.cxx
+0
-209
XMLTextPContext.hxx
sc/source/filter/xml/XMLTextPContext.hxx
+0
-65
celltextparacontext.cxx
sc/source/filter/xml/celltextparacontext.cxx
+98
-0
celltextparacontext.hxx
sc/source/filter/xml/celltextparacontext.hxx
+57
-0
importcontext.cxx
sc/source/filter/xml/importcontext.cxx
+28
-0
importcontext.hxx
sc/source/filter/xml/importcontext.hxx
+29
-0
xmlcelli.cxx
sc/source/filter/xml/xmlcelli.cxx
+19
-55
xmlcelli.hxx
sc/source/filter/xml/xmlcelli.hxx
+3
-2
xmlimprt.cxx
sc/source/filter/xml/xmlimprt.cxx
+16
-0
xmlimprt.hxx
sc/source/filter/xml/xmlimprt.hxx
+6
-0
No files found.
sc/Library_sc.mk
Dosyayı görüntüle @
821521f7
...
@@ -266,9 +266,10 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
...
@@ -266,9 +266,10 @@ $(eval $(call gb_Library_add_exception_objects,sc,\
sc/source/filter/xml/XMLTableShapeResizer \
sc/source/filter/xml/XMLTableShapeResizer \
sc/source/filter/xml/XMLTableShapesContext \
sc/source/filter/xml/XMLTableShapesContext \
sc/source/filter/xml/XMLTableSourceContext \
sc/source/filter/xml/XMLTableSourceContext \
sc/source/filter/xml/XMLTextPContext \
sc/source/filter/xml/XMLTrackedChangesContext \
sc/source/filter/xml/XMLTrackedChangesContext \
sc/source/filter/xml/cachedattraccess \
sc/source/filter/xml/cachedattraccess \
sc/source/filter/xml/celltextparacontext \
sc/source/filter/xml/importcontext \
sc/source/filter/xml/sheetdata \
sc/source/filter/xml/sheetdata \
sc/source/filter/xml/xmlannoi \
sc/source/filter/xml/xmlannoi \
sc/source/filter/xml/xmlbodyi \
sc/source/filter/xml/xmlbodyi \
...
...
sc/source/filter/xml/XMLTextPContext.cxx
deleted
100644 → 0
Dosyayı görüntüle @
fb61d3f8
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "XMLTextPContext.hxx"
#include "xmlimprt.hxx"
#include "xmlcelli.hxx"
#include <xmloff/xmlnmspe.hxx>
#include <xmloff/xmltoken.hxx>
#include <xmloff/nmspmap.hxx>
#include <com/sun/star/text/XTextCursor.hpp>
using
namespace
com
::
sun
::
star
;
using
namespace
xmloff
::
token
;
class
ScXMLTextTContext
:
public
SvXMLImportContext
{
const
ScXMLImport
&
GetScImport
()
const
{
return
(
const
ScXMLImport
&
)
GetImport
();
}
ScXMLImport
&
GetScImport
()
{
return
(
ScXMLImport
&
)
GetImport
();
}
public
:
ScXMLTextTContext
(
ScXMLImport
&
rImport
,
sal_uInt16
nPrfx
,
const
::
rtl
::
OUString
&
rLName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
,
ScXMLTextPContext
*
pTextPContext
);
virtual
~
ScXMLTextTContext
();
};
ScXMLTextTContext
::
ScXMLTextTContext
(
ScXMLImport
&
rImport
,
sal_uInt16
nPrfx
,
const
::
rtl
::
OUString
&
rLName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
,
ScXMLTextPContext
*
pTextPContext
)
:
SvXMLImportContext
(
rImport
,
nPrfx
,
rLName
)
{
if
(
pTextPContext
)
{
sal_Int16
nAttrCount
(
xAttrList
.
is
()
?
xAttrList
->
getLength
()
:
0
);
rtl
::
OUString
aLocalName
;
sal_Int32
nCount
(
1
);
for
(
sal_Int16
i
=
0
;
i
<
nAttrCount
;
++
i
)
{
sal_uInt16
nPrefix
(
GetScImport
().
GetNamespaceMap
().
GetKeyByAttrName
(
xAttrList
->
getNameByIndex
(
i
),
&
aLocalName
));
const
rtl
::
OUString
&
sValue
(
xAttrList
->
getValueByIndex
(
i
));
if
((
nPrefix
==
XML_NAMESPACE_TEXT
)
&&
IsXMLToken
(
aLocalName
,
XML_C
))
nCount
=
sValue
.
toInt32
();
}
pTextPContext
->
AddSpaces
(
nCount
);
}
}
ScXMLTextTContext
::~
ScXMLTextTContext
()
{
}
//------------------------------------------------------------------
ScXMLTextPContext
::
ScXMLTextPContext
(
ScXMLImport
&
rImport
,
sal_uInt16
nPrfx
,
const
::
rtl
::
OUString
&
rLName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xTempAttrList
,
ScXMLTableRowCellContext
*
pTempCellContext
)
:
SvXMLImportContext
(
rImport
,
nPrfx
,
rLName
),
xAttrList
(
xTempAttrList
),
pTextPContext
(
NULL
),
pCellContext
(
pTempCellContext
),
sLName
(
rLName
),
sSimpleContent
(),
pContentBuffer
(
NULL
),
nPrefix
(
nPrfx
)
{
// here are no attributes
}
ScXMLTextPContext
::~
ScXMLTextPContext
()
{
if
(
pTextPContext
)
delete
pTextPContext
;
if
(
pContentBuffer
)
delete
pContentBuffer
;
}
void
ScXMLTextPContext
::
AddSpaces
(
sal_Int32
nSpaceCount
)
{
// use pContentBuffer
if
(
!
pContentBuffer
)
pContentBuffer
=
new
rtl
::
OUStringBuffer
(
sSimpleContent
);
sal_Char
*
pChars
=
new
sal_Char
[
nSpaceCount
];
memset
(
pChars
,
' '
,
nSpaceCount
);
pContentBuffer
->
appendAscii
(
pChars
,
nSpaceCount
);
}
SvXMLImportContext
*
ScXMLTextPContext
::
CreateChildContext
(
sal_uInt16
nTempPrefix
,
const
::
rtl
::
OUString
&
rLName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xTempAttrList
)
{
SvXMLImportContext
*
pContext
(
NULL
);
if
(
!
pTextPContext
&&
(
nTempPrefix
==
XML_NAMESPACE_TEXT
)
&&
IsXMLToken
(
rLName
,
XML_S
))
pContext
=
new
ScXMLTextTContext
(
GetScImport
(),
nTempPrefix
,
rLName
,
xTempAttrList
,
this
);
else
{
if
(
!
pTextPContext
)
{
rtl
::
OUString
sSetString
;
if
(
pContentBuffer
)
sSetString
=
pContentBuffer
->
makeStringAndClear
();
else
sSetString
=
sSimpleContent
;
sal_Unicode
cNonSpace
(
0
);
sal_Int32
nLength
=
sSetString
.
getLength
();
if
(
nLength
>
0
)
{
sal_Unicode
cLast
=
sSetString
.
getStr
()[
nLength
-
1
];
if
(
cLast
!=
(
sal_Unicode
)
' '
)
{
// #i53253# To keep XMLParaContext's whitespace handling in sync,
// if there's a non-space character at the end of the existing string,
// it has to be processed by XMLParaContext.
cNonSpace
=
cLast
;
sSetString
=
sSetString
.
copy
(
0
,
nLength
-
1
);
// remove from the string for SetCursorOnTextImport
}
}
pCellContext
->
SetCursorOnTextImport
(
sSetString
);
pTextPContext
=
GetScImport
().
GetTextImport
()
->
CreateTextChildContext
(
GetScImport
(),
nPrefix
,
sLName
,
xAttrList
);
if
(
cNonSpace
!=
0
)
{
// pass non-space character through XMLParaContext, so a following space isn't ignored
pTextPContext
->
Characters
(
rtl
::
OUString
(
cNonSpace
)
);
}
}
if
(
pTextPContext
)
pContext
=
pTextPContext
->
CreateChildContext
(
nTempPrefix
,
rLName
,
xTempAttrList
);
}
if
(
!
pContext
)
pContext
=
new
SvXMLImportContext
(
GetScImport
(),
nTempPrefix
,
rLName
);
return
pContext
;
}
void
ScXMLTextPContext
::
Characters
(
const
::
rtl
::
OUString
&
rChars
)
{
if
(
!
pTextPContext
)
{
// For the first call to an empty context, copy (ref-counted) the OUString.
// The OUStringBuffer is used only if there is more complex content.
if
(
!
pContentBuffer
&&
sSimpleContent
.
isEmpty
()
)
sSimpleContent
=
rChars
;
else
{
if
(
!
pContentBuffer
)
pContentBuffer
=
new
rtl
::
OUStringBuffer
(
sSimpleContent
);
pContentBuffer
->
append
(
rChars
);
}
}
else
pTextPContext
->
Characters
(
rChars
);
}
void
ScXMLTextPContext
::
EndElement
()
{
if
(
!
pTextPContext
)
{
if
(
pContentBuffer
)
pCellContext
->
SetString
(
pContentBuffer
->
makeStringAndClear
());
else
pCellContext
->
SetString
(
sSimpleContent
);
}
else
{
pTextPContext
->
EndElement
();
GetScImport
().
SetRemoveLastChar
(
sal_True
);
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/filter/xml/XMLTextPContext.hxx
deleted
100644 → 0
Dosyayı görüntüle @
fb61d3f8
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*
* This file incorporates work covered by the following license notice:
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed
* with this work for additional information regarding copyright
* ownership. The ASF licenses this file to you under the Apache
* License, Version 2.0 (the "License"); you may not use this file
* except in compliance with the License. You may obtain a copy of
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#ifndef SC_XMLTEXTPCONTEXT_HXX
#define SC_XMLTEXTPCONTEXT_HXX
#include <xmloff/xmlictxt.hxx>
#include <rtl/ustrbuf.hxx>
class
ScXMLImport
;
class
ScXMLTableRowCellContext
;
class
ScXMLTextPContext
:
public
SvXMLImportContext
{
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>
xAttrList
;
SvXMLImportContext
*
pTextPContext
;
ScXMLTableRowCellContext
*
pCellContext
;
rtl
::
OUString
sLName
;
rtl
::
OUString
sSimpleContent
;
// copy of the first Character call's argument
rtl
::
OUStringBuffer
*
pContentBuffer
;
// used if there's more than one string
sal_uInt16
nPrefix
;
const
ScXMLImport
&
GetScImport
()
const
{
return
(
const
ScXMLImport
&
)
GetImport
();
}
ScXMLImport
&
GetScImport
()
{
return
(
ScXMLImport
&
)
GetImport
();
}
public
:
ScXMLTextPContext
(
ScXMLImport
&
rImport
,
sal_uInt16
nPrfx
,
const
::
rtl
::
OUString
&
rLName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
,
ScXMLTableRowCellContext
*
pCellContext
);
virtual
~
ScXMLTextPContext
();
virtual
SvXMLImportContext
*
CreateChildContext
(
sal_uInt16
nPrefix
,
const
::
rtl
::
OUString
&
rLocalName
,
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
);
virtual
void
Characters
(
const
::
rtl
::
OUString
&
rChars
);
virtual
void
EndElement
();
void
AddSpaces
(
sal_Int32
nSpaceCount
);
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/filter/xml/celltextparacontext.cxx
0 → 100644
Dosyayı görüntüle @
821521f7
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "celltextparacontext.hxx"
#include "xmlimprt.hxx"
#include "xmlcelli.hxx"
#include <com/sun/star/xml/sax/XAttributeList.hpp>
using
namespace
com
::
sun
::
star
;
ScXMLCellTextParaContext
::
ScXMLCellTextParaContext
(
ScXMLImport
&
rImport
,
sal_uInt16
nPrefix
,
const
OUString
&
rLName
,
ScXMLTableRowCellContext
&
rParent
)
:
ScXMLImportContext
(
rImport
,
nPrefix
,
rLName
),
mrParentCxt
(
rParent
)
{
}
void
ScXMLCellTextParaContext
::
StartElement
(
const
uno
::
Reference
<
xml
::
sax
::
XAttributeList
>&
xAttrList
)
{
}
void
ScXMLCellTextParaContext
::
EndElement
()
{
OUString
aPara
=
maContent
.
makeStringAndClear
();
if
(
aPara
.
isEmpty
())
return
;
mrParentCxt
.
PushParagraph
(
aPara
);
}
void
ScXMLCellTextParaContext
::
Characters
(
const
OUString
&
rChars
)
{
if
(
rChars
.
isEmpty
())
return
;
maContent
.
append
(
rChars
);
}
SvXMLImportContext
*
ScXMLCellTextParaContext
::
CreateChildContext
(
sal_uInt16
nPrefix
,
const
OUString
&
rLocalName
,
const
uno
::
Reference
<
xml
::
sax
::
XAttributeList
>&
xAttrList
)
{
const
SvXMLTokenMap
&
rTokenMap
=
GetScImport
().
GetCellTextParaElemTokenMap
();
switch
(
rTokenMap
.
Get
(
nPrefix
,
rLocalName
))
{
case
XML_TOK_CELL_TEXT_SPAN
:
return
new
ScXMLCellTextSpanContext
(
GetScImport
(),
nPrefix
,
rLocalName
,
*
this
);
break
;
default
:
;
}
return
new
SvXMLImportContext
(
GetImport
(),
nPrefix
,
rLocalName
);
}
void
ScXMLCellTextParaContext
::
PushSpan
(
const
OUString
&
rSpan
)
{
if
(
rSpan
.
isEmpty
())
return
;
maContent
.
append
(
rSpan
);
}
ScXMLCellTextSpanContext
::
ScXMLCellTextSpanContext
(
ScXMLImport
&
rImport
,
sal_uInt16
nPrefix
,
const
OUString
&
rLName
,
ScXMLCellTextParaContext
&
rParent
)
:
ScXMLImportContext
(
rImport
,
nPrefix
,
rLName
),
mrParentCxt
(
rParent
)
{
}
void
ScXMLCellTextSpanContext
::
StartElement
(
const
uno
::
Reference
<
xml
::
sax
::
XAttributeList
>&
xAttrList
)
{
}
void
ScXMLCellTextSpanContext
::
EndElement
()
{
if
(
!
maContent
.
isEmpty
())
mrParentCxt
.
PushSpan
(
maContent
);
}
void
ScXMLCellTextSpanContext
::
Characters
(
const
OUString
&
rChars
)
{
maContent
=
rChars
;
}
SvXMLImportContext
*
ScXMLCellTextSpanContext
::
CreateChildContext
(
sal_uInt16
nPrefix
,
const
OUString
&
rLocalName
,
const
uno
::
Reference
<
xml
::
sax
::
XAttributeList
>&
xAttrList
)
{
return
new
SvXMLImportContext
(
GetImport
(),
nPrefix
,
rLocalName
);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/filter/xml/celltextparacontext.hxx
0 → 100644
Dosyayı görüntüle @
821521f7
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#ifndef __SC_XML_CELLTEXTPARACONTEXT_HXX__
#define __SC_XML_CELLTEXTPARACONTEXT_HXX__
#include "importcontext.hxx"
class
ScXMLImport
;
class
ScXMLTableRowCellContext
;
/**
* This context handles <text:p> element inside <table:table-cell>.
*/
class
ScXMLCellTextParaContext
:
public
ScXMLImportContext
{
ScXMLTableRowCellContext
&
mrParentCxt
;
OUStringBuffer
maContent
;
public
:
ScXMLCellTextParaContext
(
ScXMLImport
&
rImport
,
sal_uInt16
nPrefix
,
const
OUString
&
rLName
,
ScXMLTableRowCellContext
&
rParent
);
virtual
void
StartElement
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
);
virtual
void
EndElement
();
virtual
void
Characters
(
const
OUString
&
rChars
);
virtual
SvXMLImportContext
*
CreateChildContext
(
sal_uInt16
nPrefix
,
const
OUString
&
rLocalName
,
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
);
void
PushSpan
(
const
OUString
&
rSpan
);
};
/**
* This context handles <text:span> element inside <text:p>.
*/
class
ScXMLCellTextSpanContext
:
public
ScXMLImportContext
{
ScXMLCellTextParaContext
&
mrParentCxt
;
OUString
maContent
;
public
:
ScXMLCellTextSpanContext
(
ScXMLImport
&
rImport
,
sal_uInt16
nPrefix
,
const
OUString
&
rLName
,
ScXMLCellTextParaContext
&
rParent
);
virtual
void
StartElement
(
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
);
virtual
void
EndElement
();
virtual
void
Characters
(
const
OUString
&
rChars
);
virtual
SvXMLImportContext
*
CreateChildContext
(
sal_uInt16
nPrefix
,
const
OUString
&
rLocalName
,
const
com
::
sun
::
star
::
uno
::
Reference
<
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
);
};
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
sc/source/filter/xml/importcontext.cxx
0 → 100644
Dosyayı görüntüle @
821521f7
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "importcontext.hxx"
#include "xmlimprt.hxx"
ScXMLImportContext
::
ScXMLImportContext
(
SvXMLImport
&
rImport
,
sal_uInt16
nPrefix
,
const
OUString
&
rLocalName
)
:
SvXMLImportContext
(
rImport
,
nPrefix
,
rLocalName
)
{
}
ScXMLImport
&
ScXMLImportContext
::
GetScImport
()
{
return
static_cast
<
ScXMLImport
&>
(
GetImport
());
}
const
ScXMLImport
&
ScXMLImportContext
::
GetScImport
()
const
{
return
static_cast
<
const
ScXMLImport
&>
(
GetImport
());
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/filter/xml/importcontext.hxx
0 → 100644
Dosyayı görüntüle @
821521f7
/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
/*
* This file is part of the LibreOffice project.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
#include "xmloff/xmlictxt.hxx"
#include "xmloff/xmlimp.hxx"
class
ScXMLImport
;
/**
* This class exists only to provide GetScImport() to its derived classes.
*/
class
ScXMLImportContext
:
public
SvXMLImportContext
{
public
:
ScXMLImportContext
(
SvXMLImport
&
rImport
,
sal_uInt16
nPrefix
,
const
OUString
&
rLocalName
);
protected
:
ScXMLImport
&
GetScImport
();
const
ScXMLImport
&
GetScImport
()
const
;
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sc/source/filter/xml/xmlcelli.cxx
Dosyayı görüntüle @
821521f7
...
@@ -37,8 +37,8 @@
...
@@ -37,8 +37,8 @@
#include "docpool.hxx"
#include "docpool.hxx"
#include "XMLTableShapeImportHelper.hxx"
#include "XMLTableShapeImportHelper.hxx"
#include "XMLTextPContext.hxx"
#include "XMLStylesImportHelper.hxx"
#include "XMLStylesImportHelper.hxx"
#include "celltextparacontext.hxx"
#include "arealink.hxx"
#include "arealink.hxx"
#include <sfx2/linkmgr.hxx>
#include <sfx2/linkmgr.hxx>
...
@@ -301,6 +301,11 @@ bool cellExists( const ScAddress& rCellPos )
...
@@ -301,6 +301,11 @@ bool cellExists( const ScAddress& rCellPos )
}
}
void
ScXMLTableRowCellContext
::
PushParagraph
(
const
OUString
&
rPara
)
{
maParagraphs
.
push_back
(
rPara
);
}
void
ScXMLTableRowCellContext
::
SetCursorOnTextImport
(
const
rtl
::
OUString
&
rOUTempText
)
void
ScXMLTableRowCellContext
::
SetCursorOnTextImport
(
const
rtl
::
OUString
&
rOUTempText
)
{
{
ScAddress
aCellPos
=
rXMLImport
.
GetTables
().
GetCurrentCellPos
();
ScAddress
aCellPos
=
rXMLImport
.
GetTables
().
GetCurrentCellPos
();
...
@@ -353,49 +358,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
...
@@ -353,49 +358,7 @@ SvXMLImportContext *ScXMLTableRowCellContext::CreateChildContext( sal_uInt16 nPr
bIsEmpty
=
false
;
bIsEmpty
=
false
;
bTextP
=
true
;
bTextP
=
true
;
ScAddress
aCellPos
=
rXMLImport
.
GetTables
().
GetCurrentCellPos
();
pContext
=
new
ScXMLCellTextParaContext
(
rXMLImport
,
nPrefix
,
rLName
,
*
this
);
if
(((
nCellType
==
util
::
NumberFormat
::
TEXT
)
||
maFormula
||
bFormulaTextResult
))
{
if
(
maFormula
)
{
pContext
=
new
ScXMLTextPContext
(
rXMLImport
,
nPrefix
,
rLName
,
xAttrList
,
this
);
}
else
if
(
!
bHasTextImport
)
{
bIsFirstTextImport
=
true
;
bHasTextImport
=
true
;
pContext
=
new
ScXMLTextPContext
(
rXMLImport
,
nPrefix
,
rLName
,
xAttrList
,
this
);
}
else
{
if
(
cellExists
(
aCellPos
))
{
if
(
bIsFirstTextImport
&&
!
rXMLImport
.
GetRemoveLastChar
())
{
if
(
pOUTextContent
)
{
SetCursorOnTextImport
(
*
pOUTextContent
);
pOUTextContent
.
reset
();
}
else
SetCursorOnTextImport
(
rtl
::
OUString
());
rXMLImport
.
SetRemoveLastChar
(
true
);
uno
::
Reference
<
text
::
XTextCursor
>
xTextCursor
(
rXMLImport
.
GetTextImport
()
->
GetCursor
());
if
(
xTextCursor
.
is
())
{
uno
::
Reference
<
text
::
XText
>
xText
(
xTextCursor
->
getText
());
uno
::
Reference
<
text
::
XTextRange
>
xTextRange
(
xTextCursor
,
uno
::
UNO_QUERY
);
if
(
xText
.
is
()
&&
xTextRange
.
is
())
xText
->
insertControlCharacter
(
xTextRange
,
text
::
ControlCharacter
::
PARAGRAPH_BREAK
,
false
);
}
}
pContext
=
rXMLImport
.
GetTextImport
()
->
CreateTextChildContext
(
rXMLImport
,
nPrefix
,
rLName
,
xAttrList
);
bIsFirstTextImport
=
false
;
}
}
}
}
}
break
;
break
;
case
XML_TOK_TABLE_ROW_CELL_TABLE
:
case
XML_TOK_TABLE_ROW_CELL_TABLE
:
...
@@ -740,8 +703,8 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
...
@@ -740,8 +703,8 @@ void ScXMLTableRowCellContext::SetFormulaCell(ScFormulaCell* pFCell) const
}
}
else
if
(
!
rtl
::
math
::
isNan
(
fValue
))
else
if
(
!
rtl
::
math
::
isNan
(
fValue
))
{
{
if
(
pOUTextContent
)
if
(
!
maParagraphs
.
empty
()
)
pFCell
->
SetHybridValueString
(
fValue
,
*
pOUTextContent
);
pFCell
->
SetHybridValueString
(
fValue
,
maParagraphs
.
back
()
);
else
else
pFCell
->
SetHybridDouble
(
fValue
);
pFCell
->
SetHybridDouble
(
fValue
);
pFCell
->
ResetDirty
();
pFCell
->
ResetDirty
();
...
@@ -766,8 +729,8 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
...
@@ -766,8 +729,8 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
OUString
aCellString
;
OUString
aCellString
;
if
(
maStringValue
&&
!
maStringValue
->
isEmpty
())
if
(
maStringValue
&&
!
maStringValue
->
isEmpty
())
aCellString
=
*
maStringValue
;
aCellString
=
*
maStringValue
;
else
if
(
pOUTextContent
&&
!
pOUTextContent
->
isE
mpty
())
else
if
(
!
maParagraphs
.
e
mpty
())
aCellString
=
*
pOUTextContent
;
aCellString
=
maParagraphs
.
back
()
;
else
if
(
nCurrentCol
>
0
&&
pOUText
&&
!
pOUText
->
isEmpty
()
)
else
if
(
nCurrentCol
>
0
&&
pOUText
&&
!
pOUText
->
isEmpty
()
)
aCellString
=
*
pOUText
;
aCellString
=
*
pOUText
;
else
else
...
@@ -801,8 +764,8 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
...
@@ -801,8 +764,8 @@ void ScXMLTableRowCellContext::PutTextCell( const ScAddress& rCurrentPos,
ScDocument
*
pDoc
=
rXMLImport
.
GetDocument
();
ScDocument
*
pDoc
=
rXMLImport
.
GetDocument
();
if
(
maStringValue
&&
!
maStringValue
->
isEmpty
())
if
(
maStringValue
&&
!
maStringValue
->
isEmpty
())
pNewCell
=
ScBaseCell
::
CreateTextCell
(
*
maStringValue
,
pDoc
);
pNewCell
=
ScBaseCell
::
CreateTextCell
(
*
maStringValue
,
pDoc
);
else
if
(
pOUTextContent
&&
!
pOUTextContent
->
isE
mpty
())
else
if
(
!
maParagraphs
.
e
mpty
())
pNewCell
=
ScBaseCell
::
CreateTextCell
(
*
pOUTextContent
,
pDoc
);
pNewCell
=
ScBaseCell
::
CreateTextCell
(
maParagraphs
.
back
(),
pDoc
);
else
if
(
nCurrentCol
>
0
&&
pOUText
&&
!
pOUText
->
isEmpty
()
)
else
if
(
nCurrentCol
>
0
&&
pOUText
&&
!
pOUText
->
isEmpty
()
)
pNewCell
=
ScBaseCell
::
CreateTextCell
(
*
pOUText
,
pDoc
);
pNewCell
=
ScBaseCell
::
CreateTextCell
(
*
pOUText
,
pDoc
);
...
@@ -1013,7 +976,7 @@ void ScXMLTableRowCellContext::AddNonFormulaCells( const ScAddress& rCellPos )
...
@@ -1013,7 +976,7 @@ void ScXMLTableRowCellContext::AddNonFormulaCells( const ScAddress& rCellPos )
if
(
cellExists
(
rCellPos
)
&&
CellsAreRepeated
()
)
if
(
cellExists
(
rCellPos
)
&&
CellsAreRepeated
()
)
pOUText
.
reset
(
getOutputString
(
rXMLImport
.
GetDocument
(),
rCellPos
)
);
pOUText
.
reset
(
getOutputString
(
rXMLImport
.
GetDocument
(),
rCellPos
)
);
if
(
!
pOUTextContent
&&
!
pOUText
&&
!
maStringValue
)
if
(
maParagraphs
.
empty
()
&&
!
pOUText
&&
!
maStringValue
)
bIsEmpty
=
true
;
bIsEmpty
=
true
;
}
}
...
@@ -1163,11 +1126,12 @@ void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rCellPos )
...
@@ -1163,11 +1126,12 @@ void ScXMLTableRowCellContext::AddFormulaCell( const ScAddress& rCellPos )
// - has an "Err:[###]" (where "[###]" is an error number)
// - has an "Err:[###]" (where "[###]" is an error number)
void
ScXMLTableRowCellContext
::
HasSpecialCaseFormulaText
()
void
ScXMLTableRowCellContext
::
HasSpecialCaseFormulaText
()
{
{
if
(
pOUTextContent
)
if
(
!
maParagraphs
.
empty
()
)
{
{
if
(
pOUTextContent
->
isEmpty
()
||
pOUTextContent
->
startsWith
(
"Err:"
)
)
const
OUString
&
rStr
=
maParagraphs
.
back
();
if
(
rStr
.
isEmpty
()
||
rStr
.
startsWith
(
"Err:"
))
mbPossibleErrorCell
=
true
;
mbPossibleErrorCell
=
true
;
else
if
(
pOUTextContent
->
startsWith
(
"#"
))
else
if
(
rStr
.
startsWith
(
"#"
))
mbCheckWithCompilerForError
=
true
;
mbCheckWithCompilerForError
=
true
;
}
}
}
}
...
@@ -1196,7 +1160,7 @@ void ScXMLTableRowCellContext::EndElement()
...
@@ -1196,7 +1160,7 @@ void ScXMLTableRowCellContext::EndElement()
HasSpecialCaseFormulaText
();
HasSpecialCaseFormulaText
();
if
(
bFormulaTextResult
&&
(
mbPossibleErrorCell
||
mbCheckWithCompilerForError
)
)
if
(
bFormulaTextResult
&&
(
mbPossibleErrorCell
||
mbCheckWithCompilerForError
)
)
{
{
maStringValue
.
reset
(
*
pOUTextContent
);
maStringValue
.
reset
(
maParagraphs
.
back
()
);
nCellType
=
util
::
NumberFormat
::
TEXT
;
nCellType
=
util
::
NumberFormat
::
TEXT
;
}
}
...
...
sc/source/filter/xml/xmlcelli.hxx
Dosyayı görüntüle @
821521f7
...
@@ -40,7 +40,8 @@ class ScXMLTableRowCellContext : public SvXMLImportContext
...
@@ -40,7 +40,8 @@ class ScXMLTableRowCellContext : public SvXMLImportContext
boost
::
optional
<
OUString
>
maStringValue
;
/// office:string-value attribute
boost
::
optional
<
OUString
>
maStringValue
;
/// office:string-value attribute
boost
::
optional
<
OUString
>
maContentValidationName
;
boost
::
optional
<
OUString
>
maContentValidationName
;
::
boost
::
optional
<
rtl
::
OUString
>
pOUTextContent
;
std
::
vector
<
OUString
>
maParagraphs
;
boost
::
scoped_ptr
<
ScXMLAnnotationData
>
mxAnnotationData
;
boost
::
scoped_ptr
<
ScXMLAnnotationData
>
mxAnnotationData
;
ScMyImpDetectiveObjVec
*
pDetectiveObjVec
;
ScMyImpDetectiveObjVec
*
pDetectiveObjVec
;
ScMyImpCellRangeSource
*
pCellRangeSource
;
ScMyImpCellRangeSource
*
pCellRangeSource
;
...
@@ -106,7 +107,7 @@ public:
...
@@ -106,7 +107,7 @@ public:
const
::
com
::
sun
::
star
::
uno
::
Reference
<
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
);
::
com
::
sun
::
star
::
xml
::
sax
::
XAttributeList
>&
xAttrList
);
inline
void
SetString
(
const
rtl
::
OUString
&
rOUTempText
)
{
pOUTextContent
.
reset
(
rOUTempText
);
}
void
PushParagraph
(
const
OUString
&
rPara
);
void
SetCursorOnTextImport
(
const
rtl
::
OUString
&
rOUTempText
);
void
SetCursorOnTextImport
(
const
rtl
::
OUString
&
rOUTempText
);
void
SetAnnotation
(
const
ScAddress
&
rPosition
);
void
SetAnnotation
(
const
ScAddress
&
rPosition
);
...
...
sc/source/filter/xml/xmlimprt.cxx
Dosyayı görüntüle @
821521f7
...
@@ -1839,6 +1839,20 @@ const SvXMLTokenMap& ScXMLImport::GetConsolidationAttrTokenMap()
...
@@ -1839,6 +1839,20 @@ const SvXMLTokenMap& ScXMLImport::GetConsolidationAttrTokenMap()
return
*
pConsolidationAttrTokenMap
;
return
*
pConsolidationAttrTokenMap
;
}
}
const
SvXMLTokenMap
&
ScXMLImport
::
GetCellTextParaElemTokenMap
()
{
if
(
!
pCellTextParaElemTokemMap
)
{
static
SvXMLTokenMapEntry
aMap
[]
=
{
{
XML_NAMESPACE_TEXT
,
XML_SPAN
,
XML_TOK_CELL_TEXT_SPAN
},
XML_TOKEN_MAP_END
};
pCellTextParaElemTokemMap
=
new
SvXMLTokenMap
(
aMap
);
}
return
*
pCellTextParaElemTokemMap
;
}
SvXMLImportContext
*
ScXMLImport
::
CreateContext
(
sal_uInt16
nPrefix
,
SvXMLImportContext
*
ScXMLImport
::
CreateContext
(
sal_uInt16
nPrefix
,
const
OUString
&
rLocalName
,
const
OUString
&
rLocalName
,
...
@@ -1962,6 +1976,7 @@ ScXMLImport::ScXMLImport(
...
@@ -1962,6 +1976,7 @@ ScXMLImport::ScXMLImport(
pDataPilotMembersElemTokenMap
(
0
),
pDataPilotMembersElemTokenMap
(
0
),
pDataPilotMemberAttrTokenMap
(
0
),
pDataPilotMemberAttrTokenMap
(
0
),
pConsolidationAttrTokenMap
(
0
),
pConsolidationAttrTokenMap
(
0
),
pCellTextParaElemTokemMap
(
NULL
),
aTables
(
*
this
),
aTables
(
*
this
),
pMyNamedExpressions
(
NULL
),
pMyNamedExpressions
(
NULL
),
pMyLabelRanges
(
NULL
),
pMyLabelRanges
(
NULL
),
...
@@ -2099,6 +2114,7 @@ ScXMLImport::~ScXMLImport() throw()
...
@@ -2099,6 +2114,7 @@ ScXMLImport::~ScXMLImport() throw()
delete
pDataPilotMembersElemTokenMap
;
delete
pDataPilotMembersElemTokenMap
;
delete
pDataPilotMemberAttrTokenMap
;
delete
pDataPilotMemberAttrTokenMap
;
delete
pConsolidationAttrTokenMap
;
delete
pConsolidationAttrTokenMap
;
delete
pCellTextParaElemTokemMap
;
delete
pChangeTrackingImportHelper
;
delete
pChangeTrackingImportHelper
;
delete
pNumberFormatAttributesExportHelper
;
delete
pNumberFormatAttributesExportHelper
;
...
...
sc/source/filter/xml/xmlimprt.hxx
Dosyayı görüntüle @
821521f7
...
@@ -681,6 +681,10 @@ enum ScXMLConsolidationAttrTokens
...
@@ -681,6 +681,10 @@ enum ScXMLConsolidationAttrTokens
XML_TOK_CONSOLIDATION_ATTR_LINK_TO_SOURCE
XML_TOK_CONSOLIDATION_ATTR_LINK_TO_SOURCE
};
};
enum
ScXMLCellTextParaElemTokens
{
XML_TOK_CELL_TEXT_SPAN
};
class
SvXMLTokenMap
;
class
SvXMLTokenMap
;
class
XMLShapeImportHelper
;
class
XMLShapeImportHelper
;
...
@@ -847,6 +851,7 @@ class ScXMLImport: public SvXMLImport, boost::noncopyable
...
@@ -847,6 +851,7 @@ class ScXMLImport: public SvXMLImport, boost::noncopyable
SvXMLTokenMap
*
pDataPilotMembersElemTokenMap
;
SvXMLTokenMap
*
pDataPilotMembersElemTokenMap
;
SvXMLTokenMap
*
pDataPilotMemberAttrTokenMap
;
SvXMLTokenMap
*
pDataPilotMemberAttrTokenMap
;
SvXMLTokenMap
*
pConsolidationAttrTokenMap
;
SvXMLTokenMap
*
pConsolidationAttrTokenMap
;
SvXMLTokenMap
*
pCellTextParaElemTokemMap
;
ScMyTables
aTables
;
ScMyTables
aTables
;
...
@@ -1012,6 +1017,7 @@ public:
...
@@ -1012,6 +1017,7 @@ public:
const
SvXMLTokenMap
&
GetDataPilotMembersElemTokenMap
();
const
SvXMLTokenMap
&
GetDataPilotMembersElemTokenMap
();
const
SvXMLTokenMap
&
GetDataPilotMemberAttrTokenMap
();
const
SvXMLTokenMap
&
GetDataPilotMemberAttrTokenMap
();
const
SvXMLTokenMap
&
GetConsolidationAttrTokenMap
();
const
SvXMLTokenMap
&
GetConsolidationAttrTokenMap
();
const
SvXMLTokenMap
&
GetCellTextParaElemTokenMap
();
void
AddNamedExpression
(
ScMyNamedExpression
*
pMyNamedExpression
)
void
AddNamedExpression
(
ScMyNamedExpression
*
pMyNamedExpression
)
{
{
...
...
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