[Libreoffice-commits] .: 5 commits - framework/source oox/inc oox/source sd/source svx/source sw/source unusedcode.easy vbahelper/inc
Caolán McNamara
caolan at kemper.freedesktop.org
Wed Mar 28 08:45:59 PDT 2012
framework/source/helper/statusindicatorfactory.cxx | 18
oox/inc/oox/drawingml/textparagraphproperties.hxx | 4
oox/inc/oox/dump/biffdumper.hxx | 576 --
oox/inc/oox/dump/dffdumper.hxx | 2
oox/inc/oox/dump/dumperbase.hxx | 42
oox/inc/oox/dump/xlsbdumper.hxx | 115
oox/source/drawingml/textparagraphproperties.cxx | 25
oox/source/dump/biffdumper.cxx | 4591 ---------------------
oox/source/dump/dffdumper.cxx | 11
oox/source/dump/dumperbase.cxx | 105
oox/source/dump/pptxdumper.cxx | 1
oox/source/dump/xlsbdumper.cxx | 2342 ----------
sd/source/filter/eppt/epptooxml.hxx | 1
sd/source/filter/eppt/pptx-epptooxml.cxx | 14
svx/source/gallery2/galexpl.cxx | 14
sw/source/core/text/EnhancedPDFExportHelper.cxx | 159
unusedcode.easy | 14
vbahelper/inc/vbahelper/vbahelperinterface.hxx | 1
18 files changed, 96 insertions(+), 7939 deletions(-)
New commits:
commit fc7e13ed531cc136b7348a10f12dc10db49492fb
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 28 16:20:35 2012 +0100
remove static OUStrings from static_initialization_and_destruction chain
diff --git a/framework/source/helper/statusindicatorfactory.cxx b/framework/source/helper/statusindicatorfactory.cxx
index f757b95..4c1e414 100644
--- a/framework/source/helper/statusindicatorfactory.cxx
+++ b/framework/source/helper/statusindicatorfactory.cxx
@@ -72,7 +72,7 @@ namespace framework{
// definitions
sal_Int32 StatusIndicatorFactory::m_nInReschedule = 0; /// static counter for rescheduling
-static ::rtl::OUString PROGRESS_RESOURCE(RTL_CONSTASCII_USTRINGPARAM("private:resource/progressbar/progressbar"));
+const char PROGRESS_RESOURCE[] = "private:resource/progressbar/progressbar";
//-----------------------------------------------
DEFINE_XINTERFACE_5(StatusIndicatorFactory ,
@@ -476,10 +476,11 @@ void StatusIndicatorFactory::impl_createProgress()
if (xLayoutManager.is())
{
xLayoutManager->lock();
- xLayoutManager->createElement( PROGRESS_RESOURCE );
- xLayoutManager->hideElement( PROGRESS_RESOURCE );
+ rtl::OUString sPROGRESS_RESOURCE(PROGRESS_RESOURCE);
+ xLayoutManager->createElement( sPROGRESS_RESOURCE );
+ xLayoutManager->hideElement( sPROGRESS_RESOURCE );
- css::uno::Reference< css::ui::XUIElement > xProgressBar = xLayoutManager->getElement(PROGRESS_RESOURCE);
+ css::uno::Reference< css::ui::XUIElement > xProgressBar = xLayoutManager->getElement(sPROGRESS_RESOURCE);
if (xProgressBar.is())
xProgress = css::uno::Reference< css::task::XStatusIndicator >(xProgressBar->getRealInterface(), css::uno::UNO_QUERY);
xLayoutManager->unlock();
@@ -522,10 +523,11 @@ void StatusIndicatorFactory::impl_showProgress()
// Be sure that we have always a progress. It can be that our frame
// was recycled and therefore the progress was destroyed!
// CreateElement does nothing if there is already a valid progress.
- xLayoutManager->createElement( PROGRESS_RESOURCE );
- xLayoutManager->showElement( PROGRESS_RESOURCE );
+ rtl::OUString sPROGRESS_RESOURCE(PROGRESS_RESOURCE);
+ xLayoutManager->createElement( sPROGRESS_RESOURCE );
+ xLayoutManager->showElement( sPROGRESS_RESOURCE );
- css::uno::Reference< css::ui::XUIElement > xProgressBar = xLayoutManager->getElement(PROGRESS_RESOURCE);
+ css::uno::Reference< css::ui::XUIElement > xProgressBar = xLayoutManager->getElement(sPROGRESS_RESOURCE);
if (xProgressBar.is())
xProgress = css::uno::Reference< css::task::XStatusIndicator >(xProgressBar->getRealInterface(), css::uno::UNO_QUERY);
}
@@ -561,7 +563,7 @@ void StatusIndicatorFactory::impl_hideProgress()
css::uno::Reference< css::frame::XLayoutManager > xLayoutManager;
xPropSet->getPropertyValue(FRAME_PROPNAME_LAYOUTMANAGER) >>= xLayoutManager;
if (xLayoutManager.is())
- xLayoutManager->hideElement( PROGRESS_RESOURCE );
+ xLayoutManager->hideElement( rtl::OUString(PROGRESS_RESOURCE) );
}
}
}
diff --git a/sw/source/core/text/EnhancedPDFExportHelper.cxx b/sw/source/core/text/EnhancedPDFExportHelper.cxx
index a66d224..4be6e05 100644
--- a/sw/source/core/text/EnhancedPDFExportHelper.cxx
+++ b/sw/source/core/text/EnhancedPDFExportHelper.cxx
@@ -131,45 +131,44 @@ void lcl_DBGCheckStack()
namespace
{
// ODF Style Names:
-const String aTableHeadingName = String::CreateFromAscii("Table Heading");
-const String aQuotations = String::CreateFromAscii("Quotations");
-const String aCaption = String::CreateFromAscii("Caption");
-const String aHeading = String::CreateFromAscii("Heading");
-const String aQuotation = String::CreateFromAscii("Quotation");
-const String aSourceText = String::CreateFromAscii("Source Text");
+const char aTableHeadingName[] = "Table Heading";
+const char aQuotations[] = "Quotations";
+const char aCaption[] = "Caption";
+const char aHeading[] = "Heading";
+const char aQuotation[] = "Quotation";
+const char aSourceText[] = "Source Text";
// PDF Tag Names:
-const String aDocumentString = String::CreateFromAscii("Document");
-const String aDivString = String::CreateFromAscii("Div");
-const String aSectString = String::CreateFromAscii("Sect");
-const String aHString = String::CreateFromAscii("H");
-const String aH1String = String::CreateFromAscii("H1");
-const String aH2String = String::CreateFromAscii("H2");
-const String aH3String = String::CreateFromAscii("H3");
-const String aH4String = String::CreateFromAscii("H4");
-const String aH5String = String::CreateFromAscii("H5");
-const String aH6String = String::CreateFromAscii("H6");
-const String aListString = String::CreateFromAscii("L");
-const String aListItemString = String::CreateFromAscii("LI");
-const String aListBodyString = String::CreateFromAscii("LBody");
-const String aBlockQuoteString = String::CreateFromAscii("BlockQuote");
-const String aCaptionString = String::CreateFromAscii("Caption");
-const String aIndexString = String::CreateFromAscii("Index");
-const String aTOCString = String::CreateFromAscii("TOC");
-const String aTOCIString = String::CreateFromAscii("TOCI");
-const String aTableString = String::CreateFromAscii("Table");
-const String aTRString = String::CreateFromAscii("TR");
-const String aTDString = String::CreateFromAscii("TD");
-const String aTHString = String::CreateFromAscii("TH");
-const String aBibEntryString = String::CreateFromAscii("BibEntry");
-const String aQuoteString = String::CreateFromAscii("Quote");
-const String aSpanString = String::CreateFromAscii("Span");
-const String aCodeString = String::CreateFromAscii("Code");
-const String aFigureString = String::CreateFromAscii("Figure");
-const String aFormulaString = String::CreateFromAscii("Formula");
-const String aLinkString = String::CreateFromAscii("Link");
-const String aNoteString = String::CreateFromAscii("Note");
-const String aEmptyString = String::CreateFromAscii("");
+const char aDocumentString[] = "Document";
+const char aDivString[] = "Div";
+const char aSectString[] = "Sect";
+const char aHString[] = "H";
+const char aH1String[] = "H1";
+const char aH2String[] = "H2";
+const char aH3String[] = "H3";
+const char aH4String[] = "H4";
+const char aH5String[] = "H5";
+const char aH6String[] = "H6";
+const char aListString[] = "L";
+const char aListItemString[] = "LI";
+const char aListBodyString[] = "LBody";
+const char aBlockQuoteString[] = "BlockQuote";
+const char aCaptionString[] = "Caption";
+const char aIndexString[] = "Index";
+const char aTOCString[] = "TOC";
+const char aTOCIString[] = "TOCI";
+const char aTableString[] = "Table";
+const char aTRString[] = "TR";
+const char aTDString[] = "TD";
+const char aTHString[] = "TH";
+const char aBibEntryString[] = "BibEntry";
+const char aQuoteString[] = "Quote";
+const char aSpanString[] = "Span";
+const char aCodeString[] = "Code";
+const char aFigureString[] = "Figure";
+const char aFormulaString[] = "Formula";
+const char aLinkString[] = "Link";
+const char aNoteString[] = "Note";
// returns true if first paragraph in cell frame has 'table heading' style
bool lcl_IsHeadlineCell( const SwCellFrm& rCellFrm )
@@ -184,7 +183,7 @@ bool lcl_IsHeadlineCell( const SwCellFrm& rCellFrm )
String sStyleName;
SwStyleNameMapper::FillProgName( pTxtFmt->GetName(), sStyleName, nsSwGetPoolIdFromName::GET_POOLID_TXTCOLL, sal_True );
- bRet = sStyleName == aTableHeadingName;
+ bRet = sStyleName.EqualsAscii(aTableHeadingName);
}
return bRet;
@@ -299,7 +298,7 @@ SwTaggedPDFHelper::SwTaggedPDFHelper( const Num_Info* pNumInfo,
else if ( mpPorInfo )
BeginInlineStructureElements();
else
- BeginTag( vcl::PDFWriter::NonStructElement, aEmptyString );
+ BeginTag( vcl::PDFWriter::NonStructElement, rtl::OUString() );
#if OSL_DEBUG_LEVEL > 1
nCurrentStruct = mpPDFExtOutDevData->GetCurrentStructureElement();
@@ -992,12 +991,12 @@ void SwTaggedPDFHelper::BeginNumberedListStructureElements()
const bool bNewItemTag = bNewListTag || pTxtNd->IsCountedInList(); // If the text node is not counted, we do not start a new list item:
if ( bNewListTag )
- BeginTag( vcl::PDFWriter::List, aListString );
+ BeginTag( vcl::PDFWriter::List, rtl::OUString(aListString) );
if ( bNewItemTag )
{
- BeginTag( vcl::PDFWriter::ListItem, aListItemString );
- BeginTag( vcl::PDFWriter::LIBody, aListBodyString );
+ BeginTag( vcl::PDFWriter::ListItem, rtl::OUString(aListItemString) );
+ BeginTag( vcl::PDFWriter::LIBody, rtl::OUString(aListBodyString) );
}
}
@@ -1033,7 +1032,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// Document: Document
//
nPDFType = vcl::PDFWriter::Document;
- aPDFType = aDocumentString;
+ aPDFType = rtl::OUString(aDocumentString);
break;
case FRM_HEADER :
@@ -1049,7 +1048,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// Footnote container: Division
//
nPDFType = vcl::PDFWriter::Division;
- aPDFType = aDivString;
+ aPDFType = rtl::OUString(aDivString);
break;
case FRM_FTN :
@@ -1059,7 +1058,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// Note: vcl::PDFWriter::Note is actually a ILSE. Nevertheless
// we treat it like a grouping element!
nPDFType = vcl::PDFWriter::Note;
- aPDFType = aNoteString;
+ aPDFType = rtl::OUString(aNoteString);
break;
case FRM_SECTION :
@@ -1077,19 +1076,19 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
if ( TOX_INDEX == pTOXBase->GetType() )
{
nPDFType = vcl::PDFWriter::Index;
- aPDFType = aIndexString;
+ aPDFType = rtl::OUString(aIndexString);
}
else
{
nPDFType = vcl::PDFWriter::TOC;
- aPDFType = aTOCString;
+ aPDFType = rtl::OUString(aTOCString);
}
}
}
else if ( CONTENT_SECTION == pSection->GetType() )
{
nPDFType = vcl::PDFWriter::Section;
- aPDFType = aSectString;
+ aPDFType = rtl::OUString(aSectString);
}
}
break;
@@ -1123,37 +1122,37 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
//
// Quotations: BlockQuote
//
- if ( sStyleName == aQuotations )
+ if ( sStyleName.EqualsAscii(aQuotations) )
{
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::BlockQuote);
- aPDFType = aBlockQuoteString;
+ aPDFType = rtl::OUString(aBlockQuoteString);
}
//
// Caption: Caption
//
- else if ( sStyleName == aCaption)
+ else if ( sStyleName.EqualsAscii(aCaption) )
{
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Caption);
- aPDFType = aCaptionString;
+ aPDFType = rtl::OUString(aCaptionString);
}
//
// Caption: Caption
//
- else if ( sParentStyleName == aCaption)
+ else if ( sParentStyleName.EqualsAscii(aCaption) )
{
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Caption);
- aPDFType = sStyleName.Append(aCaptionString);
+ aPDFType = sStyleName.Append(rtl::OUString(aCaptionString));
}
//
// Heading: H
//
- else if ( sStyleName == aHeading )
+ else if ( sStyleName.EqualsAscii(aHeading) )
{
nPDFType = static_cast<sal_uInt16>(vcl::PDFWriter::Heading);
- aPDFType = aHString;
+ aPDFType = rtl::OUString(aHString);
}
//
@@ -1169,22 +1168,22 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
switch(nRealLevel)
{
case 0 :
- aPDFType = aH1String;
+ aPDFType = rtl::OUString(aH1String);
break;
case 1 :
- aPDFType = aH2String;
+ aPDFType = rtl::OUString(aH2String);
break;
case 2 :
- aPDFType = aH3String;
+ aPDFType = rtl::OUString(aH3String);
break;
case 3 :
- aPDFType = aH4String;
+ aPDFType = rtl::OUString(aH4String);
break;
case 4 :
- aPDFType = aH5String;
+ aPDFType = rtl::OUString(aH5String);
break;
default:
- aPDFType = aH6String;
+ aPDFType = rtl::OUString(aH6String);
break;
}
}
@@ -1204,7 +1203,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
if ( pTOXBase && TOX_INDEX != pTOXBase->GetType() )
{
// Special case: Open additional TOCI tag:
- BeginTag( vcl::PDFWriter::TOCI, aTOCIString );
+ BeginTag( vcl::PDFWriter::TOCI, rtl::OUString(aTOCIString) );
}
}
}
@@ -1216,7 +1215,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
// TabFrm: Table
//
nPDFType = vcl::PDFWriter::Table;
- aPDFType = aTableString;
+ aPDFType = rtl::OUString(aTableString);
{
// set up table column data:
@@ -1270,7 +1269,7 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
if ( !static_cast<const SwRowFrm*>(pFrm)->IsRepeatedHeadline() )
{
nPDFType = vcl::PDFWriter::TableRow;
- aPDFType = aTRString;
+ aPDFType = rtl::OUString(aTRString);
}
else
{
@@ -1287,12 +1286,12 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
if ( pTable->IsInHeadline( *pFrm ) || lcl_IsHeadlineCell( *static_cast<const SwCellFrm*>(pFrm) ) )
{
nPDFType = vcl::PDFWriter::TableHeader;
- aPDFType = aTHString;
+ aPDFType = rtl::OUString(aTHString);
}
else
{
nPDFType = vcl::PDFWriter::TableData;
- aPDFType = aTDString;
+ aPDFType = rtl::OUString(aTDString);
}
}
break;
@@ -1324,18 +1323,18 @@ void SwTaggedPDFHelper::BeginBlockStructureElements()
if ( bFormula )
{
nPDFType = vcl::PDFWriter::Formula;
- aPDFType = aFormulaString;
+ aPDFType = rtl::OUString(aFormulaString);
}
else
{
nPDFType = vcl::PDFWriter::Figure;
- aPDFType = aFigureString;
+ aPDFType = rtl::OUString(aFigureString);
}
}
else
{
nPDFType = vcl::PDFWriter::Division;
- aPDFType = aDivString;
+ aPDFType = rtl::OUString(aDivString);
}
}
break;
@@ -1387,7 +1386,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
case POR_HYPHSTR :
case POR_SOFTHYPHSTR :
nPDFType = vcl::PDFWriter::Span;
- aPDFType = aSpanString;
+ aPDFType = rtl::OUString(aSpanString);
break;
case POR_LAY :
@@ -1414,18 +1413,18 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
if( pInetFmtAttr )
{
nPDFType = vcl::PDFWriter::Link;
- aPDFType = aLinkString;
+ aPDFType = rtl::OUString(aLinkString);
}
// Check for Quote/Code character style:
- else if ( sStyleName == aQuotation )
+ else if ( sStyleName.EqualsAscii(aQuotation) )
{
nPDFType = vcl::PDFWriter::Quote;
- aPDFType = aQuoteString;
+ aPDFType = rtl::OUString(aQuoteString);
}
- else if ( sStyleName == aSourceText )
+ else if ( sStyleName.EqualsAscii(aSourceText) )
{
nPDFType = vcl::PDFWriter::Code;
- aPDFType = aCodeString;
+ aPDFType = rtl::OUString(aCodeString);
}
else
{
@@ -1446,7 +1445,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
if ( sStyleName.Len() > 0 )
aPDFType = sStyleName;
else
- aPDFType = aSpanString;
+ aPDFType = rtl::OUString(aSpanString);
}
}
}
@@ -1454,7 +1453,7 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
case POR_FTN :
nPDFType = vcl::PDFWriter::Link;
- aPDFType = aLinkString;
+ aPDFType = rtl::OUString(aLinkString);
break;
case POR_FLD :
@@ -1471,12 +1470,12 @@ void SwTaggedPDFHelper::BeginInlineStructureElements()
if ( RES_GETREFFLD == pFld->Which() )
{
nPDFType = vcl::PDFWriter::Link;
- aPDFType = aLinkString;
+ aPDFType = rtl::OUString(aLinkString);
}
else if ( RES_AUTHORITY == pFld->Which() )
{
nPDFType = vcl::PDFWriter::BibEntry;
- aPDFType = aBibEntryString;
+ aPDFType = rtl::OUString(aBibEntryString);
}
}
}
commit 92be127772d5daa34c053630909a736bc9572f79
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 28 16:20:19 2012 +0100
unused global OUString
diff --git a/vbahelper/inc/vbahelper/vbahelperinterface.hxx b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
index 7e4875f..b2ca630 100644
--- a/vbahelper/inc/vbahelper/vbahelperinterface.hxx
+++ b/vbahelper/inc/vbahelper/vbahelperinterface.hxx
@@ -61,7 +61,6 @@
// virtual OUString getName();
// }
//
-const ::rtl::OUString sHelperServiceName( RTL_CONSTASCII_USTRINGPARAM( "ooo.vba.HelperServiceBase" ) );
template< typename Ifc1 >
class SAL_DLLPUBLIC_TEMPLATE InheritedHelperInterfaceImpl : public Ifc1
commit 83d3e6e371cde7e455bf74890c55d747fac6992c
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 28 16:19:53 2012 +0100
don't use a global LockListener to avoid startup hit on ctoring
diff --git a/svx/source/gallery2/galexpl.cxx b/svx/source/gallery2/galexpl.cxx
index 45b7b5a..a2c4f02 100644
--- a/svx/source/gallery2/galexpl.cxx
+++ b/svx/source/gallery2/galexpl.cxx
@@ -28,6 +28,7 @@
#include <unotools/pathoptions.hxx>
+#include <rtl/instance.hxx>
#include <sfx2/viewfrm.hxx>
#include "svx/gallery1.hxx"
#include "svx/galtheme.hxx"
@@ -35,11 +36,10 @@
#include "svx/gallery.hxx"
#include "galobj.hxx"
-// -----------
-// - Statics -
-// -----------
-
-static SfxListener aLockListener;
+namespace
+{
+ class theLockListener : public rtl::Static< SfxListener, theLockListener > {};
+}
// -------------------
// - GalleryExplorer -
@@ -371,7 +371,7 @@ sal_Bool GalleryExplorer::BeginLocking( const String& rThemeName )
if( pGal )
{
- GalleryTheme* pTheme = pGal->AcquireTheme( rThemeName, aLockListener );
+ GalleryTheme* pTheme = pGal->AcquireTheme( rThemeName, theLockListener::get() );
if( pTheme )
{
@@ -413,7 +413,7 @@ sal_Bool GalleryExplorer::EndLocking( const String& rThemeName )
if( bReleaseLockedTheme )
{
// release locked theme
- pGal->ReleaseTheme( pTheme, aLockListener );
+ pGal->ReleaseTheme( pTheme, theLockListener::get() );
bRet = sal_True;
}
}
commit 8ae666c4fccb0cfe9d2a36234d0131ba7312f19e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Wed Mar 28 16:18:55 2012 +0100
remove left-over class stub
diff --git a/oox/inc/oox/dump/biffdumper.hxx b/oox/inc/oox/dump/biffdumper.hxx
deleted file mode 100644
index 8409a0b..0000000
--- a/oox/inc/oox/dump/biffdumper.hxx
+++ /dev/null
@@ -1,576 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#ifndef OOX_DUMP_BIFFDUMPER_HXX
-#define OOX_DUMP_BIFFDUMPER_HXX
-
-#include "oox/dump/dumperbase.hxx"
-#include "oox/dump/dffdumper.hxx"
-#include "oox/dump/oledumper.hxx"
-#include "oox/xls/richstring.hxx"
-#include "oox/xls/biffinputstream.hxx"
-
-#if OOX_INCLUDE_DUMPER
-
-namespace oox { namespace xls {
- class BiffInputStream;
- class FontPortionModelList;
- struct FunctionInfo;
- class FunctionProvider;
-} }
-
-namespace oox {
-namespace dump {
-namespace biff {
-
-typedef ::boost::shared_ptr< ::oox::xls::BiffInputStream > BiffInputStreamRef;
-
-// ============================================================================
-// ============================================================================
-
-class BiffDffStreamObject : public DffStreamObject
-{
-public:
- explicit BiffDffStreamObject(
- const OutputObjectBase& rParent,
- const BinaryInputStreamRef& rxStrm );
-
-protected:
- virtual void implDumpClientAnchor();
-};
-
-// ============================================================================
-
-class BiffCtlsStreamObject : public InputObjectBase
-{
-public:
- explicit BiffCtlsStreamObject( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm );
-
- void dumpControl( sal_uInt32 nStartPos, sal_uInt32 nLength );
-
-protected:
- virtual void implDump();
-
-private:
- sal_uInt32 mnStartPos;
- sal_uInt32 mnLength;
-};
-
-// ============================================================================
-// ============================================================================
-
-class BiffConfig : public Config
-{
-public:
- explicit BiffConfig( const Config& rParent, ::oox::xls::BiffType eBiff );
-
-protected:
- virtual bool implIsValid() const;
- virtual NameListRef implGetNameList( const ::rtl::OUString& rKey ) const;
-
-private:
- ::oox::xls::BiffType meBiff;
-};
-
-// ============================================================================
-
-class BiffSharedData : public Base
-{
-public:
- explicit BiffSharedData( ::oox::xls::BiffType eBiff );
-
- void initializePerSheet();
-
- inline ::oox::xls::BiffType getBiff() const { return meBiff; }
-
- inline rtl_TextEncoding getTextEncoding() const { return meTextEnc; }
- void setTextEncoding( rtl_TextEncoding eTextEnc );
-
- sal_uInt16 getFontCount() const;
- rtl_TextEncoding getFontEncoding( sal_uInt16 nFontId ) const;
- void appendFontEncoding( rtl_TextEncoding eFontEnc );
-
- sal_uInt16 getXfCount() const;
- rtl_TextEncoding getXfEncoding( sal_uInt16 nXfId ) const;
- void appendXfFontId( sal_uInt16 nFontId );
-
-protected:
- virtual bool implIsValid() const;
-
-private:
- typedef ::std::vector< rtl_TextEncoding > TextEncVec;
- typedef ::std::vector< sal_uInt16 > FontIdVec;
-
- TextEncVec maFontEncs;
- FontIdVec maXfFontIds;
- ::oox::xls::BiffType meBiff;
- rtl_TextEncoding meTextEnc;
-};
-
-// ============================================================================
-
-class BiffObjectBase : public RecordObjectBase
-{
-public:
- inline BiffSharedData& getBiffData() const { return *mxBiffData; }
- inline ::oox::xls::BiffInputStream& getBiffStream() const { return *mxBiffStrm; }
- inline ::oox::xls::BiffType getBiff() const { return mxBiffData->getBiff(); }
-
-protected:
- inline explicit BiffObjectBase() {}
- virtual ~BiffObjectBase();
-
- using InputObjectBase::construct;
- void construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, ::oox::xls::BiffType eBiff, const ::rtl::OUString& rSysFileName );
- void construct( const BiffObjectBase& rParent );
-
- virtual bool implIsValid() const;
- virtual bool implStartRecord( BinaryInputStream& rBaseStrm, sal_Int64& ornRecPos, sal_Int64& ornRecId, sal_Int64& ornRecSize );
-
- inline sal_uInt16 getLastRecId() const { return mnLastRecId; }
- ::rtl::OUString getErrorName( sal_uInt8 nErrCode ) const;
-
- // ------------------------------------------------------------------------
-
- sal_Int32 readCol( bool bCol16Bit );
- sal_Int32 readRow( bool bRow32Bit );
- void readAddress( Address& orAddress, bool bCol16Bit = true, bool bRow32Bit = false );
- void readRange( Range& orRange, bool bCol16Bit = true, bool bRow32Bit = false );
- void readRangeList( RangeList& orRanges, bool bCol16Bit = true, bool bRow32Bit = false );
-
- // ------------------------------------------------------------------------
-
- void writeBooleanItem( const String& rName, sal_uInt8 nBool );
- void writeErrorCodeItem( const String& rName, sal_uInt8 nErrCode );
-
- void writeFontPortions( const ::oox::xls::FontPortionModelList& rPortions );
-
- template< typename Type >
- void writeRectItem( const String& rName,
- Type nLeft, Type nTop, Type nWidth, Type nHeight,
- const NameListWrapper& rListWrp = NO_LIST,
- FormatType eFmtType = FORMATTYPE_DEC );
-
- // ------------------------------------------------------------------------
-
- ::rtl::OUString dumpByteString(
- const String& rName,
- ::oox::xls::BiffStringFlags nFlags = ::oox::xls::BIFF_STR_DEFAULT,
- rtl_TextEncoding eDefaultTextEnc = RTL_TEXTENCODING_DONTKNOW );
- ::rtl::OUString dumpUniString(
- const String& rName,
- ::oox::xls::BiffStringFlags nFlags = ::oox::xls::BIFF_STR_DEFAULT );
- ::rtl::OUString dumpString(
- const String& rName,
- ::oox::xls::BiffStringFlags nByteFlags = ::oox::xls::BIFF_STR_DEFAULT,
- ::oox::xls::BiffStringFlags nUniFlags = ::oox::xls::BIFF_STR_DEFAULT,
- rtl_TextEncoding eDefaultTextEnc = RTL_TEXTENCODING_DONTKNOW );
-
- ::rtl::OUString dumpSegmentedUniString( const String& rName );
- void dumpSegmentedUniStringArray( const String& rName );
-
- sal_uInt8 dumpBoolean( const String& rName = EMPTY_STRING );
- sal_uInt8 dumpErrorCode( const String& rName = EMPTY_STRING );
-
- rtl_TextEncoding dumpCodePage( const String& rName = EMPTY_STRING );
- void dumpFormulaResult( const String& rName = EMPTY_STRING );
-
- sal_Int32 dumpColIndex( const String& rName = EMPTY_STRING, bool bCol16Bit = true );
- sal_Int32 dumpRowIndex( const String& rName = EMPTY_STRING, bool bRow32Bit = false );
- sal_Int32 dumpColRange( const String& rName = EMPTY_STRING, bool bCol16Bit = true );
- sal_Int32 dumpRowRange( const String& rName = EMPTY_STRING, bool bRow32Bit = false );
-
- Address dumpAddress( const String& rName = EMPTY_STRING, bool bCol16Bit = true, bool bRow32Bit = false );
- Range dumpRange( const String& rName = EMPTY_STRING, bool bCol16Bit = true, bool bRow32Bit = false );
- void dumpRangeList( const String& rName = EMPTY_STRING, bool bCol16Bit = true, bool bRow32Bit = false );
-
- void dumpConstArrayHeader( sal_uInt32& rnCols, sal_uInt32& rnRows );
- ::rtl::OUString dumpConstValue( sal_Unicode cStrQuote = OOX_DUMP_STRQUOTE );
-
- template< typename Type >
- void dumpRect( const String& rName,
- const NameListWrapper& rListWrp = NO_LIST,
- FormatType eFmtType = FORMATTYPE_DEC );
- template< typename Type >
- void dumpRectWithGaps( const String& rName, sal_Int32 nGap,
- const NameListWrapper& rListWrp = NO_LIST,
- FormatType eFmtType = FORMATTYPE_DEC );
-
- sal_uInt16 dumpRepeatedRecId();
- void dumpFrHeader( bool bWithFlags, bool bWithRange );
-
- void dumpDffClientRect();
- void dumpEmbeddedDff();
- void dumpControl();
-
-private:
- typedef ::boost::shared_ptr< BiffSharedData > BiffSharedDataRef;
- typedef ::boost::shared_ptr< BiffDffStreamObject > BiffDffStreamObjRef;
- typedef ::boost::shared_ptr< BiffCtlsStreamObject > BiffCtlsStrmObjRef;
-
- BiffSharedDataRef mxBiffData;
- BiffInputStreamRef mxBiffStrm;
- BiffDffStreamObjRef mxDffObj;
- BiffCtlsStrmObjRef mxCtlsObj;
- NameListRef mxErrCodes;
- NameListRef mxConstType;
- NameListRef mxResultType;
- sal_uInt16 mnLastRecId;
- bool mbMergeContRec;
-};
-
-// ----------------------------------------------------------------------------
-
-template< typename Type >
-void BiffObjectBase::writeRectItem( const String& rName,
- Type nLeft, Type nTop, Type nWidth, Type nHeight,
- const NameListWrapper& rListWrp, FormatType eFmtType )
-{
- MultiItemsGuard aMultiGuard( mxOut );
- writeEmptyItem( rName );
- writeValueItem( "x-pos", nLeft, eFmtType, rListWrp );
- writeValueItem( "y-pos", nTop, eFmtType, rListWrp );
- writeValueItem( "x-size", nWidth, eFmtType, rListWrp );
- writeValueItem( "y-size", nHeight, eFmtType, rListWrp );
-}
-
-template< typename Type >
-void BiffObjectBase::dumpRect( const String& rName,
- const NameListWrapper& rListWrp, FormatType eFmtType )
-{
- Type nLeft, nTop, nWidth, nHeight;
- *mxBiffStrm >> nLeft >> nTop >> nWidth >> nHeight;
- writeRectItem( rName, nLeft, nTop, nWidth, nHeight, rListWrp, eFmtType );
-}
-
-template< typename Type >
-void BiffObjectBase::dumpRectWithGaps( const String& rName, sal_Int32 nGap,
- const NameListWrapper& rListWrp, FormatType eFmtType )
-{
- Type nLeft, nTop, nWidth, nHeight;
- *mxBiffStrm >> nLeft;
- mxBiffStrm->skip( nGap );
- *mxBiffStrm >> nTop;
- mxBiffStrm->skip( nGap );
- *mxBiffStrm >> nWidth;
- mxBiffStrm->skip( nGap );
- *mxBiffStrm >> nHeight;
- mxBiffStrm->skip( nGap );
- writeRectItem( rName, nLeft, nTop, nWidth, nHeight, rListWrp, eFmtType );
-}
-
-// ============================================================================
-// ============================================================================
-
-class FormulaObject : public BiffObjectBase
-{
-public:
- explicit FormulaObject( const BiffObjectBase& rParent );
- virtual ~FormulaObject();
-
- sal_uInt16 readFormulaSize();
- sal_uInt16 dumpFormulaSize( const String& rName = EMPTY_STRING );
-
- void dumpCellFormula( const String& rName, sal_uInt16 nSize );
- void dumpCellFormula( const String& rName = EMPTY_STRING );
- void dumpNameFormula( const String& rName, sal_uInt16 nSize );
- void dumpNameFormula( const String& rName = EMPTY_STRING );
-
-protected:
- virtual void implDump();
-
-private:
- void constructFmlaObj();
-
- void dumpFormula( const String& rName, sal_uInt16 nSize, bool bNameMode );
- void dumpFormula( const String& rName, bool bNameMode );
-
- TokenAddress createTokenAddress( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelC, bool bRelR, bool bNameMode ) const;
- ::rtl::OUString createRef( const ::rtl::OUString& rData ) const;
- ::rtl::OUString createName( sal_uInt16 nNameIdx ) const;
- ::rtl::OUString createPlaceHolder( size_t nIdx ) const;
- ::rtl::OUString createPlaceHolder() const;
-
- sal_uInt16 readFuncId();
- ::rtl::OUString writeFuncIdItem( sal_uInt16 nFuncId, const ::oox::xls::FunctionInfo** oppFuncInfo = 0 );
-
- sal_uInt16 dumpTokenCol( const String& rName, bool& rbRelC, bool& rbRelR );
- sal_uInt16 dumpTokenRow( const String& rName, bool& rbRelC, bool& rbRelR );
- TokenAddress dumpTokenAddress( bool bNameMode );
- TokenRange dumpTokenRange( bool bNameMode );
-
- sal_Int16 readTokenRefIdx();
- ::rtl::OUString dumpTokenRefIdx();
- ::rtl::OUString dumpTokenRefTabIdxs();
-
- void dumpIntToken();
- void dumpDoubleToken();
- void dumpStringToken();
- void dumpBoolToken();
- void dumpErrorToken();
- void dumpMissArgToken();
-
- void dumpArrayToken( const ::rtl::OUString& rTokClass );
- void dumpNameToken( const ::rtl::OUString& rTokClass );
- void dumpNameXToken( const ::rtl::OUString& rTokClass );
- void dumpRefToken( const ::rtl::OUString& rTokClass, bool bNameMode );
- void dumpAreaToken( const ::rtl::OUString& rTokClass, bool bNameMode );
- void dumpRefErrToken( const ::rtl::OUString& rTokClass, bool bArea );
- void dumpRef3dToken( const ::rtl::OUString& rTokClass, bool bNameMode );
- void dumpArea3dToken( const ::rtl::OUString& rTokClass, bool bNameMode );
- void dumpRefErr3dToken( const ::rtl::OUString& rTokClass, bool bArea );
- void dumpMemFuncToken( const ::rtl::OUString& rTokClass );
- void dumpMemAreaToken( const ::rtl::OUString& rTokClass, bool bAddData );
-
- void dumpExpToken( const String& rName );
- void dumpUnaryOpToken( const String& rLOp, const String& rROp );
- void dumpBinaryOpToken( const String& rOp );
- void dumpFuncToken( const ::rtl::OUString& rTokClass );
- void dumpFuncVarToken( const ::rtl::OUString& rTokClass );
- void dumpCmdToken( const ::rtl::OUString& rTokClass );
-
- void dumpSheetToken();
- void dumpEndSheetToken();
- bool dumpAttrToken();
-
- bool dumpNlrToken();
- void dumpNlrErrToken();
- void dumpNlrColRowToken( const ::rtl::OUString& rTokClass, bool bAddData );
- void dumpNlrRangeToken( const ::rtl::OUString& rTokClass, bool bAddData );
- void dumpNlrRangeErrToken();
-
- void dumpAddTokenData();
- void dumpAddDataNlr( size_t nIdx );
- void dumpAddDataArray( size_t nIdx );
- void dumpAddDataMemArea( size_t nIdx );
-
-private:
- enum AddDataType { ADDDATA_NLR, ADDDATA_ARRAY, ADDDATA_MEMAREA };
-
- typedef ::boost::shared_ptr< FormulaStack > FormulaStackRef;
- typedef ::boost::shared_ptr< ::oox::xls::FunctionProvider > FuncProvRef;
- typedef ::std::vector< AddDataType > AddDataTypeVec;
-
- NameListRef mxTokens;
- NameListRef mxClasses;
- NameListRef mxRelFlags;
- NameListRef mxNlrTypes;
- NameListRef mxAttrTypes;
- NameListRef mxSpTypes;
- sal_Int32 mnColCount;
- sal_Int32 mnRowCount;
-
- FormulaStackRef mxStack;
- FuncProvRef mxFuncProv;
- AddDataTypeVec maAddData;
- ::rtl::OUString maRefPrefix;
- ::rtl::OUString maName;
- sal_uInt16 mnSize;
- bool mbNameMode;
-};
-
-// ============================================================================
-// ============================================================================
-
-class RecordStreamObject : public BiffObjectBase
-{
-protected:
- inline explicit RecordStreamObject() {}
- virtual ~RecordStreamObject();
-
- using BiffObjectBase::construct;
- void construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, ::oox::xls::BiffType eBiff, const ::rtl::OUString& rSysFileName );
-
- virtual bool implIsValid() const;
-
- inline FormulaObject& getFormulaDumper() const { return *mxFmlaObj; }
-
-private:
- typedef ::boost::shared_ptr< FormulaObject > FormulaObjectRef;
- FormulaObjectRef mxFmlaObj;
-};
-
-// ============================================================================
-
-class WorkbookStreamObject : public RecordStreamObject
-{
-public:
- explicit WorkbookStreamObject( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const ::rtl::OUString& rSysFileName );
- virtual ~WorkbookStreamObject();
-
-protected:
- virtual void implDumpRecordBody();
-
-private:
- void initializePerSheet();
-
- ::rtl::OUString createFontName( const ::rtl::OUString& rName, sal_uInt16 nHeight, bool bBold, bool bItalic ) const;
-
- sal_uInt16 dumpPatternIdx( const String& rName = EMPTY_STRING, bool b16Bit = true );
- sal_uInt16 dumpColorIdx( const String& rName = EMPTY_STRING, bool b16Bit = true );
- sal_uInt16 dumpFontIdx( const String& rName = EMPTY_STRING, bool b16Bit = true );
- sal_uInt16 dumpFormatIdx( const String& rName = EMPTY_STRING );
- sal_uInt16 dumpXfIdx( const String& rName = EMPTY_STRING, bool bBiff2Style = false );
-
- template< typename Type >
- inline Type dumpExtColorType() { return dumpDec< Type >( "color-type", "EXTCOLOR-TYPE" ); }
- void dumpExtColorValue( sal_uInt32 nColorType );
- void dumpExtColor( const String& rName = EMPTY_STRING );
- void dumpExtCfColor( const String& rName = EMPTY_STRING );
- void dumpExtGradientHead();
-
- sal_uInt8 dumpFilterColumnOperator( const String& rName );
-
- ::rtl::OUString dumpPivotString( const String& rName, sal_uInt16 nStrLen );
- ::rtl::OUString dumpPivotString( const String& rName );
-
- sal_uInt16 dumpCellHeader( bool bBiff2Style = false );
- void dumpBoolErr();
-
- void dumpCfRuleProp();
- void dumpXfExtProp();
- void dumpDxfProp();
- void dumpDxf12Prop();
- void dumpCfRule12Param( sal_uInt16 nSubType );
-
- void dumpFontRec();
- void dumpFormatRec();
- void dumpXfRec();
-
- void dumpObjRec();
- void dumpObjRecBiff3();
- void dumpObjRecBiff4();
- void dumpObjRecBiff5();
- void dumpObjRecBiff8();
-
- void dumpObjRecLineData();
- void dumpObjRecFillData();
- void dumpObjRecRectData();
- void dumpObjRecTextDataBiff3( sal_uInt16& ornTextLen, sal_uInt16& ornFormatSize );
- void dumpObjRecTextDataBiff5( sal_uInt16& ornTextLen, sal_uInt16& ornFormatSize, sal_uInt16& ornLinkSize );
- void dumpObjRecSbsData();
- void dumpObjRecGboData();
- void dumpObjRecEdoData();
- void dumpObjRecRboData();
- void dumpObjRecCblsData();
- void dumpObjRecLbsData();
-
- void dumpObjRecPadding();
- void dumpObjRecString( const String& rName, sal_uInt16 nTextLen, bool bRepeatLen );
- void dumpObjRecTextFmt( sal_uInt16 nFormatSize );
- void dumpObjRecFmlaRaw();
- void dumpObjRecFmla( const String& rName, sal_uInt16 nFmlaSize );
- void dumpObjRecPictFmla( sal_uInt16 nFmlaSize );
-
- typedef ::std::pair< sal_uInt8, ::rtl::OUString > ChFrExtPropInfo;
-
- void dumpChFrExtProps();
- ChFrExtPropInfo dumpChFrExtPropHeader();
-
-private:
- NameListRef mxColors;
- NameListRef mxBorderStyles;
- NameListRef mxFillPatterns;
- NameListRef mxFontNames;
- NameListRef mxFormats;
- sal_uInt16 mnFormatIdx;
- sal_uInt16 mnPTRowFields;
- sal_uInt16 mnPTColFields;
- sal_uInt16 mnPTRowColItemsIdx;
- bool mbHasCodePage;
- bool mbHasDff;
-};
-
-// ============================================================================
-
-class PivotCacheStreamObject : public RecordStreamObject
-{
-public:
- explicit PivotCacheStreamObject(
- const ObjectBase& rParent,
- const BinaryInputStreamRef& rxStrm,
- ::oox::xls::BiffType eBiff,
- const ::rtl::OUString& rSysFileName );
-
-protected:
- virtual void implDumpRecordBody();
-};
-
-// ============================================================================
-// ============================================================================
-
-class RootStorageObject : public OleStorageObject
-{
-public:
- explicit RootStorageObject( const DumperBase& rParent );
-
-protected:
- virtual void implDumpStream(
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxStrm,
- const ::rtl::OUString& rStrgPath,
- const ::rtl::OUString& rStrmName,
- const ::rtl::OUString& rSysFileName );
-
- virtual void implDumpStorage(
- const StorageRef& rxStrg,
- const ::rtl::OUString& rStrgPath,
- const ::rtl::OUString& rSysPath );
-
- virtual void implDumpBaseStream(
- const BinaryInputStreamRef& rxStrm,
- const ::rtl::OUString& rSysFileName );
-};
-
-// ============================================================================
-// ============================================================================
-
-class Dumper : public DumperBase
-{
-public:
- explicit Dumper( const ::oox::core::FilterBase& rFilter );
-
- explicit Dumper(
- const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& rxContext,
- const ::com::sun::star::uno::Reference< ::com::sun::star::io::XInputStream >& rxInStrm,
- const ::rtl::OUString& rSysFileName );
-
-protected:
- virtual void implDump();
-};
-
-// ============================================================================
-// ============================================================================
-
-} // namespace biff
-} // namespace dump
-} // namespace oox
-
-#endif
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/oox/inc/oox/dump/dumperbase.hxx b/oox/inc/oox/dump/dumperbase.hxx
index 68a4848..77d2710 100644
--- a/oox/inc/oox/dump/dumperbase.hxx
+++ b/oox/inc/oox/dump/dumperbase.hxx
@@ -476,35 +476,6 @@ static const String EMPTY_STRING;
// ============================================================================
// ============================================================================
-/** Stack to create a human readable formula string from a UPN token array. */
-class FormulaStack
-{
-public:
- inline const ::rtl::OUString& getFormulaString() const { return getString( maFmlaStack ); }
- inline const ::rtl::OUString& getClassesString() const { return getString( maClassStack ); }
-
- void pushOperand( const String& rOp, const ::rtl::OUString& rTokClass );
-
- inline void setError() { mbError = true; }
-
-private:
- typedef ::std::stack< ::rtl::OUString > StringStack;
-
- inline bool check( bool bCond ) { return (mbError |= !bCond) == false; }
-
- void pushUnaryOp( StringStack& rStack, const ::rtl::OUString& rLOp, const ::rtl::OUString& rROp );
- void pushBinaryOp( StringStack& rStack, const ::rtl::OUString& rOp );
- void pushFuncOp( StringStack& rStack, const ::rtl::OUString& rOp, sal_uInt8 nParamCount );
-
-private:
- StringStack maFmlaStack;
- StringStack maClassStack;
- bool mbError;
-};
-
-// ============================================================================
-// ============================================================================
-
class Base;
typedef ::boost::shared_ptr< Base > BaseRef;
diff --git a/oox/inc/oox/dump/xlsbdumper.hxx b/oox/inc/oox/dump/xlsbdumper.hxx
index 3b3afb5..75ec245 100644
--- a/oox/inc/oox/dump/xlsbdumper.hxx
+++ b/oox/inc/oox/dump/xlsbdumper.hxx
@@ -104,121 +104,6 @@ private:
// ============================================================================
-class FormulaObject : public RecordObjectBase
-{
-public:
- explicit FormulaObject( const RecordObjectBase& rParent );
- virtual ~FormulaObject();
-
- void dumpCellFormula( const String& rName = EMPTY_STRING );
- void dumpNameFormula( const String& rName = EMPTY_STRING );
-
-protected:
- virtual void implDump();
-
-private:
- void constructFmlaObj();
-
- void dumpFormula( const String& rName, bool bNameMode );
-
- TokenAddress createTokenAddress( sal_Int32 nCol, sal_Int32 nRow, bool bRelC, bool bRelR, bool bNameMode ) const;
- ::rtl::OUString createRef( const ::rtl::OUString& rData ) const;
- ::rtl::OUString createName( sal_Int32 nNameId ) const;
- ::rtl::OUString createPlaceHolder( size_t nIdx ) const;
- ::rtl::OUString createPlaceHolder() const;
-
- ::rtl::OUString writeFuncIdItem( sal_uInt16 nFuncId, const ::oox::xls::FunctionInfo** oppFuncInfo = 0 );
-
- sal_Int32 dumpTokenCol( const String& rName, bool& rbRelC, bool& rbRelR );
- sal_Int32 dumpTokenRow( const String& rName );
- TokenAddress dumpTokenAddress( bool bNameMode );
- TokenRange dumpTokenRange( bool bNameMode );
-
- sal_Int16 readTokenRefId();
- ::rtl::OUString dumpTokenRefId();
-
- void dumpIntToken();
- void dumpDoubleToken();
- void dumpStringToken();
- void dumpBoolToken();
- void dumpErrorToken();
- void dumpMissArgToken();
-
- void dumpArrayToken( const ::rtl::OUString& rTokClass );
- void dumpNameToken( const ::rtl::OUString& rTokClass );
- void dumpNameXToken( const ::rtl::OUString& rTokClass );
- void dumpRefToken( const ::rtl::OUString& rTokClass, bool bNameMode );
- void dumpAreaToken( const ::rtl::OUString& rTokClass, bool bNameMode );
- void dumpRefErrToken( const ::rtl::OUString& rTokClass, bool bArea );
- void dumpRef3dToken( const ::rtl::OUString& rTokClass, bool bNameMode );
- void dumpArea3dToken( const ::rtl::OUString& rTokClass, bool bNameMode );
- void dumpRefErr3dToken( const ::rtl::OUString& rTokClass, bool bArea );
- void dumpMemFuncToken( const ::rtl::OUString& rTokClass );
- void dumpMemAreaToken( const ::rtl::OUString& rTokClass, bool bAddData );
-
- void dumpExpToken( const String& rName );
- void dumpUnaryOpToken( const String& rLOp, const String& rROp );
- void dumpBinaryOpToken( const String& rOp );
- void dumpFuncToken( const ::rtl::OUString& rTokClass );
- void dumpFuncVarToken( const ::rtl::OUString& rTokClass );
- bool dumpTableToken();
- bool dumpAttrToken();
-
- void dumpAddTokenData();
- void dumpAddDataExp( size_t nIdx );
- void dumpAddDataArray( size_t nIdx );
- void dumpAddDataMemArea( size_t nIdx );
-
- void dumpaddDataArrayHeader( sal_Int32& rnCols, sal_Int32& rnRows );
- ::rtl::OUString dumpaddDataArrayValue();
-
-private:
- enum AddDataType { ADDDATA_EXP, ADDDATA_ARRAY, ADDDATA_MEMAREA };
-
- typedef ::boost::shared_ptr< FormulaStack > FormulaStackRef;
- typedef ::boost::shared_ptr< ::oox::xls::FunctionProvider > FuncProvRef;
- typedef ::std::vector< AddDataType > AddDataTypeVec;
-
- NameListRef mxTokens;
- NameListRef mxClasses;
- NameListRef mxRelFlags;
- NameListRef mxAttrTypes;
- NameListRef mxSpTypes;
- sal_Int32 mnColCount;
- sal_Int32 mnRowCount;
-
- FormulaStackRef mxStack;
- FuncProvRef mxFuncProv;
- AddDataTypeVec maAddData;
- ::rtl::OUString maRefPrefix;
- ::rtl::OUString maName;
- sal_Int32 mnSize;
- bool mbNameMode;
-};
-
-// ============================================================================
-
-class RecordStreamObject : public RecordObjectBase
-{
-public:
- explicit RecordStreamObject( ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, const ::rtl::OUString& rSysFileName );
-
-protected:
- virtual bool implIsValid() const;
- virtual void implDumpRecordBody();
-
-private:
- void dumpGradientHead();
- void dumpCellHeader( bool bWithColumn );
-
-private:
- typedef ::boost::shared_ptr< FormulaObject > FormulaObjectRef;
-
- FormulaObjectRef mxFmlaObj;
-};
-
-// ============================================================================
-
class RootStorageObject : public StorageObjectBase
{
public:
diff --git a/oox/source/dump/biffdumper.cxx b/oox/source/dump/biffdumper.cxx
deleted file mode 100644
index 6dbc2eb..0000000
--- a/oox/source/dump/biffdumper.cxx
+++ /dev/null
@@ -1,4591 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*************************************************************************
- *
- * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
- *
- * Copyright 2000, 2010 Oracle and/or its affiliates.
- *
- * OpenOffice.org - a multi-platform office productivity suite
- *
- * This file is part of OpenOffice.org.
- *
- * OpenOffice.org is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License version 3
- * only, as published by the Free Software Foundation.
- *
- * OpenOffice.org is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License version 3 for more details
- * (a copy is included in the LICENSE file that accompanied this code).
- *
- * You should have received a copy of the GNU Lesser General Public License
- * version 3 along with OpenOffice.org. If not, see
- * <http://www.openoffice.org/license.html>
- * for a copy of the LGPLv3 License.
- *
- ************************************************************************/
-
-#include "oox/dump/biffdumper.hxx"
-
-#include <osl/thread.h>
-#include <rtl/tencinfo.h>
-#include "oox/core/filterbase.hxx"
-#include "oox/dump/oledumper.hxx"
-#include "oox/ole/olestorage.hxx"
-#include "oox/xls/biffdetector.hxx"
-#include "oox/xls/biffinputstream.hxx"
-#include "oox/xls/formulabase.hxx"
-
-#if OOX_INCLUDE_DUMPER
-
-namespace oox {
-namespace dump {
-namespace biff {
-
-// ============================================================================
-
-using namespace ::com::sun::star::io;
-using namespace ::com::sun::star::lang;
-using namespace ::com::sun::star::uno;
-using namespace ::com::sun::star::util;
-using namespace ::oox::xls;
-
-using ::comphelper::MediaDescriptor;
-using ::oox::core::FilterBase;
-using ::rtl::OString;
-using ::rtl::OStringBuffer;
-using ::rtl::OStringToOUString;
-using ::rtl::OUString;
-using ::rtl::OUStringBuffer;
-
-// ============================================================================
-
-namespace {
-
-// constants ------------------------------------------------------------------
-
-const sal_uInt16 BIFF_FONTFLAG_BOLD = 0x0001;
-const sal_uInt16 BIFF_FONTFLAG_ITALIC = 0x0002;
-
-const sal_uInt16 BIFF_OBJTYPE_GROUP = 0;
-const sal_uInt16 BIFF_OBJTYPE_LINE = 1;
-const sal_uInt16 BIFF_OBJTYPE_RECTANGLE = 2;
-const sal_uInt16 BIFF_OBJTYPE_OVAL = 3;
-const sal_uInt16 BIFF_OBJTYPE_ARC = 4;
-const sal_uInt16 BIFF_OBJTYPE_CHART = 5;
-const sal_uInt16 BIFF_OBJTYPE_TEXT = 6;
-const sal_uInt16 BIFF_OBJTYPE_BUTTON = 7;
-const sal_uInt16 BIFF_OBJTYPE_PICTURE = 8;
-const sal_uInt16 BIFF_OBJTYPE_POLYGON = 9;
-const sal_uInt16 BIFF_OBJTYPE_CHECKBOX = 11;
-const sal_uInt16 BIFF_OBJTYPE_OPTIONBUTTON = 12;
-const sal_uInt16 BIFF_OBJTYPE_EDIT = 13;
-const sal_uInt16 BIFF_OBJTYPE_LABEL = 14;
-const sal_uInt16 BIFF_OBJTYPE_DIALOG = 15;
-const sal_uInt16 BIFF_OBJTYPE_SPIN = 16;
-const sal_uInt16 BIFF_OBJTYPE_SCROLLBAR = 17;
-const sal_uInt16 BIFF_OBJTYPE_LISTBOX = 18;
-const sal_uInt16 BIFF_OBJTYPE_GROUPBOX = 19;
-const sal_uInt16 BIFF_OBJTYPE_DROPDOWN = 20;
-const sal_uInt16 BIFF_OBJTYPE_NOTE = 25;
-const sal_uInt16 BIFF_OBJTYPE_DRAWING = 30;
-
-const sal_uInt16 BIFF_OBJFLAGS_CONTROL = 0x0010; /// Form control.
-const sal_uInt16 BIFF_OBJFLAGS_CTLSSTREAM = 0x0020; /// Data in Ctls stream.
-
-const sal_uInt16 BIFF_STYLE_BUILTIN = 0x8000;
-
-const sal_uInt16 BIFF_PT_NOSTRING = 0xFFFF;
-
-// ----------------------------------------------------------------------------
-
-void lclDumpDffClientPos( const OutputRef& rxOut, const BinaryInputStreamRef& rxStrm, const String& rName, sal_uInt16 nSubScale )
-{
- MultiItemsGuard aMultiGuard( rxOut );
- TableGuard aTabGuard( rxOut, 17 );
- {
- sal_uInt16 nPos = rxStrm->readuInt16();
- ItemGuard aItem( rxOut, rName );
- rxOut->writeDec( nPos );
- }
- {
- sal_uInt16 nSubUnits = rxStrm->readuInt16();
- ItemGuard aItem( rxOut, "sub-units" );
- rxOut->writeDec( nSubUnits );
- rxOut->writeChar( '/' );
- rxOut->writeDec( nSubScale );
- }
-}
-
-void lclDumpDffClientRect( const OutputRef& rxOut, const BinaryInputStreamRef& rxStrm )
-{
- lclDumpDffClientPos( rxOut, rxStrm, "start-col", 1024 );
- lclDumpDffClientPos( rxOut, rxStrm, "start-row", 256 );
- lclDumpDffClientPos( rxOut, rxStrm, "end-col", 1024 );
- lclDumpDffClientPos( rxOut, rxStrm, "end-row", 256 );
-}
-
-} // namespace
-
-// ============================================================================
-// ============================================================================
-
-BiffDffStreamObject::BiffDffStreamObject( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm )
-{
- DffStreamObject::construct( rParent, rxStrm );
-}
-
-void BiffDffStreamObject::implDumpClientAnchor()
-{
- dumpHex< sal_uInt16 >( "flags", "DFF-CLIENTANCHOR-FLAGS" );
- lclDumpDffClientRect( mxOut, mxStrm );
-}
-
-// ============================================================================
-
-BiffCtlsStreamObject::BiffCtlsStreamObject( const OutputObjectBase& rParent, const BinaryInputStreamRef& rxStrm )
-{
- InputObjectBase::construct( rParent, rxStrm );
- mnStartPos = mnLength = 0;
-}
-
-void BiffCtlsStreamObject::dumpControl( sal_uInt32 nStartPos, sal_uInt32 nLength )
-{
- mnStartPos = nStartPos;
- mnLength = nLength;
- dump();
- mnStartPos = mnLength = 0;
-}
-
-void BiffCtlsStreamObject::implDump()
-{
- if( mnLength > 0 )
- {
- mxOut->emptyLine();
- writeEmptyItem( "CTLS-START" );
- {
- IndentGuard aIndGuard( mxOut );
- mxStrm->seek( mnStartPos );
- BinaryInputStreamRef xRelStrm( new RelativeInputStream( *mxStrm, mnLength ) );
- FormControlStreamObject( *this, xRelStrm ).dump();
- }
- writeEmptyItem( "CTLS-END" );
- mxOut->emptyLine();
- }
-}
-
-// ============================================================================
-// ============================================================================
-
-BiffConfig::BiffConfig( const Config& rParent, BiffType eBiff ) :
- meBiff( eBiff )
-{
- Config::construct( rParent );
-}
-
-bool BiffConfig::implIsValid() const
-{
- return (meBiff != BIFF_UNKNOWN) && Config::implIsValid();
-}
-
-NameListRef BiffConfig::implGetNameList( const OUString& rKey ) const
-{
- NameListRef xList = Config::implGetNameList( rKey );
- if( !xList )
- {
- OUString aBaseKey = rKey + CREATE_OUSTRING( "-BIFF" );
- switch( meBiff )
- {
- // fall-through intended!
- case BIFF8: if( !xList ) xList = Config::implGetNameList( aBaseKey + OUString( sal_Unicode( '8' ) ) );
- case BIFF5: if( !xList ) xList = Config::implGetNameList( aBaseKey + OUString( sal_Unicode( '5' ) ) );
- case BIFF4: if( !xList ) xList = Config::implGetNameList( aBaseKey + OUString( sal_Unicode( '4' ) ) );
- case BIFF3: if( !xList ) xList = Config::implGetNameList( aBaseKey + OUString( sal_Unicode( '3' ) ) );
- case BIFF2: if( !xList ) xList = Config::implGetNameList( aBaseKey + OUString( sal_Unicode( '2' ) ) );
- case BIFF_UNKNOWN: break;
- }
- }
- return xList;
-}
-
-// ============================================================================
-
-BiffSharedData::BiffSharedData( BiffType eBiff ) :
- meBiff( eBiff ),
- meTextEnc( osl_getThreadTextEncoding() )
-{
-}
-
-void BiffSharedData::initializePerSheet()
-{
- maFontEncs.clear();
- maXfFontIds.clear();
- meTextEnc = osl_getThreadTextEncoding();
-}
-
-void BiffSharedData::setTextEncoding( rtl_TextEncoding eTextEnc )
-{
- if( eTextEnc != RTL_TEXTENCODING_DONTKNOW )
- meTextEnc = eTextEnc;
-}
-
-sal_uInt16 BiffSharedData::getFontCount() const
-{
- return static_cast< sal_uInt16 >( maFontEncs.size() );
-}
-
-rtl_TextEncoding BiffSharedData::getFontEncoding( sal_uInt16 nFontId ) const
-{
- return (nFontId < getFontCount()) ? maFontEncs[ nFontId ] : meTextEnc;
-}
-
-void BiffSharedData::appendFontEncoding( rtl_TextEncoding eFontEnc )
-{
- maFontEncs.push_back( (eFontEnc == RTL_TEXTENCODING_DONTKNOW) ? meTextEnc : eFontEnc );
- if( maFontEncs.size() == 4 )
- maFontEncs.push_back( meTextEnc );
-}
-
-sal_uInt16 BiffSharedData::getXfCount() const
-{
- return static_cast< sal_uInt16 >( maXfFontIds.size() );
-}
-
-rtl_TextEncoding BiffSharedData::getXfEncoding( sal_uInt16 nXfId ) const
-{
- sal_uInt16 nFontId = (nXfId < getXfCount()) ? maXfFontIds[ nXfId ] : 0;
- return getFontEncoding( nFontId );
-}
-
-void BiffSharedData::appendXfFontId( sal_uInt16 nFontId )
-{
- maXfFontIds.push_back( nFontId );
-}
-
-bool BiffSharedData::implIsValid() const
-{
- return meBiff != BIFF_UNKNOWN;
-}
-
-// ============================================================================
-
-BiffObjectBase::~BiffObjectBase()
-{
-}
-
-void BiffObjectBase::construct( const ObjectBase& rParent, const BinaryInputStreamRef& rxStrm, BiffType eBiff, const OUString& rSysFileName )
-{
- if( rParent.isValid() && rxStrm.get() && (eBiff != BIFF_UNKNOWN) )
- {
- mxBiffData.reset( new BiffSharedData( eBiff ) );
- mxBiffStrm.reset( new BiffInputStream( *rxStrm ) );
- RecordObjectBase::construct( rParent, rxStrm, rSysFileName, mxBiffStrm, "RECORD-NAMES", "SIMPLE-RECORDS" );
- if( RecordObjectBase::implIsValid() )
- {
- reconstructConfig( ConfigRef( new BiffConfig( cfg(), eBiff ) ) );
- mxDffObj.reset( new BiffDffStreamObject( *this, mxBiffStrm ) );
- if( StorageBase* pRootStrg = cfg().getRootStorage().get() )
- {
- BinaryInputStreamRef xCtlsStrm( new BinaryXInputStream( pRootStrg->openInputStream( CREATE_OUSTRING( "Ctls" ) ), true ) );
- mxCtlsObj.reset( new BiffCtlsStreamObject( *this, xCtlsStrm ) );
- }
- const Config& rCfg = cfg();
- mxErrCodes = rCfg.getNameList( "ERRORCODES" );
- mxConstType = rCfg.getNameList( "CONSTVALUE-TYPE" );
- mxResultType = rCfg.getNameList( "FORMULA-RESULTTYPE" );
- mnLastRecId = BIFF_ID_UNKNOWN;
- mbMergeContRec = rCfg.getBoolOption( "merge-continue-record", true );
- }
- }
-}
-
-void BiffObjectBase::construct( const BiffObjectBase& rParent )
-{
- *this = rParent;
-}
-
-bool BiffObjectBase::implIsValid() const
-{
- return isValid( mxBiffData ) && mxBiffStrm.get() && isValid( mxDffObj ) && InputObjectBase::implIsValid();
-}
-
-bool BiffObjectBase::implStartRecord( BinaryInputStream&, sal_Int64& ornRecPos, sal_Int64& ornRecId, sal_Int64& ornRecSize )
-{
- // previous record
- mnLastRecId = mxBiffStrm->getRecId();
- switch( mnLastRecId )
- {
- case BIFF_ID_CHBEGIN:
- mxOut->incIndent();
- break;
- }
-
- // start next record
- bool bValid = mxBiffStrm->startNextRecord();
- ornRecPos = mxBiffStrm->tellBase() - 4;
- ornRecId = mxBiffStrm->getRecId();
-
- // special CONTINUE handling
- mxBiffStrm->resetRecord( mbMergeContRec );
- if( mbMergeContRec ) switch( mxBiffStrm->getRecId() )
- {
- case BIFF_ID_OBJ:
- case BIFF_ID_TXO:
- case BIFF_ID_EOF:
- case BIFF_ID_CONT:
- mxBiffStrm->resetRecord( false );
- break;
- case BIFF_ID_MSODRAWINGGROUP:
- case BIFF_ID_CHESCHERFORMAT:
- mxBiffStrm->resetRecord( true, mxBiffStrm->getRecId() );
- break;
- }
-
- // record specific settings
- switch( mxBiffStrm->getRecId() )
- {
- case BIFF2_ID_BOF:
- case BIFF3_ID_BOF:
- case BIFF4_ID_BOF:
- case BIFF5_ID_BOF:
- case BIFF_ID_INTERFACEHDR:
- mxBiffStrm->enableDecoder( false );
- break;
- case BIFF_ID_CHEND:
- mxOut->decIndent();
- break;
- }
-
- ornRecSize = mxBiffStrm->size();
- return bValid;
-}
-
-OUString BiffObjectBase::getErrorName( sal_uInt8 nErrCode ) const
-{
- return cfg().getName( mxErrCodes, nErrCode );
-}
-
-// ----------------------------------------------------------------------------
-
-sal_Int32 BiffObjectBase::readCol( bool bCol16Bit )
-{
- return bCol16Bit ? mxBiffStrm->readuInt16() : mxBiffStrm->readuInt8();
-}
-
-sal_Int32 BiffObjectBase::readRow( bool bRow32Bit )
-{
- return bRow32Bit ? mxBiffStrm->readInt32() : mxBiffStrm->readuInt16();
-}
-
-void BiffObjectBase::readAddress( Address& orAddress, bool bCol16Bit, bool bRow32Bit )
-{
- orAddress.mnRow = readRow( bRow32Bit );
- orAddress.mnCol = readCol( bCol16Bit );
-}
-
-void BiffObjectBase::readRange( Range& orRange, bool bCol16Bit, bool bRow32Bit )
-{
- orRange.maFirst.mnRow = readRow( bRow32Bit );
- orRange.maLast.mnRow = readRow( bRow32Bit );
- orRange.maFirst.mnCol = readCol( bCol16Bit );
- orRange.maLast.mnCol = readCol( bCol16Bit );
-}
-
-void BiffObjectBase::readRangeList( RangeList& orRanges, bool bCol16Bit, bool bRow32Bit )
-{
- sal_uInt16 nCount;
- *mxBiffStrm >> nCount;
- orRanges.resize( nCount );
- for( RangeList::iterator aIt = orRanges.begin(), aEnd = orRanges.end(); !mxBiffStrm->isEof() && (aIt != aEnd); ++aIt )
- readRange( *aIt, bCol16Bit, bRow32Bit );
-}
-
-// ----------------------------------------------------------------------------
-
-void BiffObjectBase::writeBooleanItem( const String& rName, sal_uInt8 nBool )
-{
- writeDecItem( rName, nBool, "BOOLEAN" );
-}
-
-void BiffObjectBase::writeErrorCodeItem( const String& rName, sal_uInt8 nErrCode )
-{
- writeHexItem( rName, nErrCode, mxErrCodes );
-}
-
-void BiffObjectBase::writeFontPortions( const FontPortionModelList& rPortions )
-{
- if( !rPortions.empty() )
- {
- writeDecItem( "font-count", static_cast< sal_uInt32 >( rPortions.size() ) );
- TableGuard aTabGuard( mxOut, 14 );
- for( FontPortionModelList::const_iterator aIt = rPortions.begin(), aEnd = rPortions.end(); aIt != aEnd; ++aIt )
- {
- MultiItemsGuard aMultiGuard( mxOut );
- writeDecItem( "char-pos", aIt->mnPos );
- writeDecItem( "font-idx", aIt->mnFontId, "FONTNAMES" );
- }
- }
-}
-
-// ----------------------------------------------------------------------------
-
-OUString BiffObjectBase::dumpByteString( const String& rName, BiffStringFlags nFlags, rtl_TextEncoding eDefaultTextEnc )
-{
- OSL_ENSURE( !getFlag( nFlags, static_cast< BiffStringFlags >( ~(BIFF_STR_8BITLENGTH | BIFF_STR_EXTRAFONTS) ) ), "BiffObjectBase::dumpByteString - unknown flag" );
- bool b8BitLength = getFlag( nFlags, BIFF_STR_8BITLENGTH );
-
- OString aString = mxBiffStrm->readByteString( !b8BitLength, true );
- FontPortionModelList aPortions;
- if( getFlag( nFlags, BIFF_STR_EXTRAFONTS ) )
- aPortions.importPortions( *mxBiffStrm, false );
-
- // create string portions
- OUStringBuffer aBuffer;
- sal_Int32 nStrLen = aString.getLength();
- if( nStrLen > 0 )
- {
- // add leading and trailing string position to ease the following loop
- if( aPortions.empty() || (aPortions.front().mnPos > 0) )
- aPortions.insert( aPortions.begin(), FontPortionModel( 0, -1 ) );
- if( aPortions.back().mnPos < nStrLen )
- aPortions.push_back( FontPortionModel( nStrLen, -1 ) );
-
- // use global text encoding, if nothing special is specified
- if( eDefaultTextEnc == RTL_TEXTENCODING_DONTKNOW )
- eDefaultTextEnc = getBiffData().getTextEncoding();
-
- // create all string portions according to the font id vector
- for( FontPortionModelList::const_iterator aIt = aPortions.begin(); aIt->mnPos < nStrLen; ++aIt )
- {
- sal_Int32 nPortionLen = (aIt + 1)->mnPos - aIt->mnPos;
- if( nPortionLen > 0 )
- {
- // convert byte string to unicode string, using current font encoding
- rtl_TextEncoding eTextEnc = mxBiffData->getFontEncoding( static_cast< sal_uInt16 >( aIt->mnFontId ) );
- if( eTextEnc == RTL_TEXTENCODING_DONTKNOW )
- eTextEnc = eDefaultTextEnc;
- aBuffer.append( OStringToOUString( aString.copy( aIt->mnPos, nPortionLen ), eTextEnc ) );
- }
- }
- }
-
- OUString aUniStr = aBuffer.makeStringAndClear();
- writeStringItem( rName( "text" ), aUniStr );
- return aUniStr;
-}
-
-OUString BiffObjectBase::dumpUniString( const String& rName, BiffStringFlags nFlags )
-{
- OSL_ENSURE( !getFlag( nFlags, static_cast< BiffStringFlags >( ~(BIFF_STR_8BITLENGTH | BIFF_STR_SMARTFLAGS) ) ), "BiffObjectBase::dumpUniString - unknown flag" );
- bool b8BitLength = getFlag( nFlags, BIFF_STR_8BITLENGTH );
-
- // --- string header ---
- sal_uInt16 nChars = b8BitLength ? mxBiffStrm->readuInt8() : mxBiffStrm->readuInt16();
- sal_uInt8 nFlagField = 0;
- if( (nChars > 0) || !getFlag( nFlags, BIFF_STR_SMARTFLAGS ) )
- *mxBiffStrm >> nFlagField;
- bool b16Bit = getFlag( nFlagField, BIFF_STRF_16BIT );
- bool bFonts = getFlag( nFlagField, BIFF_STRF_RICH );
- bool bPhonetic = getFlag( nFlagField, BIFF_STRF_PHONETIC );
- sal_uInt16 nFontCount = bFonts ? mxBiffStrm->readuInt16() : 0;
- sal_uInt32 nPhoneticSize = bPhonetic ? mxBiffStrm->readuInt32() : 0;
-
- // --- character array ---
- OUString aString = mxBiffStrm->readUniStringChars( nChars, b16Bit, true );
- writeStringItem( rName( "text" ), aString );
-
- // --- formatting ---
- // #122185# bRich flag may be set, but format runs may be missing
- if( nFontCount > 0 )
- {
- IndentGuard aIndGuard( mxOut );
- FontPortionModelList aPortions;
- aPortions.importPortions( *mxBiffStrm, nFontCount, BIFF_FONTPORTION_16BIT );
- writeFontPortions( aPortions );
- }
-
- // --- phonetic information ---
- // #122185# bPhonetic flag may be set, but phonetic data may be missing
- if( nPhoneticSize > 0 )
- {
- sal_Int64 nStrmPos = mxBiffStrm->tell();
- IndentGuard aIndGuard( mxOut );
- writeEmptyItem( "phonetic-data" );
- dumpUnused( 2 );
- dumpDec< sal_uInt16 >( "size" );
- dumpDec< sal_uInt16 >( "font-idx", "FONTNAMES" );
- dumpHex< sal_uInt16 >( "flags", "PHONETICPR-FLAGS" );
- sal_uInt16 nCount = dumpDec< sal_uInt16 >( "portion-count" );
- sal_uInt16 nLen = dumpDec< sal_uInt16 >( "text-len" );
- dumpUnicodeArray( "text", mxBiffStrm->readuInt16() );
- if( nLen == 0 ) dumpUnused( 2 );
- for( sal_uInt16 nPortion = 0; !mxBiffStrm->isEof() && (nPortion < nCount); ++nPortion )
- {
- MultiItemsGuard aMultiGuard( mxOut );
- dumpDec< sal_uInt16 >( "first-portion-char" );
- dumpDec< sal_uInt16 >( "first-main-char" );
- dumpDec< sal_uInt16 >( "main-char-count" );
- }
- dumpRemainingTo( nStrmPos + nPhoneticSize );
- }
-
- return aString;
-}
-
-OUString BiffObjectBase::dumpString( const String& rName, BiffStringFlags nByteFlags, BiffStringFlags nUniFlags, rtl_TextEncoding eDefaultTextEnc )
-{
- return (getBiff() == BIFF8) ? dumpUniString( rName, nUniFlags ) : dumpByteString( rName, nByteFlags, eDefaultTextEnc );
-}
-
-OUString BiffObjectBase::dumpSegmentedUniString( const String& rName )
-{
- sal_Int32 nLength = mxBiffStrm->readInt32();
- OUStringBuffer aBuffer;
- while( !mxBiffStrm->isEof() && (aBuffer.getLength() < nLength) )
- aBuffer.append( mxBiffStrm->readUniString() );
- OUString aString = aBuffer.makeStringAndClear();
- writeStringItem( rName, aString );
- return aString;
-}
-
-void BiffObjectBase::dumpSegmentedUniStringArray( const String& rName )
-{
- writeEmptyItem( rName );
- IndentGuard aIndGuard( mxOut );
- mxOut->resetItemIndex();
- for( sal_uInt16 nIndex = 0, nCount = dumpDec< sal_uInt16 >( "count" ); !mxBiffStrm->isEof() && (nIndex < nCount); ++nIndex )
- dumpSegmentedUniString( "#entry" );
-}
-
-sal_uInt8 BiffObjectBase::dumpBoolean( const String& rName )
-{
- sal_uInt8 nBool;
- *mxBiffStrm >> nBool;
- writeBooleanItem( rName( "boolean" ), nBool );
- return nBool;
-}
-
-sal_uInt8 BiffObjectBase::dumpErrorCode( const String& rName )
-{
- sal_uInt8 nErrCode;
- *mxBiffStrm >> nErrCode;
- writeErrorCodeItem( rName( "error-code" ), nErrCode );
- return nErrCode;
-}
-
-rtl_TextEncoding BiffObjectBase::dumpCodePage( const String& rName )
-{
- sal_uInt16 nCodePage = dumpDec< sal_uInt16 >( rName( "codepage" ), "CODEPAGES" );
- return BiffHelper::calcTextEncodingFromCodePage( nCodePage );
-}
-
-void BiffObjectBase::dumpFormulaResult( const String& rName )
-{
- MultiItemsGuard aMultiGuard( mxOut );
- sal_uInt8 pnResult[ 8 ];
- mxBiffStrm->readMemory( pnResult, 8 );
- writeArrayItem( rName( "result" ), pnResult, 8 );
- if( (pnResult[ 6 ] == 0xFF) && (pnResult[ 7 ] == 0xFF) )
- {
- sal_uInt8 nType = pnResult[ 0 ];
- sal_uInt8 nData = pnResult[ 2 ];
- writeHexItem( "type", nType, mxResultType );
- switch( nType )
- {
- case 1: writeBooleanItem( "value", nData ); break;
- case 2: writeErrorCodeItem( "value", nData ); break;
- }
- }
- else
- {
- double* pfValue = reinterpret_cast< double* >( pnResult );
- ByteOrderConverter::convertLittleEndian( *pfValue );
- writeDecItem( "value", *pfValue );
- }
-}
-
-sal_Int32 BiffObjectBase::dumpColIndex( const String& rName, bool bCol16Bit )
-{
- sal_Int32 nCol = readCol( bCol16Bit );
- writeColIndexItem( rName( "col-idx" ), nCol );
- return nCol;
-}
-
-sal_Int32 BiffObjectBase::dumpRowIndex( const String& rName, bool bRow32Bit )
-{
- sal_Int32 nRow = readRow( bRow32Bit );
- writeRowIndexItem( rName( "row-idx" ), nRow );
- return nRow;
-}
-
-sal_Int32 BiffObjectBase::dumpColRange( const String& rName, bool bCol16Bit )
-{
- sal_Int32 nCol1 = readCol( bCol16Bit );
- sal_Int32 nCol2 = readCol( bCol16Bit );
- writeColRangeItem( rName( "col-range" ), nCol1, nCol2 );
- return nCol2 - nCol1 + 1;
-}
-
-sal_Int32 BiffObjectBase::dumpRowRange( const String& rName, bool bRow32Bit )
-{
- sal_Int32 nRow1 = readRow( bRow32Bit );
- sal_Int32 nRow2 = readRow( bRow32Bit );
- writeRowRangeItem( rName( "row-range" ), nRow1, nRow2 );
- return nRow2 - nRow1 + 1;
-}
-
-Address BiffObjectBase::dumpAddress( const String& rName, bool bCol16Bit, bool bRow32Bit )
-{
- Address aPos;
- readAddress( aPos, bCol16Bit, bRow32Bit );
- writeAddressItem( rName( "addr" ), aPos );
- return aPos;
-}
-
-Range BiffObjectBase::dumpRange( const String& rName, bool bCol16Bit, bool bRow32Bit )
-{
- Range aRange;
- readRange( aRange, bCol16Bit, bRow32Bit );
- writeRangeItem( rName( "range" ), aRange );
- return aRange;
-}
-
-void BiffObjectBase::dumpRangeList( const String& rName, bool bCol16Bit, bool bRow32Bit )
-{
- RangeList aRanges;
- readRangeList( aRanges, bCol16Bit, bRow32Bit );
- writeRangeListItem( rName( "range-list" ), aRanges );
-}
-
-void BiffObjectBase::dumpConstArrayHeader( sal_uInt32& rnCols, sal_uInt32& rnRows )
-{
- MultiItemsGuard aMultiGuard( mxOut );
- rnCols = dumpDec< sal_uInt8 >( "width" );
- rnRows = dumpDec< sal_uInt16 >( "height" );
- switch( getBiff() )
- {
- case BIFF2:
- case BIFF3:
- case BIFF4:
- case BIFF5: if( rnCols == 0 ) rnCols = 256; break;
- case BIFF8: ++rnCols; ++rnRows; break;
- case BIFF_UNKNOWN: break;
- }
- ItemGuard aItem( mxOut, "size" );
- mxOut->writeDec( rnCols );
- mxOut->writeChar( 'x' );
- mxOut->writeDec( rnRows );
- aItem.cont();
- mxOut->writeDec( rnCols * rnRows );
-}
-
-OUString BiffObjectBase::dumpConstValue( sal_Unicode cStrQuote )
-{
- MultiItemsGuard aMultiGuard( mxOut );
- OUStringBuffer aValue;
- switch( dumpDec< sal_uInt8 >( "type", mxConstType ) )
- {
- case BIFF_DATATYPE_EMPTY:
- dumpUnused( 8 );
- aValue.append( OOX_DUMP_EMPTYVALUE );
- break;
- case BIFF_DATATYPE_DOUBLE:
- dumpDec< double >( "value" );
- aValue.append( mxOut->getLastItemValue() );
- break;
- case BIFF_DATATYPE_STRING:
- aValue.append( dumpString( "value", BIFF_STR_8BITLENGTH ) );
- StringHelper::enclose( aValue, cStrQuote );
- break;
- case BIFF_DATATYPE_BOOL:
- dumpBoolean( "value" );
- aValue.append( mxOut->getLastItemValue() );
- dumpUnused( 7 );
- break;
- case BIFF_DATATYPE_ERROR:
- dumpErrorCode( "value" );
- aValue.append( mxOut->getLastItemValue() );
- dumpUnused( 7 );
- break;
- }
- return aValue.makeStringAndClear();
-}
-
-sal_uInt16 BiffObjectBase::dumpRepeatedRecId()
-{
- return dumpHex< sal_uInt16 >( "repeated-rec-id", getRecNames() );
-}
-
-void BiffObjectBase::dumpFrHeader( bool bWithFlags, bool bWithRange )
-{
- dumpHex< sal_uInt16 >( "fr-rec-id", getRecNames() );
- sal_Int16 nFlags = bWithFlags ? dumpHex< sal_uInt16 >( "fr-flags", "FR-FLAGS" ) : 0x0001;
- if( bWithRange )
- {
- if( getFlag< sal_uInt16 >( nFlags, 0x0001 ) )
- dumpRange( "fr-range" );
- else
- dumpUnused( 8 );
- }
-}
-
-void BiffObjectBase::dumpDffClientRect()
-{
- lclDumpDffClientRect( mxOut, mxStrm );
-}
-
-void BiffObjectBase::dumpEmbeddedDff()
-{
- mxOut->decIndent();
- writeEmptyItem( "EMBEDDED-DFF-START" );
- mxOut->incIndent();
- mxDffObj->dump();
- mxOut->emptyLine();
- mxOut->decIndent();
- writeEmptyItem( "EMBEDDED-DFF-END" );
- mxOut->incIndent();
-}
-
-void BiffObjectBase::dumpControl()
-{
- sal_uInt32 nStartPos = dumpHex< sal_uInt32 >( "ctls-stream-pos", "CONV-DEC" );
- sal_uInt32 nLength = dumpHex< sal_uInt32 >( "ctls-stream-length", "CONV-DEC" );
- if( isValid( mxCtlsObj ) )
- mxCtlsObj->dumpControl( nStartPos, nLength );
-}
-
-// ============================================================================
-// ============================================================================
-
-FormulaObject::FormulaObject( const BiffObjectBase& rParent ) :
- mnSize( 0 )
-{
- BiffObjectBase::construct( rParent );
- constructFmlaObj();
-}
-
-FormulaObject::~FormulaObject()
-{
-}
-
-sal_uInt16 FormulaObject::readFormulaSize()
-{
- return (getBiff() == BIFF2) ? getBiffStream().readuInt8() : getBiffStream().readuInt16();
-}
-
-sal_uInt16 FormulaObject::dumpFormulaSize( const String& rName )
-{
- sal_uInt16 nSize = readFormulaSize();
- writeDecItem( rName( "formula-size" ), nSize );
- return nSize;
-}
-
-void FormulaObject::dumpCellFormula( const String& rName, sal_uInt16 nSize )
-{
- dumpFormula( rName, nSize, false );
-}
-
-void FormulaObject::dumpCellFormula( const String& rName )
-{
- dumpFormula( rName, false );
-}
-
-void FormulaObject::dumpNameFormula( const String& rName, sal_uInt16 nSize )
-{
- dumpFormula( rName, nSize, true );
-}
-
-void FormulaObject::dumpNameFormula( const String& rName )
-{
- dumpFormula( rName, true );
-}
-
-void FormulaObject::implDump()
-{
- {
- MultiItemsGuard aMultiGuard( mxOut );
- writeEmptyItem( maName );
- writeDecItem( "formula-size", mnSize );
- }
- if( mnSize == 0 ) return;
-
- sal_Int64 nStartPos = mxStrm->tell();
- sal_Int64 nEndPos = ::std::min< sal_Int64 >( nStartPos + mnSize, mxStrm->size() );
-
- bool bValid = mxTokens.get();
- mxStack.reset( new FormulaStack );
- maAddData.clear();
- IndentGuard aIndGuard( mxOut );
- {
- TableGuard aTabGuard( mxOut, 8, 18 );
- while( bValid && !mxStrm->isEof() && (mxStrm->tell() < nEndPos) )
- {
- MultiItemsGuard aMultiGuard( mxOut );
- writeHexItem( EMPTY_STRING, static_cast< sal_uInt16 >( mxStrm->tell() - nStartPos ) );
- sal_uInt8 nTokenId = dumpHex< sal_uInt8 >( EMPTY_STRING, mxTokens );
- bValid = mxTokens->hasName( nTokenId );
- if( bValid )
- {
- sal_uInt8 nTokClass = nTokenId & BIFF_TOKCLASS_MASK;
- sal_uInt8 nBaseId = nTokenId & BIFF_TOKID_MASK;
- if( nTokClass == BIFF_TOKCLASS_NONE )
- {
- switch( nBaseId )
- {
- case BIFF_TOKID_EXP: dumpExpToken( "EXP" ); break;
- case BIFF_TOKID_TBL: dumpExpToken( "TBL" ); break;
- case BIFF_TOKID_ADD: dumpBinaryOpToken( "+" ); break;
- case BIFF_TOKID_SUB: dumpBinaryOpToken( "-" ); break;
- case BIFF_TOKID_MUL: dumpBinaryOpToken( "*" ); break;
- case BIFF_TOKID_DIV: dumpBinaryOpToken( "/" ); break;
- case BIFF_TOKID_POWER: dumpBinaryOpToken( "^" ); break;
- case BIFF_TOKID_CONCAT: dumpBinaryOpToken( "&" ); break;
- case BIFF_TOKID_LT: dumpBinaryOpToken( "<" ); break;
- case BIFF_TOKID_LE: dumpBinaryOpToken( "<=" ); break;
- case BIFF_TOKID_EQ: dumpBinaryOpToken( "=" ); break;
- case BIFF_TOKID_GE: dumpBinaryOpToken( ">=" ); break;
- case BIFF_TOKID_GT: dumpBinaryOpToken( "<" ); break;
- case BIFF_TOKID_NE: dumpBinaryOpToken( "<>" ); break;
- case BIFF_TOKID_ISECT: dumpBinaryOpToken( " " ); break;
- case BIFF_TOKID_LIST: dumpBinaryOpToken( "," ); break;
- case BIFF_TOKID_RANGE: dumpBinaryOpToken( ":" ); break;
- case BIFF_TOKID_UPLUS: dumpUnaryOpToken( "+", "" ); break;
- case BIFF_TOKID_UMINUS: dumpUnaryOpToken( "-", "" ); break;
- case BIFF_TOKID_PERCENT: dumpUnaryOpToken( "", "%" ); break;
- case BIFF_TOKID_PAREN: dumpUnaryOpToken( "(", ")" ); break;
- case BIFF_TOKID_MISSARG: dumpMissArgToken(); break;
- case BIFF_TOKID_STR: dumpStringToken(); break;
- case BIFF_TOKID_NLR: bValid = dumpNlrToken(); break;
- case BIFF_TOKID_ATTR: bValid = dumpAttrToken(); break;
- case BIFF_TOKID_SHEET: dumpSheetToken(); break;
- case BIFF_TOKID_ENDSHEET: dumpEndSheetToken(); break;
- case BIFF_TOKID_ERR: dumpErrorToken(); break;
- case BIFF_TOKID_BOOL: dumpBoolToken(); break;
- case BIFF_TOKID_INT: dumpIntToken(); break;
- case BIFF_TOKID_NUM: dumpDoubleToken(); break;
- default: bValid = false;
- }
- }
- else
- {
- OUString aTokClass = cfg().getName( mxClasses, nTokClass );
- switch( nBaseId )
- {
- case BIFF_TOKID_ARRAY: dumpArrayToken( aTokClass ); break;
- case BIFF_TOKID_FUNC: dumpFuncToken( aTokClass ); break;
- case BIFF_TOKID_FUNCVAR: dumpFuncVarToken( aTokClass ); break;
- case BIFF_TOKID_NAME: dumpNameToken( aTokClass ); break;
- case BIFF_TOKID_REF: dumpRefToken( aTokClass, false ); break;
- case BIFF_TOKID_AREA: dumpAreaToken( aTokClass, false ); break;
- case BIFF_TOKID_MEMAREA: dumpMemAreaToken( aTokClass, true ); break;
- case BIFF_TOKID_MEMERR: dumpMemAreaToken( aTokClass, false ); break;
- case BIFF_TOKID_MEMNOMEM: dumpMemAreaToken( aTokClass, false ); break;
- case BIFF_TOKID_MEMFUNC: dumpMemFuncToken( aTokClass ); break;
- case BIFF_TOKID_REFERR: dumpRefErrToken( aTokClass, false ); break;
- case BIFF_TOKID_AREAERR: dumpRefErrToken( aTokClass, true ); break;
- case BIFF_TOKID_REFN: dumpRefToken( aTokClass, true ); break;
- case BIFF_TOKID_AREAN: dumpAreaToken( aTokClass, true ); break;
- case BIFF_TOKID_MEMAREAN: dumpMemFuncToken( aTokClass ); break;
- case BIFF_TOKID_MEMNOMEMN: dumpMemFuncToken( aTokClass ); break;
- case BIFF_TOKID_FUNCCE: dumpCmdToken( aTokClass ); break;
- case BIFF_TOKID_NAMEX: dumpNameXToken( aTokClass ); break;
- case BIFF_TOKID_REF3D: dumpRef3dToken( aTokClass, mbNameMode ); break;
- case BIFF_TOKID_AREA3D: dumpArea3dToken( aTokClass, mbNameMode ); break;
- case BIFF_TOKID_REFERR3D: dumpRefErr3dToken( aTokClass, false ); break;
- case BIFF_TOKID_AREAERR3D: dumpRefErr3dToken( aTokClass, true ); break;
- default: bValid = false;
- }
- }
- }
- }
- }
- bValid = nEndPos == mxStrm->tell();
- if( bValid )
- {
- dumpAddTokenData();
- writeInfoItem( "formula", mxStack->getFormulaString() );
- writeInfoItem( "classes", mxStack->getClassesString() );
- }
- else
- dumpBinary( OOX_DUMP_ERRASCII( "formula-error" ), nEndPos - mxStrm->tell(), false );
-
- mnSize = 0;
-}
-
-void FormulaObject::dumpFormula( const String& rName, sal_uInt16 nSize, bool bNameMode )
-{
- maName = rName( "formula" );
- mnSize = nSize;
- mbNameMode = bNameMode;
- dump();
- mnSize = 0;
-}
-
-void FormulaObject::dumpFormula( const String& rName, bool bNameMode )
-{
- dumpFormula( rName, readFormulaSize(), bNameMode );
-}
-
-// private --------------------------------------------------------------------
-
-void FormulaObject::constructFmlaObj()
-{
- if( BiffObjectBase::implIsValid() )
- {
- mxFuncProv.reset( new FunctionProvider( FILTER_BIFF, getBiff(), true ) );
-
- Config& rCfg = cfg();
- mxClasses = rCfg.getNameList( "TOKENCLASSES" );
- mxRelFlags = rCfg.getNameList( "REFRELFLAGS" );
- mxNlrTypes = rCfg.getNameList( "NLRTYPES" );
- mxAttrTypes = rCfg.getNameList( "ATTRTYPES" );
- mxSpTypes = rCfg.getNameList( "ATTRSPACETYPES" );
-
- // create classified token names
- mxTokens = rCfg.createNameList< ConstList >( "TOKENS" );
- mxTokens->includeList( rCfg.getNameList( "BASETOKENS" ) );
-
- NameListRef xClassTokens = rCfg.getNameList( "CLASSTOKENS" );
- if( mxClasses.get() && xClassTokens.get() )
- for( NameListBase::const_iterator aCIt = mxClasses->begin(), aCEnd = mxClasses->end(); aCIt != aCEnd; ++aCIt )
- for( NameListBase::const_iterator aTIt = xClassTokens->begin(), aTEnd = xClassTokens->end(); aTIt != aTEnd; ++aTIt )
- mxTokens->setName( aCIt->first | aTIt->first, aTIt->second + aCIt->second );
-
- mnColCount = 256;
- mnRowCount = (getBiff() == BIFF8) ? 65536 : 16384;
- }
-}
-
-// ----------------------------------------------------------------------------
-
-namespace {
-
-OUString lclCreateName( const OUString& rRef, sal_uInt16 nNameIdx )
-{
- OUStringBuffer aName( rRef );
- StringHelper::appendIndexedText( aName, CREATE_OUSTRING( "NAME" ), nNameIdx );
- return aName.makeStringAndClear();
-}
-
-OUString lclCreateNlr( const OUString& rData, bool bRel = true )
-{
- OUStringBuffer aNlr;
- if( !bRel ) aNlr.append( OOX_DUMP_ADDRABS );
- StringHelper::appendIndexedText( aNlr, CREATE_OUSTRING( "NLR" ), rData );
- return aNlr.makeStringAndClear();
-}
-
-OUString lclCreateNlr( const TokenAddress& rPos )
-{
- OUStringBuffer aAddr;
- StringHelper::appendAddrCol( aAddr, rPos.mnCol, true );
- StringHelper::appendAddrRow( aAddr, rPos.mnRow, true );
- return lclCreateNlr( aAddr.makeStringAndClear(), rPos.mbRelRow );
-}
-
-} // namespace
-
-// ----------------------------------------------------------------------------
-
-TokenAddress FormulaObject::createTokenAddress( sal_uInt16 nCol, sal_uInt16 nRow, bool bRelC, bool bRelR, bool bNameMode ) const
-{
- TokenAddress aPos;
- aPos.mnCol = nCol;
- if( bRelC && bNameMode && (nCol >= mnColCount / 2) ) aPos.mnCol -= mnColCount;
- aPos.mbRelCol = bRelC;
- aPos.mnRow = nRow;
- if( bRelR && bNameMode && (nRow >= mnRowCount / 2) ) aPos.mnRow -= mnRowCount;
- aPos.mbRelRow = bRelR;
- return aPos;
-}
-
-OUString FormulaObject::createRef( const OUString& rData ) const
-{
- return maRefPrefix + rData;
-}
-
-OUString FormulaObject::createName( sal_uInt16 nNameIdx ) const
-{
- return lclCreateName( maRefPrefix, nNameIdx );
-}
-
-OUString FormulaObject::createPlaceHolder( size_t nIdx ) const
-{
- OUStringBuffer aStr;
- StringHelper::appendDec( aStr, static_cast< sal_uInt32 >( nIdx ) );
- StringHelper::enclose( aStr, OOX_DUMP_PLACEHOLDER );
- return aStr.makeStringAndClear();
-}
-
-OUString FormulaObject::createPlaceHolder() const
-{
- return createPlaceHolder( maAddData.size() );
-}
-
-sal_uInt16 FormulaObject::readFuncId()
-{
- return (getBiff() >= BIFF4) ? mxStrm->readuInt16() : mxStrm->readuInt8();
-}
-
-OUString FormulaObject::writeFuncIdItem( sal_uInt16 nFuncId, const FunctionInfo** oppFuncInfo )
-{
- ItemGuard aItemGuard( mxOut, "func-id" );
- writeHexItem( EMPTY_STRING, nFuncId, "FUNCID" );
- OUStringBuffer aBuffer;
- const FunctionInfo* pFuncInfo = mxFuncProv->getFuncInfoFromBiffFuncId( nFuncId );
- if( pFuncInfo )
- aBuffer.append( pFuncInfo->maOoxFuncName );
- else
- {
- bool bCmd = getFlag( nFuncId, BIFF_TOK_FUNCVAR_CMD );
- aBuffer.appendAscii( bCmd ? "CMD" : "FUNC" );
- StringHelper::appendIndex( aBuffer, nFuncId & BIFF_TOK_FUNCVAR_FUNCIDMASK );
- }
- OUString aFuncName = aBuffer.makeStringAndClear();
- aItemGuard.cont();
- mxOut->writeChar( OOX_DUMP_STRQUOTE );
- mxOut->writeString( aFuncName );
- mxOut->writeChar( OOX_DUMP_STRQUOTE );
- if( oppFuncInfo ) *oppFuncInfo = pFuncInfo;
- return aFuncName;
-}
-
-sal_uInt16 FormulaObject::dumpTokenCol( const String& rName, bool& rbRelC, bool& rbRelR )
-{
- sal_uInt16 nCol = 0;
- if( getBiff() == BIFF8 )
- {
- nCol = dumpHex< sal_uInt16 >( rName, mxRelFlags );
- rbRelC = getFlag( nCol, BIFF_TOK_REF_COLREL );
- rbRelR = getFlag( nCol, BIFF_TOK_REF_ROWREL );
- nCol &= BIFF_TOK_REF_COLMASK;
- }
- else
- nCol = dumpDec< sal_uInt8 >( rName );
- return nCol;
-}
-
-sal_uInt16 FormulaObject::dumpTokenRow( const String& rName, bool& rbRelC, bool& rbRelR )
-{
- sal_uInt16 nRow = 0;
- if( getBiff() == BIFF8 )
- nRow = dumpDec< sal_uInt16 >( rName );
- else
- {
- nRow = dumpHex< sal_uInt16 >( rName, mxRelFlags );
- rbRelC = getFlag( nRow, BIFF_TOK_REF_COLREL );
- rbRelR = getFlag( nRow, BIFF_TOK_REF_ROWREL );
- nRow &= BIFF_TOK_REF_ROWMASK;
- }
- return nRow;
-}
-
-TokenAddress FormulaObject::dumpTokenAddress( bool bNameMode )
-{
- bool bRelC = false;
- bool bRelR = false;
- sal_uInt16 nRow = dumpTokenRow( "row", bRelC, bRelR );
- sal_uInt16 nCol = dumpTokenCol( "col", bRelC, bRelR );
- return createTokenAddress( nCol, nRow, bRelC, bRelR, bNameMode );
-}
-
-TokenRange FormulaObject::dumpTokenRange( bool bNameMode )
-{
- bool bRelC1 = false;
- bool bRelR1 = false;
- bool bRelC2 = false;
- bool bRelR2 = false;
- sal_uInt16 nRow1 = dumpTokenRow( "row1", bRelC1, bRelR1 );
- sal_uInt16 nRow2 = dumpTokenRow( "row2", bRelC2, bRelR2 );
- sal_uInt16 nCol1 = dumpTokenCol( "col1", bRelC1, bRelR1 );
- sal_uInt16 nCol2 = dumpTokenCol( "col2", bRelC2, bRelR2 );
- TokenRange aRange;
- aRange.maFirst = createTokenAddress( nCol1, nRow1, bRelC1, bRelR1, bNameMode );
- aRange.maLast = createTokenAddress( nCol2, nRow2, bRelC2, bRelR2, bNameMode );
- return aRange;
-}
-
-sal_Int16 FormulaObject::readTokenRefIdx()
-{
- sal_Int16 nRefIdx = dumpDec< sal_Int16 >( "ref-idx" );
- switch( getBiff() )
- {
- case BIFF2: dumpUnused( 1 ); break;
- case BIFF3: dumpUnused( 2 ); break;
- case BIFF4: dumpUnused( 2 ); break;
- case BIFF5: dumpUnused( 8 ); break;
- case BIFF8: break;
- case BIFF_UNKNOWN: break;
- }
- return nRefIdx;
-}
-
-OUString FormulaObject::dumpTokenRefIdx()
-{
- OUStringBuffer aRef( CREATE_OUSTRING( "REF" ) );
- StringHelper::appendIndex( aRef, readTokenRefIdx() );
- aRef.append( OOX_DUMP_TABSEP );
- return aRef.makeStringAndClear();
-}
-
-OUString FormulaObject::dumpTokenRefTabIdxs()
-{
- sal_Int16 nRefIdx = readTokenRefIdx();
- OUStringBuffer aRef( CREATE_OUSTRING( "REF" ) );
- StringHelper::appendIndex( aRef, nRefIdx );
- if( getBiff() == BIFF5 )
- {
- dumpDec< sal_Int16 >( "tab1" );
- sal_Int16 nTab2 = dumpDec< sal_Int16 >( "tab2" );
- if( (nRefIdx > 0) && (nTab2 > 0) && (nRefIdx != nTab2) )
- {
- aRef.append( OOX_DUMP_RANGESEP );
- aRef.appendAscii( "REF" );
- StringHelper::appendIndex( aRef, nTab2 );
- }
- }
- aRef.append( OOX_DUMP_TABSEP );
- return aRef.makeStringAndClear();
-}
-
-void FormulaObject::dumpIntToken()
-{
- dumpDec< sal_uInt16 >( "value" );
- mxStack->pushOperand( mxOut->getLastItemValue() );
-}
-
-void FormulaObject::dumpDoubleToken()
-{
- dumpDec< double >( "value" );
- mxStack->pushOperand( mxOut->getLastItemValue() );
-}
-
-void FormulaObject::dumpStringToken()
-{
- OUStringBuffer aValue;
- aValue.append( dumpString( "value", BIFF_STR_8BITLENGTH, BIFF_STR_8BITLENGTH ) );
- StringHelper::enclose( aValue, OOX_DUMP_FMLASTRQUOTE );
- mxStack->pushOperand( aValue.makeStringAndClear() );
-}
-
-void FormulaObject::dumpBoolToken()
-{
- dumpBoolean( "value" );
- mxStack->pushOperand( mxOut->getLastItemValue() );
-}
-
-void FormulaObject::dumpErrorToken()
-{
- dumpErrorCode( "value" );
- mxStack->pushOperand( mxOut->getLastItemValue() );
-}
-
-void FormulaObject::dumpMissArgToken()
-{
- mxStack->pushOperand( OUString( OOX_DUMP_EMPTYVALUE ) );
-}
-
-void FormulaObject::dumpArrayToken( const OUString& rTokClass )
-{
- dumpUnused( (getBiff() == BIFF2) ? 6 : 7 );
- mxStack->pushOperand( createPlaceHolder(), rTokClass );
- maAddData.push_back( ADDDATA_ARRAY );
-}
-
-void FormulaObject::dumpNameToken( const OUString& rTokClass )
-{
- sal_uInt16 nNameIdx = dumpDec< sal_uInt16 >( "name-idx" );
- switch( getBiff() )
- {
- case BIFF2: dumpUnused( 5 ); break;
- case BIFF3:
- case BIFF4: dumpUnused( 8 ); break;
- case BIFF5: dumpUnused( 12 ); break;
- case BIFF8: dumpUnused( 2 ); break;
- case BIFF_UNKNOWN: break;
- }
- mxStack->pushOperand( createName( nNameIdx ), rTokClass );
-}
-
-void FormulaObject::dumpNameXToken( const OUString& rTokClass )
-{
- OUString aRef = dumpTokenRefIdx();
- sal_uInt16 nNameIdx = dumpDec< sal_uInt16 >( "name-idx" );
- dumpUnused( (getBiff() == BIFF8) ? 2 : 12 );
- mxStack->pushOperand( lclCreateName( aRef, nNameIdx ), rTokClass );
-}
-
-void FormulaObject::dumpRefToken( const OUString& rTokClass, bool bNameMode )
-{
- TokenAddress aPos = dumpTokenAddress( bNameMode );
- writeTokenAddressItem( "addr", aPos, bNameMode );
- mxStack->pushOperand( createRef( mxOut->getLastItemValue() ), rTokClass );
-}
-
-void FormulaObject::dumpAreaToken( const OUString& rTokClass, bool bNameMode )
-{
- TokenRange aRange = dumpTokenRange( bNameMode );
- writeTokenRangeItem( "range", aRange, bNameMode );
- mxStack->pushOperand( createRef( mxOut->getLastItemValue() ), rTokClass );
-}
-
-void FormulaObject::dumpRefErrToken( const OUString& rTokClass, bool bArea )
-{
- dumpUnused( ((getBiff() == BIFF8) ? 4 : 3) * (bArea ? 2 : 1) );
- mxStack->pushOperand( createRef( getErrorName( BIFF_ERR_REF ) ), rTokClass );
-}
-
-void FormulaObject::dumpRef3dToken( const OUString& rTokClass, bool bNameMode )
-{
- OUString aRef = dumpTokenRefTabIdxs();
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list