From 9185568a24c86eb2e641e7085b9235b6a640d8e8 Mon Sep 17 00:00:00 2001 From: Niklas Nebel Date: Fri, 16 Apr 2010 12:35:33 +0200 Subject: calc53: #i110937# html import: don't insert title into EditEngine --- editeng/source/editeng/eehtml.cxx | 21 +++++++++++++++------ editeng/source/editeng/eehtml.hxx | 1 + 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/editeng/source/editeng/eehtml.cxx b/editeng/source/editeng/eehtml.cxx index a6d5096be7..87bf077bb2 100644 --- a/editeng/source/editeng/eehtml.cxx +++ b/editeng/source/editeng/eehtml.cxx @@ -60,6 +60,7 @@ EditHTMLParser::EditHTMLParser( SvStream& rIn, const String& rBaseURL, SvKeyValu bWasInPara = FALSE; nInTable = 0; nInCell = 0; + bInTitle = FALSE; nDefListLevel = 0; nBulletLevel = 0; nNumberingLevel = 0; @@ -179,11 +180,14 @@ void EditHTMLParser::NextToken( int nToken ) break; case HTML_TEXTTOKEN: { - if ( !bInPara ) - StartPara( FALSE ); - -// if ( bInPara || pCurAnchor ) + // #i110937# for content, call aImportHdl (no SkipGroup), but don't insert the text into the EditEngine + if (!bInTitle) { + if ( !bInPara ) + StartPara( FALSE ); + + // if ( bInPara || pCurAnchor ) + String aText = aToken; if ( aText.Len() && ( aText.GetChar( 0 ) == ' ' ) && ThrowAwayBlank() && !IsReadPRE() ) @@ -342,6 +346,13 @@ void EditHTMLParser::NextToken( int nToken ) // #58335# kein SkipGroup on/off auf inline markup etc. + case HTML_TITLE_ON: + bInTitle = TRUE; + break; + case HTML_TITLE_OFF: + bInTitle = FALSE; + break; + // globals case HTML_HTML_ON: case HTML_HTML_OFF: @@ -355,8 +366,6 @@ void EditHTMLParser::NextToken( int nToken ) case HTML_THEAD_OFF: case HTML_TBODY_ON: case HTML_TBODY_OFF: - case HTML_TITLE_ON: - case HTML_TITLE_OFF: // inline elements, structural markup // HTML 3.0 case HTML_BANNER_ON: diff --git a/editeng/source/editeng/eehtml.hxx b/editeng/source/editeng/eehtml.hxx index 6314db6161..4035cb1598 100644 --- a/editeng/source/editeng/eehtml.hxx +++ b/editeng/source/editeng/eehtml.hxx @@ -57,6 +57,7 @@ private: BOOL bFieldsInserted; BYTE nInTable; BYTE nInCell; + BOOL bInTitle; BYTE nDefListLevel; BYTE nBulletLevel; -- cgit v1.2.3 From 84d85c073a92a1c11ada4b43f1169a6a717bdd86 Mon Sep 17 00:00:00 2001 From: Niklas Nebel <nn@openoffice.org> Date: Tue, 20 Apr 2010 17:18:54 +0200 Subject: calc53: #i110911# write required xlink:type attributes, column element for cached table --- xmloff/source/forms/elementexport.cxx | 4 ++-- xmloff/source/forms/propertyexport.cxx | 6 +++++- xmloff/source/forms/propertyexport.hxx | 8 +++++--- xmloff/source/forms/propertyimport.cxx | 2 +- xmloff/source/script/XMLScriptExportHandler.cxx | 3 +++ 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/xmloff/source/forms/elementexport.cxx b/xmloff/source/forms/elementexport.cxx index e82d2a3456..32c746a5cc 100644 --- a/xmloff/source/forms/elementexport.cxx +++ b/xmloff/source/forms/elementexport.cxx @@ -693,7 +693,7 @@ namespace xmloff if (m_nIncludeCommon & CCA_TARGET_LOCATION) { - exportTargetLocationAttribute(); + exportTargetLocationAttribute(false); #if OSL_DEBUG_LEVEL > 0 // reset the bit for later checking m_nIncludeCommon = m_nIncludeCommon & ~CCA_TARGET_LOCATION; @@ -2134,7 +2134,7 @@ namespace xmloff // the target frame exportTargetFrameAttribute(); // the target URL - exportTargetLocationAttribute(); + exportTargetLocationAttribute(true); // #i110911# add type attribute (for form, but not for control) // master fields exportStringSequenceAttribute( diff --git a/xmloff/source/forms/propertyexport.cxx b/xmloff/source/forms/propertyexport.cxx index e6140c03c3..41b7587ce2 100644 --- a/xmloff/source/forms/propertyexport.cxx +++ b/xmloff/source/forms/propertyexport.cxx @@ -420,7 +420,7 @@ namespace xmloff } //--------------------------------------------------------------------- - void OPropertyExport::exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty) + void OPropertyExport::exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty,bool _bAddType) { DBG_CHECK_PROPERTY( _sPropertyName, ::rtl::OUString ); @@ -433,6 +433,10 @@ namespace xmloff ,OAttributeMetaData::getCommonControlAttributeName(_nProperty) , sTargetLocation); + // #i110911# add xlink:type="simple" if required + if (_bAddType) + AddAttribute(XML_NAMESPACE_XLINK, token::XML_TYPE, token::XML_SIMPLE); + exportedProperty(_sPropertyName); } //--------------------------------------------------------------------- diff --git a/xmloff/source/forms/propertyexport.hxx b/xmloff/source/forms/propertyexport.hxx index 8ca221bbe8..28cd7ea84b 100644 --- a/xmloff/source/forms/propertyexport.hxx +++ b/xmloff/source/forms/propertyexport.hxx @@ -69,7 +69,7 @@ namespace xmloff StringSet m_aRemainingProps; // see examinePersistence - void exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty); + void exportRelativeTargetLocation(const ConstAsciiString& _sPropertyName,sal_Int32 _nProperty,bool _bAddType); protected: IFormsExportContext& m_rContext; @@ -230,8 +230,10 @@ namespace xmloff <p>The value of this attribute is extracted from the TargetURL property of the object given.</p> <p>The property needs a special handling because the URL's need to be made relative</p> + + <p>If _bAddType is set, an additional xlink:type="simple" attribute is also added.</p> */ - inline void exportTargetLocationAttribute() { exportRelativeTargetLocation(PROPERTY_TARGETURL,CCA_TARGET_LOCATION); } + inline void exportTargetLocationAttribute(bool _bAddType) { exportRelativeTargetLocation(PROPERTY_TARGETURL,CCA_TARGET_LOCATION,_bAddType); } /** add the form:image attribute to the export context. @@ -239,7 +241,7 @@ namespace xmloff <p>The property needs a special handling because the URL's need to be made relative</p> */ - inline void exportImageDataAttribute() { exportRelativeTargetLocation(PROPERTY_IMAGEURL,CCA_IMAGE_DATA); } + inline void exportImageDataAttribute() { exportRelativeTargetLocation(PROPERTY_IMAGEURL,CCA_IMAGE_DATA,false); } /** flag the style properties as 'already exported' diff --git a/xmloff/source/forms/propertyimport.cxx b/xmloff/source/forms/propertyimport.cxx index b5c20be581..9cf2bea366 100644 --- a/xmloff/source/forms/propertyimport.cxx +++ b/xmloff/source/forms/propertyimport.cxx @@ -363,7 +363,7 @@ void OPropertyImport::handleAttribute(sal_uInt16 /*_nNamespaceKey*/, const ::rtl implPushBackPropertyValue( aNewValue ); } #if OSL_DEBUG_LEVEL > 0 - else + else if (!token::IsXMLToken(_rLocalName, token::XML_TYPE)) // xlink:type is valid but ignored for <form:form> { ::rtl::OString sMessage( "OPropertyImport::handleAttribute: Can't handle the following:\n" ); sMessage += ::rtl::OString( " Attribute name: " ); diff --git a/xmloff/source/script/XMLScriptExportHandler.cxx b/xmloff/source/script/XMLScriptExportHandler.cxx index be72ceba52..0e610cb15f 100644 --- a/xmloff/source/script/XMLScriptExportHandler.cxx +++ b/xmloff/source/script/XMLScriptExportHandler.cxx @@ -75,6 +75,9 @@ void XMLScriptExportHandler::Export( OUString sTmp; rValues[i].Value >>= sTmp; rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_HREF, sTmp); + + // #i110911# xlink:type="simple" is required + rExport.AddAttribute(XML_NAMESPACE_XLINK, XML_TYPE, XML_SIMPLE); } // else: disregard } -- cgit v1.2.3 From 0123a6610fb8199bccf49267ae8538ec7e527527 Mon Sep 17 00:00:00 2001 From: Niklas Nebel <nn@openoffice.org> Date: Mon, 26 Apr 2010 14:26:49 +0200 Subject: calc53: #i25840# null result in text column only for empty cells, not values --- connectivity/source/drivers/calc/CTable.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/connectivity/source/drivers/calc/CTable.cxx b/connectivity/source/drivers/calc/CTable.cxx index 65505495cd..c1c2e90beb 100644 --- a/connectivity/source/drivers/calc/CTable.cxx +++ b/connectivity/source/drivers/calc/CTable.cxx @@ -347,14 +347,15 @@ void lcl_SetValue( ORowSetValue& rValue, const Reference<XSpreadsheet>& xSheet, switch (nType) { case DataType::VARCHAR: - if ( eCellType == CellContentType_TEXT ) + if ( eCellType == CellContentType_EMPTY ) + rValue.setNull(); + else { + // #i25840# still let Calc convert numbers to text const Reference<XText> xText( xCell, UNO_QUERY ); if ( xText.is() ) rValue = xText->getString(); - } // if ( eCellType == CellContentType_TEXT ) - else - rValue.setNull(); + } break; case DataType::DECIMAL: if ( eCellType == CellContentType_VALUE ) -- cgit v1.2.3 From c5fc1cb78c438df3beeaf0f603325e5684aa7029 Mon Sep 17 00:00:00 2001 From: Niklas Nebel <nn@openoffice.org> Date: Wed, 28 Apr 2010 16:52:04 +0200 Subject: calc53: #i111231# some spring cleaning --- formula/inc/formula/compiler.hrc | 8 ++------ formula/inc/formula/opcode.hxx | 4 ---- formula/source/core/api/FormulaCompiler.cxx | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/formula/inc/formula/compiler.hrc b/formula/inc/formula/compiler.hrc index 2df2a8ee78..c1a8117ab0 100644 --- a/formula/inc/formula/compiler.hrc +++ b/formula/inc/formula/compiler.hrc @@ -393,12 +393,8 @@ #define SC_OPCODE_LAST_OPCODE_ID 394 /* last OpCode */ /*** Interna ***/ -#define SC_OPCODE_INTERNAL_BEGIN 9995 -#define SC_OPCODE_GAME 9995 -#define SC_OPCODE_SPEW 9996 -#define SC_OPCODE_TTT 9997 -#define SC_OPCODE_TEAM 9998 -#define SC_OPCODE_ANSWER 9999 +#define SC_OPCODE_INTERNAL_BEGIN 9999 +#define SC_OPCODE_TTT 9999 #define SC_OPCODE_INTERNAL_END 9999 /*** from here on ExtraData contained ***/ diff --git a/formula/inc/formula/opcode.hxx b/formula/inc/formula/opcode.hxx index 12061917d6..53f387ae76 100644 --- a/formula/inc/formula/opcode.hxx +++ b/formula/inc/formula/opcode.hxx @@ -386,11 +386,7 @@ enum OpCodeEnum ocNumberValue = SC_OPCODE_NUMBERVALUE, // internal stuff ocInternalBegin = SC_OPCODE_INTERNAL_BEGIN, - ocGame = SC_OPCODE_GAME, - ocSpew = SC_OPCODE_SPEW, ocTTT = SC_OPCODE_TTT, - ocTeam = SC_OPCODE_TEAM, - ocAnswer = SC_OPCODE_ANSWER, ocInternalEnd = SC_OPCODE_INTERNAL_END, // from here on ExtraData ocDataToken1 = SC_OPCODE_DATA_TOKEN_1, diff --git a/formula/source/core/api/FormulaCompiler.cxx b/formula/source/core/api/FormulaCompiler.cxx index bdc6e4f0d3..5bac848086 100644 --- a/formula/source/core/api/FormulaCompiler.cxx +++ b/formula/source/core/api/FormulaCompiler.cxx @@ -46,7 +46,7 @@ namespace formula // ============================================================================= using namespace ::com::sun::star; - static const sal_Char* pInternal[ 5 ] = { "GAME", "SPEW", "TTT", "STARCALCTEAM", "ANTWORT" }; + static const sal_Char* pInternal[ 1 ] = { "TTT" }; // ============================================================================= namespace -- cgit v1.2.3