[Libreoffice-commits] .: writerfilter/source
Joseph Powers
jpowers at kemper.freedesktop.org
Mon Feb 7 06:00:45 PST 2011
writerfilter/source/dmapper/DomainMapper_Impl.cxx | 144 +++++++++++-----------
1 file changed, 72 insertions(+), 72 deletions(-)
New commits:
commit 0679158ebb6c84863e6e0e2fe877ea06eba4a2d4
Author: Joseph Powers <jpowers27 at cox.net>
Date: Mon Feb 7 06:00:37 2011 -0800
Move XServiceInfo.hpp from DEBUG to main.
Now that XServiceInfo is always used, it would be nice to always include
if defination. This fixes a compile error on mac.
PS: Also some trailing white space. The changed code all appears at the
top of the patch.
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 97e6a04..d9c3b14 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -2,7 +2,7 @@
/*************************************************************************
*
* 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
@@ -37,6 +37,7 @@
#include <com/sun/star/drawing/XDrawPageSupplier.hpp>
#include <com/sun/star/drawing/XShapes.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
+#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/style/XStyleFamiliesSupplier.hpp>
#include <com/sun/star/style/LineNumberPosition.hpp>
#include <com/sun/star/style/NumberingType.hpp>
@@ -82,7 +83,6 @@
#if DEBUG
#include <stdio.h>
-#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/style/TabStop.hpp>
#endif
@@ -652,17 +652,17 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("finishParagraph");
#endif
-
+
ParagraphPropertyMap* pParaContext = dynamic_cast< ParagraphPropertyMap* >( pPropertyMap.get() );
TextAppendContext& rAppendContext = m_aTextAppendStack.top();
uno::Reference< text::XTextAppend > xTextAppend = rAppendContext.xTextAppend;
PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
-
+
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->attribute("isTextAppend", xTextAppend.is());
dmapper_logger->attribute("isIgnor", getTableManager().isIgnore());
-#endif
-
+#endif
+
if(xTextAppend.is() && ! getTableManager( ).isIgnore())
{
try
@@ -868,25 +868,25 @@ void DomainMapper_Impl::finishParagraph( PropertyMapPtr pPropertyMap )
uno::Reference< text::XTextRange > xTextRange =
xTextAppend->finishParagraph( aProperties );
getTableManager( ).handle(xTextRange);
-
+
// Set the anchor of the objects to the created paragraph
while ( m_aAnchoredStack.size( ) > 0 && !m_bIsInShape )
{
uno::Reference< text::XTextContent > xObj = m_aAnchoredStack.top( );
- try
+ try
{
#if DEBUG
rtl::OUString sText( xTextRange->getString( ) );
#endif
xObj->attach( xTextRange );
- }
+ }
catch ( uno::RuntimeException& )
{
// this is normal: the shape is already attached
- }
+ }
m_aAnchoredStack.pop( );
}
-
+
// Get the end of paragraph character inserted
uno::Reference< text::XTextCursor > xCur = xTextRange->getText( )->createTextCursor( );
xCur->gotoEnd( false );
@@ -1235,7 +1235,7 @@ void DomainMapper_Impl::CreateRedline( uno::Reference< text::XTextRange > xRange
pRedlineProperties[0].Value <<= pRedline->m_sAuthor;
pRedlineProperties[1].Name = rPropNameSupplier.GetName( PROP_REDLINE_DATE_TIME );
pRedlineProperties[1].Value <<= lcl_DateStringToDateTime( pRedline->m_sDate );
-
+
xRedline->makeRedline( sType, aRedlineProperties );
}
catch( const uno::Exception & rEx )
@@ -1251,7 +1251,7 @@ void DomainMapper_Impl::CheckParaRedline( uno::Reference< text::XTextRange > xRa
if ( m_pParaRedline.get( ) )
{
CreateRedline( xRange, m_pParaRedline );
- ResetParaRedline( );
+ ResetParaRedline( );
}
}
@@ -1262,9 +1262,9 @@ void DomainMapper_Impl::CheckRedline( uno::Reference< text::XTextRange > xRange
for (; pIt != m_aRedlines.end( ); ++pIt )
{
CreateRedline( xRange, *pIt );
-
+
// Adding the non-mod redlines to the temporary vector
- if ( pIt->get( ) && ( ( *pIt )->m_nToken & 0xffff ) != ooxml::OOXML_mod )
+ if ( pIt->get( ) && ( ( *pIt )->m_nToken & 0xffff ) != ooxml::OOXML_mod )
{
aCleaned.push_back( *pIt );
}
@@ -1325,7 +1325,7 @@ void DomainMapper_Impl::PopAnnotation()
void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape > xShape )
{
m_bIsInShape = true;
- try
+ try
{
// Add the shape to the text append stack
m_aTextAppendStack.push( uno::Reference< text::XTextAppend >( xShape, uno::UNO_QUERY_THROW ) );
@@ -1345,7 +1345,7 @@ void DomainMapper_Impl::PushShapeContext( const uno::Reference< drawing::XShape
xProps->setPropertyValue(
rPropNameSupplier.GetName( PROP_OPAQUE ),
uno::makeAny( true ) );
- }
+ }
catch ( const uno::Exception& e )
{
#if DEBUG
@@ -1684,7 +1684,7 @@ void DomainMapper_Impl::PushFieldContext()
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->element("pushFieldContext");
#endif
-
+
uno::Reference< text::XTextAppend > xTextAppend = m_aTextAppendStack.top().xTextAppend;
//insert a dummy char to make sure the start range doesn't move together with the to-be-appended text
xTextAppend->appendTextPortion(::rtl::OUString( '-' ), uno::Sequence< beans::PropertyValue >() );
@@ -1727,7 +1727,7 @@ void FieldContext::AppendCommand(const ::rtl::OUString& rPart)
{
m_sCommand += rPart;
}
-
+
::std::vector<rtl::OUString> FieldContext::GetCommandParts() const
{
::std::vector<rtl::OUString> aResult;
@@ -1738,10 +1738,10 @@ void FieldContext::AppendCommand(const ::rtl::OUString& rPart)
{
OUString sToken = GetCommand().getToken(0, ' ', nIndex);
bool bInStringNext = bInString;
-
+
if (sToken.getLength() == 0)
continue;
-
+
if (sToken.getStr()[0] == '"')
{
bInStringNext = true;
@@ -1760,30 +1760,30 @@ void FieldContext::AppendCommand(const ::rtl::OUString& rPart)
sPart += OUString(' ');
sPart += sToken;
}
- else
+ else
{
sPart += sToken;
aResult.push_back(sPart);
}
}
- else
+ else
{
if (bInStringNext)
{
sPart = sToken;
}
- else
+ else
{
aResult.push_back(sToken);
}
}
-
+
bInString = bInStringNext;
}
-
+
return aResult;
}
-
+
/*-- 29.01.2007 11:33:15---------------------------------------------------
//collect the pieces of the command
-----------------------------------------------------------------------*/
@@ -1794,7 +1794,7 @@ void DomainMapper_Impl::AppendFieldCommand(::rtl::OUString& rPartOfCommand)
dmapper_logger->chars(rPartOfCommand);
dmapper_logger->endElement();
#endif
-
+
FieldContextPtr pContext = m_aFieldStack.top();
OSL_ENSURE( pContext.get(), "no field context available");
if( pContext.get() )
@@ -1805,7 +1805,7 @@ void DomainMapper_Impl::AppendFieldCommand(::rtl::OUString& rPartOfCommand)
/*-- 13.12.2007 11:45:43---------------------------------------------------
-----------------------------------------------------------------------*/
-typedef std::multimap < sal_Int32, ::rtl::OUString > TOCStyleMap;
+typedef std::multimap < sal_Int32, ::rtl::OUString > TOCStyleMap;
const FieldConversionMap_t & lcl_GetFieldConversion()
{
@@ -1885,9 +1885,9 @@ if(!bFilled)
bFilled = true;
}
-
+
return aFieldConversionMap;
-}
+}
void DomainMapper_Impl::handleFieldAsk
(FieldContextPtr pContext,
@@ -1898,12 +1898,12 @@ void DomainMapper_Impl::handleFieldAsk
//doesn the command contain a variable name?
::rtl::OUString sVariable, sHint;
- sVariable = lcl_ExctractAskVariableAndHint( pContext->GetCommand(),
+ sVariable = lcl_ExctractAskVariableAndHint( pContext->GetCommand(),
sHint );
if(sVariable.getLength())
{
// determine field master name
- uno::Reference< beans::XPropertySet > xMaster =
+ uno::Reference< beans::XPropertySet > xMaster =
FindOrCreateFieldMaster
("com.sun.star.text.FieldMaster.SetExpression", sVariable );
@@ -1935,7 +1935,7 @@ void DomainMapper_Impl::handleAutoNum
uno::Reference< beans::XPropertySet > xFieldProperties)
{
//create a sequence field master "AutoNr"
- uno::Reference< beans::XPropertySet > xMaster =
+ uno::Reference< beans::XPropertySet > xMaster =
FindOrCreateFieldMaster
("com.sun.star.text.FieldMaster.SetExpression",
rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("AutoNr") ));
@@ -1961,16 +1961,16 @@ void DomainMapper_Impl::handleAuthor
{
xFieldProperties->setPropertyValue
( rPropNameSupplier.GetName(PROP_FULL_NAME), uno::makeAny( true ));
- ::rtl::OUString sParam =
+ ::rtl::OUString sParam =
lcl_ExtractParameter(pContext->GetCommand(), sizeof(" AUTHOR") );
if(sParam.getLength())
{
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName( PROP_IS_FIXED ),
+ rPropNameSupplier.GetName( PROP_IS_FIXED ),
uno::makeAny( true ));
//PROP_CURRENT_PRESENTATION is set later anyway
}
-}
+}
void DomainMapper_Impl::handleDocProperty
(FieldContextPtr pContext,
@@ -1980,9 +1980,9 @@ void DomainMapper_Impl::handleAuthor
{
//some docproperties should be imported as document statistic fields, some as DocInfo fields
//others should be user fields
- ::rtl::OUString sParam =
+ ::rtl::OUString sParam =
lcl_ExtractParameter(pContext->GetCommand(), sizeof(" DOCPROPERTY") );
-
+
if(sParam.getLength())
{
#define SET_ARABIC 0x01
@@ -2020,12 +2020,12 @@ void DomainMapper_Impl::handleAuthor
//search for a field mapping
::rtl::OUString sFieldServiceName;
sal_uInt16 nMap = 0;
- for( ; nMap < sizeof(aDocProperties) / sizeof(DocPropertyMap);
+ for( ; nMap < sizeof(aDocProperties) / sizeof(DocPropertyMap);
++nMap )
{
if(sParam.equalsAscii(aDocProperties[nMap].pDocPropertyName))
{
- sFieldServiceName =
+ sFieldServiceName =
::rtl::OUString::createFromAscii
(aDocProperties[nMap].pServiceName);
break;
@@ -2037,7 +2037,7 @@ void DomainMapper_Impl::handleAuthor
if(!sFieldServiceName.getLength())
{
//create a custom property field
- sServiceName +=
+ sServiceName +=
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("DocInfo.Custom"));
bIsCustomField = true;
}
@@ -2046,8 +2046,8 @@ void DomainMapper_Impl::handleAuthor
sServiceName += sFieldServiceName;
}
xFieldInterface = m_xTextFactory->createInstance(sServiceName);
- xFieldProperties =
- uno::Reference< beans::XPropertySet >( xFieldInterface,
+ xFieldProperties =
+ uno::Reference< beans::XPropertySet >( xFieldInterface,
uno::UNO_QUERY_THROW);
if( bIsCustomField )
xFieldProperties->setPropertyValue(
@@ -2060,7 +2060,7 @@ void DomainMapper_Impl::handleAuthor
uno::makeAny( style::NumberingType::ARABIC ));
else if(0 != (aDocProperties[nMap].nFlags & SET_FULL_NAME))
xFieldProperties->setPropertyValue(
- rPropNameSupplier.GetName(PROP_FULL_NAME),
+ rPropNameSupplier.GetName(PROP_FULL_NAME),
uno::makeAny( true ));
}
}
@@ -2178,7 +2178,7 @@ void DomainMapper_Impl::handleToc
( bTableOfFigures ?
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM
("com.sun.star.text.IllustrationsIndex"))
- : sTOCServiceName),
+ : sTOCServiceName),
uno::UNO_QUERY_THROW);
xTOC->setPropertyValue(rPropNameSupplier.GetName( PROP_TITLE ), uno::makeAny(::rtl::OUString()));
if( !bTableOfFigures )
@@ -2291,14 +2291,14 @@ void DomainMapper_Impl::CloseFieldCommand()
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->element("closeFieldCommand");
#endif
-
+
FieldContextPtr pContext = m_aFieldStack.top();
OSL_ENSURE( pContext.get(), "no field context available");
if( pContext.get() )
{
m_bSetUserFieldContent = false;
FieldConversionMap_t aFieldConversionMap = lcl_GetFieldConversion();
-
+
try
{
uno::Reference< uno::XInterface > xFieldInterface;
@@ -2336,7 +2336,7 @@ void DomainMapper_Impl::CloseFieldCommand()
dmapper_logger->chars(sServiceName);
dmapper_logger->endElement();
#endif
-
+
xFieldInterface = m_xTextFactory->createInstance(sServiceName);
xFieldProperties = uno::Reference< beans::XPropertySet >( xFieldInterface, uno::UNO_QUERY_THROW);
}
@@ -2418,11 +2418,11 @@ void DomainMapper_Impl::CloseFieldCommand()
break;
case FIELD_FILESIZE : break;
case FIELD_FORMULA : break;
- case FIELD_FORMCHECKBOX :
+ case FIELD_FORMCHECKBOX :
{
- FFDataHandler::Pointer_t
+ FFDataHandler::Pointer_t
pFFDataHandler(pContext->getFFDataHandler());
- FormControlHelper::Pointer_t
+ FormControlHelper::Pointer_t
pFormControlHelper(new FormControlHelper
(FIELD_FORMCHECKBOX,
m_xTextDocument, pFFDataHandler));
@@ -2454,16 +2454,16 @@ void DomainMapper_Impl::CloseFieldCommand()
::std::vector<rtl::OUString>::const_iterator aPartIt = aParts.begin();
OUString sURL;
-
- while (aPartIt != aItEnd)
+
+ while (aPartIt != aItEnd)
{
if (aPartIt->equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("\\l")))
{
aPartIt++;
-
+
if (aPartIt == aItEnd)
break;
-
+
sURL = OUString('#');
sURL += *aPartIt;
}
@@ -2475,18 +2475,18 @@ void DomainMapper_Impl::CloseFieldCommand()
aPartIt->equalsAsciiL(RTL_CONSTASCII_STRINGPARAM("\\t")))
{
aPartIt++;
-
+
if (aPartIt == aItEnd)
break;
}
- else
+ else
{
sURL = *aPartIt;
}
aPartIt++;
}
-
+
if (sURL.getLength() > 0)
{
pContext->SetHyperlinkURL(sURL);
@@ -2630,7 +2630,7 @@ void DomainMapper_Impl::CloseFieldCommand()
case FIELD_USERNAME : //todo: user name is firstname + lastname
break;
case FIELD_TOC:
- handleToc(pContext, rPropNameSupplier, xFieldInterface, xFieldProperties,
+ handleToc(pContext, rPropNameSupplier, xFieldInterface, xFieldProperties,
::rtl::OUString::createFromAscii(aIt->second.cFieldServiceName));
break;
case FIELD_TC :
@@ -2709,7 +2709,7 @@ void DomainMapper_Impl::SetFieldResult( ::rtl::OUString& rResult )
dmapper_logger->startElement("setFieldResult");
dmapper_logger->chars(rResult);
#endif
-
+
FieldContextPtr pContext = m_aFieldStack.top();
OSL_ENSURE( pContext.get(), "no field context available");
if( pContext.get() )
@@ -2760,13 +2760,13 @@ void DomainMapper_Impl::SetFieldFFData(FFDataHandler::Pointer_t pFFDataHandler)
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->startElement("setFieldFFData");
#endif
-
+
FieldContextPtr pContext = m_aFieldStack.top();
if (pContext.get())
{
pContext->setFFDataHandler(pFFDataHandler);
}
-
+
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->endElement();
#endif
@@ -2780,7 +2780,7 @@ void DomainMapper_Impl::PopFieldContext()
#ifdef DEBUG_DOMAINMAPPER
dmapper_logger->element("popFieldContext");
#endif
-
+
FieldContextPtr pContext = m_aFieldStack.top();
OSL_ENSURE( pContext.get(), "no field context available");
if( pContext.get() )
@@ -2814,19 +2814,19 @@ void DomainMapper_Impl::PopFieldContext()
uno::Reference< text::XTextAppendAndConvert > xTextAppendAndConvert( xTextAppend, uno::UNO_QUERY_THROW );
xTextAppendAndConvert->appendTextContent( xToInsert, uno::Sequence< beans::PropertyValue >() );
}
- else
+ else
{
FormControlHelper::Pointer_t pFormControlHelper(pContext->getFormControlHelper());
if (pFormControlHelper.get() != NULL)
{
uno::Reference<text::XTextRange> xTxtRange(xCrsr, uno::UNO_QUERY);
pFormControlHelper->insertControl(xTxtRange);
- }
+ }
else if(pContext->GetHyperlinkURL().getLength())
{
PropertyNameSupplier& rPropNameSupplier = PropertyNameSupplier::GetPropertyNameSupplier();
xCrsr->gotoEnd( true );
-
+
uno::Reference< beans::XPropertySet > xCrsrProperties( xCrsr, uno::UNO_QUERY_THROW );
xCrsrProperties->setPropertyValue(rPropNameSupplier.GetName(PROP_HYPER_LINK_U_R_L), uno::
makeAny(pContext->GetHyperlinkURL()));
@@ -3057,7 +3057,7 @@ void DomainMapper_Impl::AddNewRedline( )
{
RedlineParamsPtr pNew( new RedlineParams );
pNew->m_nToken = ooxml::OOXML_mod;
- if ( !m_bIsParaChange )
+ if ( !m_bIsParaChange )
{
m_aRedlines.push_back( pNew );
}
@@ -3135,7 +3135,7 @@ void DomainMapper_Impl::ResetParaRedline( )
}
/*-- 22.09.2009 10:26:19---------------------------------------------------
-
+
-----------------------------------------------------------------------*/
void DomainMapper_Impl::ApplySettingsTable()
{
@@ -3150,8 +3150,8 @@ void DomainMapper_Impl::ApplySettingsTable()
}
catch(const uno::Exception& )
{
- }
- }
+ }
+ }
}
SectionPropertyMap * DomainMapper_Impl::GetSectionContext()
@@ -3164,7 +3164,7 @@ SectionPropertyMap * DomainMapper_Impl::GetSectionContext()
OSL_ENSURE(pContext.get(), "Section context is not in the stack!");
pSectionContext = dynamic_cast< SectionPropertyMap* >( pContext.get() );
}
-
+
return pSectionContext;
}
More information about the Libreoffice-commits
mailing list