You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by ms...@apache.org on 2023/10/03 07:11:21 UTC
[openoffice] 01/02: Fixed typos, fixed mixed indentation, removerd whitespace
This is an automated email from the ASF dual-hosted git repository.
mseidel pushed a commit to branch AOO42X
in repository https://gitbox.apache.org/repos/asf/openoffice.git
commit 1784980f80fba1c003099c33ef3d34aa6779d108
Author: mseidel <ms...@apache.org>
AuthorDate: Tue Oct 3 09:09:08 2023 +0200
Fixed typos, fixed mixed indentation, removerd whitespace
(cherry picked from commit f667543289ac266f8a98fbe20467995f22658975)
---
main/automation/source/app/testbasi.cxx | 18 +-
main/automation/source/app/testbasi.hxx | 12 +-
main/automation/source/server/XMLParser.cxx | 371 +--
main/basic/inc/basic/mybasic.hxx | 26 +-
main/filter/source/msfilter/svdfppt.cxx | 1017 ++++----
.../source/win32/filepicker/asyncrequests.hxx | 292 +--
main/l10ntools/source/tagtest.cxx | 297 +--
main/sw/source/core/text/pormulti.cxx | 1632 ++++++-------
main/sw/source/ui/wrtsh/wrtsh1.cxx | 554 ++---
main/vcl/inc/vcl/pdfwriter.hxx | 2421 ++++++++++----------
.../xmerge/converter/palm/PalmDocument.java | 31 +-
11 files changed, 3341 insertions(+), 3330 deletions(-)
diff --git a/main/automation/source/app/testbasi.cxx b/main/automation/source/app/testbasi.cxx
index 784114abfc..1a6851c196 100644
--- a/main/automation/source/app/testbasi.cxx
+++ b/main/automation/source/app/testbasi.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -81,7 +81,7 @@ TTBasic::TTBasic() : MyBasic()
pTTO->SetWriteStringHdl( GenWriteStringHdl() );
pTTO->SetCErrorHdl( LINK( this, TTBasic, CErrorImpl ) );
- StartListeningTT( pTTO->GetTTBroadcaster() );
+ StartListeningTT( pTTO->GetTTBroadcaster() );
pTestObject = pTTO;
pTestObject->SetFlag( SBX_EXTSEARCH );
@@ -125,7 +125,7 @@ sal_Bool TTBasic::Compile( SbModule* p )
return MyBasic::Compile( p );
}
-const String TTBasic::GetSpechialErrorText()
+const String TTBasic::GetSpecialErrorText()
{
String nErrorText;
if ( pTestObject && IS_ERROR() && GetErrorCode() == GET_ERROR()->nError )
@@ -144,9 +144,9 @@ const String TTBasic::GetSpechialErrorText()
void TTBasic::ReportRuntimeError( AppBasEd *pEditWin )
{
SbxVariableRef aDummy = new SbxVariable;
- aDummy->SetUserData( 24 ); // ID_MaybeAddErr
+ aDummy->SetUserData( 24 ); // ID_MaybeAddErr
((TestToolObj*)pTestObject)->Notify( pTestObject->GetBroadcaster(), SbxHint( SBX_HINT_DATAWANTED, aDummy ) );
- aDummy->SetUserData( 18 ); // ID_ExceptLog
+ aDummy->SetUserData( 18 ); // ID_ExceptLog
((TestToolObj*)pTestObject)->Notify( pTestObject->GetBroadcaster(), SbxHint( SBX_HINT_DATAWANTED, aDummy ) );
MyBasic::ReportRuntimeError( pEditWin );
}
@@ -155,3 +155,5 @@ void TTBasic::DebugFindNoErrors( sal_Bool bDebugFindNoErrors )
{
((TestToolObj*)pTestObject)->DebugFindNoErrors( bDebugFindNoErrors );
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/automation/source/app/testbasi.hxx b/main/automation/source/app/testbasi.hxx
index 9f70aef51a..939afa3aee 100644
--- a/main/automation/source/app/testbasi.hxx
+++ b/main/automation/source/app/testbasi.hxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -50,7 +50,7 @@ public:
void LoadIniFile();
SbTextType GetSymbolType( const String &Symbol, sal_Bool bWasTTControl ); // Besimmt den erweiterten Symboltyp f�r das Syntaxhighlighting
- virtual const String GetSpechialErrorText();
+ virtual const String GetSpecialErrorText();
virtual void ReportRuntimeError( AppBasEd *pEditWin );
virtual void DebugFindNoErrors( sal_Bool bDebugFindNoErrors );
};
@@ -58,3 +58,5 @@ public:
SV_DECL_IMPL_REF(TTBasic)
#endif
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/automation/source/server/XMLParser.cxx b/main/automation/source/server/XMLParser.cxx
index 00562c382b..8370e57cc6 100644
--- a/main/automation/source/server/XMLParser.cxx
+++ b/main/automation/source/server/XMLParser.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -51,53 +51,53 @@ using namespace rtl;
class SVInputStream : public cppu::WeakImplHelper1< XInputStream >
{
- SvStream* pStream;
+ SvStream* pStream;
public:
- SVInputStream( SvStream* pSt ):pStream( pSt ){};
- ~SVInputStream(){ delete pStream; pStream=NULL; }
-
- // Methods XInputStream
- virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual sal_Int32 SAL_CALL available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ SVInputStream( SvStream* pSt ):pStream( pSt ){};
+ ~SVInputStream(){ delete pStream; pStream=NULL; }
+
+ // Methods XInputStream
+ virtual sal_Int32 SAL_CALL readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL skipBytes( sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual sal_Int32 SAL_CALL available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException);
};
sal_Int32 SAL_CALL SVInputStream::readBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
{
- aData.realloc( nBytesToRead );
- sal_Int32 nRead = pStream->Read( aData.getArray(), nBytesToRead );
- aData.realloc( nRead );
- return nRead;
+ aData.realloc( nBytesToRead );
+ sal_Int32 nRead = pStream->Read( aData.getArray(), nBytesToRead );
+ aData.realloc( nRead );
+ return nRead;
}
sal_Int32 SAL_CALL SVInputStream::readSomeBytes( ::com::sun::star::uno::Sequence< sal_Int8 >& aData, sal_Int32 nMaxBytesToRead ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
{
- return readBytes( aData, nMaxBytesToRead );
+ return readBytes( aData, nMaxBytesToRead );
}
void SAL_CALL SVInputStream::skipBytes( sal_Int32 nBytesToSkip ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::BufferSizeExceededException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
{
- if ( nBytesToSkip > 0 )
- pStream->SeekRel( nBytesToSkip );
+ if ( nBytesToSkip > 0 )
+ pStream->SeekRel( nBytesToSkip );
}
sal_Int32 SAL_CALL SVInputStream::available( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
{
- sal_uLong nCurrent = pStream->Tell();
- sal_uLong nSize = pStream->Seek( STREAM_SEEK_TO_END );
- sal_uLong nAvailable = nSize - nCurrent;
- pStream->Seek( nCurrent );
- return nAvailable;
+ sal_uLong nCurrent = pStream->Tell();
+ sal_uLong nSize = pStream->Seek( STREAM_SEEK_TO_END );
+ sal_uLong nAvailable = nSize - nCurrent;
+ pStream->Seek( nCurrent );
+ return nAvailable;
}
void SAL_CALL SVInputStream::closeInput( ) throw (::com::sun::star::io::NotConnectedException, ::com::sun::star::io::IOException, ::com::sun::star::uno::RuntimeException)
{
-// pStream->Close(); // automatically done in destructor
- delete pStream;
- pStream = NULL;
+// pStream->Close(); // automatically done in destructor
+ delete pStream;
+ pStream = NULL;
}
class Node;
@@ -109,17 +109,17 @@ enum NodeType { NODE_CHARACTER = CONST_NodeTypeCharacter,
class Node : public SvRefBase
{
- NodeType aNodeType;
- Node* pParent; // Use pointer to prevent cyclic references resulting in undeleted objects
+ NodeType aNodeType;
+ Node* pParent; // Use pointer to prevent cyclic references resulting in undeleted objects
protected:
- Node( NodeType aType ): aNodeType( aType ), pParent( NULL ){};
- virtual ~Node();
+ Node( NodeType aType ): aNodeType( aType ), pParent( NULL ){};
+ virtual ~Node();
public:
- NodeType GetNodeType() { return aNodeType; }
- void SetParent( NodeRef xNewParent );
- NodeRef GetParent();
+ NodeType GetNodeType() { return aNodeType; }
+ void SetParent( NodeRef xNewParent );
+ NodeRef GetParent();
};
SV_IMPL_REF(Node)
@@ -132,61 +132,61 @@ Node::~Node()
void Node::SetParent( NodeRef xNewParent )
{
- pParent = &xNewParent;
+ pParent = &xNewParent;
}
NodeRef Node::GetParent()
{
- return NodeRef( pParent );
+ return NodeRef( pParent );
}
class CharacterNode : public Node
{
- String aCharacters;
+ String aCharacters;
public:
- CharacterNode( const String& aChars ): Node( NODE_CHARACTER ), aCharacters( aChars ){};
+ CharacterNode( const String& aChars ): Node( NODE_CHARACTER ), aCharacters( aChars ){};
- String GetCharacters() { return aCharacters; }
+ String GetCharacters() { return aCharacters; }
};
class ElementNode : public Node
{
- String aNodeName;
- Reference < XAttributeList > xAttributeList;
- NodeRefMemberList aDocumentNodeList;
+ String aNodeName;
+ Reference < XAttributeList > xAttributeList;
+ NodeRefMemberList aDocumentNodeList;
public:
- ElementNode( const String& aName, Reference < XAttributeList > xAttributes );
- void AppendNode( NodeRef xNewNode );
- sal_uLong GetChildCount(){ return aDocumentNodeList.Count(); }
- NodeRef GetChild( sal_uInt16 nIndex ){ return aDocumentNodeList.GetObject( nIndex ); }
- Reference < XAttributeList > GetAttributes(){ return xAttributeList; }
+ ElementNode( const String& aName, Reference < XAttributeList > xAttributes );
+ void AppendNode( NodeRef xNewNode );
+ sal_uLong GetChildCount(){ return aDocumentNodeList.Count(); }
+ NodeRef GetChild( sal_uInt16 nIndex ){ return aDocumentNodeList.GetObject( nIndex ); }
+ Reference < XAttributeList > GetAttributes(){ return xAttributeList; }
- String GetNodeName() { return aNodeName; }
+ String GetNodeName() { return aNodeName; }
};
ElementNode::ElementNode( const String& aName, Reference < XAttributeList > xAttributes )
: Node( NODE_ELEMENT )
, aNodeName( aName )
{
- if ( xAttributes.is() )
- {
- Reference < XCloneable > xAttributeCloner( xAttributes, UNO_QUERY );
- if ( xAttributeCloner.is() )
- xAttributeList = Reference < XAttributeList > ( xAttributeCloner->createClone() , UNO_QUERY );
- else
- {
- DBG_ERROR("Unable to clone AttributeList");
- }
- }
+ if ( xAttributes.is() )
+ {
+ Reference < XCloneable > xAttributeCloner( xAttributes, UNO_QUERY );
+ if ( xAttributeCloner.is() )
+ xAttributeList = Reference < XAttributeList > ( xAttributeCloner->createClone() , UNO_QUERY );
+ else
+ {
+ DBG_ERROR("Unable to clone AttributeList");
+ }
+ }
};
void ElementNode::AppendNode( NodeRef xNewNode )
{
- aDocumentNodeList.Insert ( xNewNode, LIST_APPEND );
- xNewNode->SetParent( this );
+ aDocumentNodeList.Insert ( xNewNode, LIST_APPEND );
+ xNewNode->SetParent( this );
}
-// XIndexAccess
+// XIndexAccess
@@ -196,149 +196,149 @@ enum ParseAction { COLLECT_DATA, COLLECT_DATA_IGNORE_WHITESPACE, PARSE_ONLY };
class SAXParser : public cppu::WeakImplHelper2< XErrorHandler, XDocumentHandler >
{
- String aFilename;
- Reference < XParser > xParser;
+ String aFilename;
+ Reference < XParser > xParser;
- // XErrorHandler
- void AddToList( const sal_Char* cuType, const ::com::sun::star::uno::Any& aSAXParseException );
- String aErrors;
+ // XErrorHandler
+ void AddToList( const sal_Char* cuType, const ::com::sun::star::uno::Any& aSAXParseException );
+ String aErrors;
- NodeRef xTreeRoot;
- NodeRef xCurrentNode;
- sal_uLong nTimestamp;
- ParseAction aAction;
+ NodeRef xTreeRoot;
+ NodeRef xCurrentNode;
+ sal_uLong nTimestamp;
+ ParseAction aAction;
public:
- SAXParser( const String &rFilename );
- ~SAXParser();
-
- // Access Methods
- NodeRef GetCurrentNode(){ return xCurrentNode; }
- void SetCurrentNode( NodeRef xCurrent ){ xCurrentNode = xCurrent; }
- NodeRef GetRootNode(){ return xTreeRoot; }
- sal_uLong GetTimestamp(){ return nTimestamp; }
- void Touch(){ nTimestamp = Time::GetSystemTicks(); }
-
- // Methods SAXParser
- sal_Bool Parse( ParseAction aAct );
- String GetErrors(){ return aErrors; }
-
- // Methods XErrorHandler
- virtual void SAL_CALL error( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL fatalError( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL warning( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
-
- // Methods XDocumentHandler
- virtual void SAL_CALL startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL endElement( const ::rtl::OUString& aName ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
- virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ SAXParser( const String &rFilename );
+ ~SAXParser();
+
+ // Access Methods
+ NodeRef GetCurrentNode(){ return xCurrentNode; }
+ void SetCurrentNode( NodeRef xCurrent ){ xCurrentNode = xCurrent; }
+ NodeRef GetRootNode(){ return xTreeRoot; }
+ sal_uLong GetTimestamp(){ return nTimestamp; }
+ void Touch(){ nTimestamp = Time::GetSystemTicks(); }
+
+ // Methods SAXParser
+ sal_Bool Parse( ParseAction aAct );
+ String GetErrors(){ return aErrors; }
+
+ // Methods XErrorHandler
+ virtual void SAL_CALL error( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL fatalError( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL warning( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+
+ // Methods XDocumentHandler
+ virtual void SAL_CALL startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL startElement( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL endElement( const ::rtl::OUString& aName ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL characters( const ::rtl::OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
+ virtual void SAL_CALL setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException);
};
SAXParser::SAXParser( const String &rFilename )
: aFilename( rFilename )
{
- Touch();
+ Touch();
}
SAXParser::~SAXParser()
{
- xParser.clear();
+ xParser.clear();
}
sal_Bool SAXParser::Parse( ParseAction aAct )
{
- aAction = aAct;
- Touch();
- SvStream* pStream = new SvFileStream( aFilename, STREAM_STD_READ );
- if ( pStream->GetError() )
- return sal_False;
-
- InputSource sSource;
- sSource.aInputStream = new SVInputStream( pStream ); // is refcounted and hence deletet appropriately
- sSource.sPublicId = OUString( aFilename );
-
- xParser = Reference < XParser > ( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.xml.sax.Parser") ), UNO_QUERY );
- if ( xParser.is() )
- {
- xParser->setErrorHandler( ( XErrorHandler*) this );
- if ( aAction == COLLECT_DATA || aAction == COLLECT_DATA_IGNORE_WHITESPACE )
- xParser->setDocumentHandler( ( XDocumentHandler*) this );
-
- try
- {
- xParser->parseStream ( sSource );
- }
- catch( class SAXParseException & rPEx)
- {
+ aAction = aAct;
+ Touch();
+ SvStream* pStream = new SvFileStream( aFilename, STREAM_STD_READ );
+ if ( pStream->GetError() )
+ return sal_False;
+
+ InputSource sSource;
+ sSource.aInputStream = new SVInputStream( pStream ); // is refcounted and hence deleted appropriately
+ sSource.sPublicId = OUString( aFilename );
+
+ xParser = Reference < XParser > ( ::comphelper::getProcessServiceFactory()->createInstance( CUniString("com.sun.star.xml.sax.Parser") ), UNO_QUERY );
+ if ( xParser.is() )
+ {
+ xParser->setErrorHandler( ( XErrorHandler*) this );
+ if ( aAction == COLLECT_DATA || aAction == COLLECT_DATA_IGNORE_WHITESPACE )
+ xParser->setDocumentHandler( ( XDocumentHandler*) this );
+
+ try
+ {
+ xParser->parseStream ( sSource );
+ }
+ catch( class SAXParseException & rPEx)
+ {
#ifdef DBG_ERROR
- String aMemo( rPEx.Message );
- aMemo = String( aMemo );
+ String aMemo( rPEx.Message );
+ aMemo = String( aMemo );
#endif
- }
- catch( class Exception & rEx)
- {
+ }
+ catch( class Exception & rEx)
+ {
#ifdef DBG_ERROR
- String aMemo( rEx.Message );
- aMemo = String( aMemo );
+ String aMemo( rEx.Message );
+ aMemo = String( aMemo );
#endif
- }
- xParser->setErrorHandler( NULL ); // otherwile Object holds itself
- if ( aAction == COLLECT_DATA || aAction == COLLECT_DATA_IGNORE_WHITESPACE )
- xParser->setDocumentHandler( NULL ); // otherwile Object holds itself
- }
- else
- return sal_False;
- return sal_True;
+ }
+ xParser->setErrorHandler( NULL ); // otherwise Object holds itself
+ if ( aAction == COLLECT_DATA || aAction == COLLECT_DATA_IGNORE_WHITESPACE )
+ xParser->setDocumentHandler( NULL ); // otherwise Object holds itself
+ }
+ else
+ return sal_False;
+ return sal_True;
}
// Helper Methods XErrorHandler
void SAXParser::AddToList( const sal_Char* cuType, const ::com::sun::star::uno::Any& aSAXParseException )
{
- SAXParseException aException;
- aSAXParseException >>= aException;
-
- aErrors.Append( String( aException.PublicId ) );
- aErrors.AppendAscii( "(" );
- aErrors.Append( String::CreateFromInt64( aException.LineNumber ) );
- aErrors.AppendAscii( ":" );
- aErrors.Append( String::CreateFromInt64( aException.ColumnNumber ) );
- aErrors.AppendAscii( ") : " );
- aErrors.AppendAscii( cuType );
- aErrors.AppendAscii( ": " );
- aErrors.Append( String( aException.Message ) );
- aErrors.AppendAscii( "\n" );
+ SAXParseException aException;
+ aSAXParseException >>= aException;
+
+ aErrors.Append( String( aException.PublicId ) );
+ aErrors.AppendAscii( "(" );
+ aErrors.Append( String::CreateFromInt64( aException.LineNumber ) );
+ aErrors.AppendAscii( ":" );
+ aErrors.Append( String::CreateFromInt64( aException.ColumnNumber ) );
+ aErrors.AppendAscii( ") : " );
+ aErrors.AppendAscii( cuType );
+ aErrors.AppendAscii( ": " );
+ aErrors.Append( String( aException.Message ) );
+ aErrors.AppendAscii( "\n" );
}
// Methods XErrorHandler
void SAL_CALL SAXParser::error( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- AddToList( "error", aSAXParseException );
+ AddToList( "error", aSAXParseException );
}
void SAL_CALL SAXParser::fatalError( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- AddToList( "fatal error", aSAXParseException );
+ AddToList( "fatal error", aSAXParseException );
}
void SAL_CALL SAXParser::warning( const ::com::sun::star::uno::Any& aSAXParseException ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- AddToList( "warning", aSAXParseException );
+ AddToList( "warning", aSAXParseException );
}
// Methods XDocumentHandler
void SAXParser::startDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- xTreeRoot = new ElementNode( CUniString("/"), Reference < XAttributeList > (NULL) );
- xCurrentNode = xTreeRoot;
- Touch();
+ xTreeRoot = new ElementNode( CUniString("/"), Reference < XAttributeList > (NULL) );
+ xCurrentNode = xTreeRoot;
+ Touch();
}
void SAXParser::endDocument( ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
@@ -347,23 +347,23 @@ void SAXParser::endDocument( ) throw (::com::sun::star::xml::sax::SAXException,
void SAXParser::startElement( const ::rtl::OUString& aName, const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XAttributeList >& xAttribs ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- NodeRef xNewNode = new ElementNode ( String(aName), xAttribs );
- ((ElementNode*)(&xCurrentNode))->AppendNode( xNewNode );
- xCurrentNode = xNewNode;
+ NodeRef xNewNode = new ElementNode ( String(aName), xAttribs );
+ ((ElementNode*)(&xCurrentNode))->AppendNode( xNewNode );
+ xCurrentNode = xNewNode;
}
void SAXParser::endElement( const ::rtl::OUString& aName ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- (void) aName; /* avoid warning about unused parameter */
- xCurrentNode = xCurrentNode->GetParent();
+ (void) aName; /* avoid warning about unused parameter */
+ xCurrentNode = xCurrentNode->GetParent();
}
void SAXParser::characters( const ::rtl::OUString& aChars ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- if ( aAction == COLLECT_DATA_IGNORE_WHITESPACE )
- { // check for whitespace
- sal_Bool bAllWhitespace = sal_True;
- for ( int i = 0 ; bAllWhitespace && i < aChars.getLength() ; i++ )
+ if ( aAction == COLLECT_DATA_IGNORE_WHITESPACE )
+ { // check for whitespace
+ sal_Bool bAllWhitespace = sal_True;
+ for ( int i = 0 ; bAllWhitespace && i < aChars.getLength() ; i++ )
if ( aChars[i] != 10 // LF
&& aChars[i] != 13 // CR
&& aChars[i] != ' ' // Blank
@@ -371,29 +371,29 @@ void SAXParser::characters( const ::rtl::OUString& aChars ) throw (::com::sun::s
bAllWhitespace = sal_False;
if ( bAllWhitespace )
return;
- }
- NodeRef xNewNode = new CharacterNode ( String(aChars) );
- ((ElementNode*)(&xCurrentNode))->AppendNode( xNewNode );
+ }
+ NodeRef xNewNode = new CharacterNode ( String(aChars) );
+ ((ElementNode*)(&xCurrentNode))->AppendNode( xNewNode );
}
void SAXParser::ignorableWhitespace( const ::rtl::OUString& aWhitespaces ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- (void) aWhitespaces; /* avoid warning about unused parameter */
+ (void) aWhitespaces; /* avoid warning about unused parameter */
}
void SAXParser::processingInstruction( const ::rtl::OUString& aTarget, const ::rtl::OUString& aData ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- (void) aTarget; /* avoid warning about unused parameter */
- (void) aData; /* avoid warning about unused parameter */
+ (void) aTarget; /* avoid warning about unused parameter */
+ (void) aData; /* avoid warning about unused parameter */
}
void SAXParser::setDocumentLocator( const ::com::sun::star::uno::Reference< ::com::sun::star::xml::sax::XLocator >& xLocator ) throw (::com::sun::star::xml::sax::SAXException, ::com::sun::star::uno::RuntimeException)
{
- (void) xLocator; /* avoid warning about unused parameter */
+ (void) xLocator; /* avoid warning about unused parameter */
#if OSL_DEBUG_LEVEL > 1
- ::rtl::OUString aTester;
- aTester = xLocator->getPublicId();
- aTester = xLocator->getSystemId();
+ ::rtl::OUString aTester;
+ aTester = xLocator->getPublicId();
+ aTester = xLocator->getSystemId();
#endif
}
@@ -402,15 +402,15 @@ void SAXParser::setDocumentLocator( const ::com::sun::star::uno::Reference< ::co
void StatementCommand::HandleSAXParser()
{
- static Reference < XReference > xParserKeepaliveReference; // this is to keep the Object alive only
- static SAXParser* pSAXParser;
+ static Reference < XReference > xParserKeepaliveReference; // this is to keep the Object alive only
+ static SAXParser* pSAXParser;
- // We need spechial prerequisites for these!
+ // We need special prerequisites for these!
- ElementNode* pElementNode = NULL;
+ ElementNode* pElementNode = NULL;
switch ( nMethodId )
{
- case RC_SAXGetNodeType:
+ case RC_SAXGetNodeType:
case RC_SAXGetAttributeCount:
case RC_SAXGetAttributeName:
case RC_SAXGetAttributeValue:
@@ -418,7 +418,7 @@ void StatementCommand::HandleSAXParser()
case RC_SAXGetElementName:
case RC_SAXGetChars:
- case RC_SAXSeekElement:
+ case RC_SAXSeekElement:
case RC_SAXHasElement:
case RC_SAXGetElementPath:
{
@@ -686,6 +686,7 @@ void StatementCommand::HandleSAXParser()
break;
default:
ReportError( GEN_RES_STR1( S_INTERNAL_ERROR, RcString( nMethodId ) ) );
- }
+ }
}
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/basic/inc/basic/mybasic.hxx b/main/basic/inc/basic/mybasic.hxx
index ef1b626148..25711f6c9a 100644
--- a/main/basic/inc/basic/mybasic.hxx
+++ b/main/basic/inc/basic/mybasic.hxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -33,7 +33,7 @@ class ErrorEntry;
class BASIC_DLLPUBLIC BasicError {
AppBasEd* pWin;
- sal_uInt16 nLine, nCol1, nCol2;
+ sal_uInt16 nLine, nCol1, nCol2;
String aText;
public:
BasicError( AppBasEd*, sal_uInt16, const String&, sal_uInt16, sal_uInt16, sal_uInt16 );
@@ -47,7 +47,7 @@ DECLARE_LIST( ErrorList, BasicError* )
class BASIC_DLLPUBLIC MyBasic : public StarBASIC
{
- SbError nError;
+ SbError nError;
virtual sal_Bool ErrorHdl();
virtual sal_uInt16 BreakHdl();
@@ -55,7 +55,7 @@ protected:
Link GenLogHdl();
Link GenWinInfoHdl();
Link GenModuleWinExistsHdl();
- Link GenWriteStringHdl();
+ Link GenWriteStringHdl();
virtual void StartListeningTT( SfxBroadcaster &rBroadcaster );
@@ -71,14 +71,14 @@ public:
void Reset();
SbError GetErrors() { return nError; }
- // Do not use #ifdefs here because this header file is both used for testtool and basic
- SbxObject *pTestObject; // for Testool; otherwise NULL
+ // Do not use #ifdefs here because this header file is both used for testtool and basic
+ SbxObject *pTestObject; // for Testtool; otherwise NULL
virtual void LoadIniFile();
- // Determines the extended symbol type for syntax highlighting
- virtual SbTextType GetSymbolType( const String &Symbol, sal_Bool bWasTTControl );
- virtual const String GetSpechialErrorText();
+ // Determines the extended symbol type for syntax highlighting
+ virtual SbTextType GetSymbolType( const String &Symbol, sal_Bool bWasTTControl );
+ virtual const String GetSpecialErrorText();
virtual void ReportRuntimeError( AppBasEd *pEditWin );
virtual void DebugFindNoErrors( sal_Bool bDebugFindNoErrors );
@@ -89,3 +89,5 @@ public:
SV_DECL_IMPL_REF(MyBasic)
#endif
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/filter/source/msfilter/svdfppt.cxx b/main/filter/source/msfilter/svdfppt.cxx
index 3df82b2de9..c926a308c3 100644
--- a/main/filter/source/msfilter/svdfppt.cxx
+++ b/main/filter/source/msfilter/svdfppt.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -172,18 +172,18 @@
#define FIXED_PITCH 0x01
#define VARIABLE_PITCH 0x02
-using namespace ::com::sun::star ;
-using namespace uno ;
-using namespace beans ;
-using namespace drawing ;
-using namespace container ;
-using namespace table ;
+using namespace ::com::sun::star ;
+using namespace uno ;
+using namespace beans ;
+using namespace drawing ;
+using namespace container ;
+using namespace table ;
////////////////////////////////////////////////////////////////////////////////////////////////////
PowerPointImportParam::PowerPointImportParam( SvStream& rDocStrm, sal_uInt32 nFlags, MSFilterTracer* pT ) :
- rDocStream ( rDocStrm ),
- nImportFlags ( nFlags ),
+ rDocStream ( rDocStrm ),
+ nImportFlags ( nFlags ),
pTracer ( pT )
{
}
@@ -192,8 +192,8 @@ PowerPointImportParam::PowerPointImportParam( SvStream& rDocStrm, sal_uInt32 nFl
SvStream& operator>>( SvStream& rIn, PptCurrentUserAtom& rAtom )
{
- DffRecordHeader aHd;
- rIn >> aHd;
+ DffRecordHeader aHd;
+ rIn >> aHd;
if ( aHd.nRecType == PPT_PST_CurrentUserAtom )
{
sal_uInt32 nLen;
@@ -209,36 +209,36 @@ SvStream& operator>>( SvStream& rIn, PptCurrentUserAtom& rAtom )
SvxMSDffManager::MSDFFReadZString( rIn, rAtom.aCurrentUser, nUserNameLen, sal_True );
}
aHd.SeekToEndOfRecord( rIn );
- return rIn;
+ return rIn;
}
void PptSlidePersistAtom::Clear()
{
- nReserved = nPsrReference = nFlags = nNumberTexts = nSlideId = 0;
+ nReserved = nPsrReference = nFlags = nNumberTexts = nSlideId = 0;
}
SvStream& operator>>( SvStream& rIn, PptSlidePersistAtom& rAtom )
{
- DffRecordHeader aHd;
- rIn >> aHd
+ DffRecordHeader aHd;
+ rIn >> aHd
>> rAtom.nPsrReference
>> rAtom.nFlags
>> rAtom.nNumberTexts
>> rAtom.nSlideId;
// >> rAtom.nReserved;
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
+ aHd.SeekToEndOfRecord( rIn );
+ return rIn;
}
SV_IMPL_PTRARR(_PptSlidePersistList,PptSlidePersistEntry*);
sal_uInt16 PptSlidePersistList::FindPage(sal_uInt32 nId) const
{
- for ( sal_uInt16 i=0; i < Count(); i++ )
+ for ( sal_uInt16 i=0; i < Count(); i++ )
{
- if (operator[](i)->GetSlideId()==nId) return i;
- }
- return PPTSLIDEPERSIST_ENTRY_NOTFOUND;
+ if (operator[](i)->GetSlideId()==nId) return i;
+ }
+ return PPTSLIDEPERSIST_ENTRY_NOTFOUND;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -255,7 +255,7 @@ SvStream& operator>>( SvStream& rIn, PptInteractiveInfoAtom& rAtom )
>> rAtom.nUnknown1
>> rAtom.nUnknown2
>> rAtom.nUnknown3;
- return rIn;
+ return rIn;
}
SvStream& operator>>( SvStream& rIn, PptExOleObjAtom& rAtom )
@@ -273,36 +273,36 @@ Size PptDocumentAtom::GetPageSize(const Size& rSiz) const
{
return rSiz;
/*
- Size aRet;
- switch ( eSlidesPageFormat )
- {
- // Wenn man in PowerPoint als Seitenformat "Bildschirmgroesse"
- // einstellt, dann zeigt dieser Dialog zwar 24x18cm an, die
- // angezeigte Seite ist aber anders. Das sieht man, wenn man
- // ein Rechteck seitenfuellend aufzieht und sich dessen Groesse
- // ansieht. Die importierten Abmessungen sind auf jeden Fall
- // die, die auch im Ppt-File stehen. Ich denke, das es sich
- // hier eher um ein Bug in PowerPoint handelt, das im
- // Seitenformat-Dialog bei "Bildschirmgroesse" falsche Masse
- // angezeigt werden (vielleicht ja auch bildschirmabhaengig?).
-// case PPTPF_SCREEN : aRet.Width()=4082; aRet.Height()=5443; break;
+ Size aRet;
+ switch ( eSlidesPageFormat )
+ {
+ // Wenn man in PowerPoint als Seitenformat "Bildschirmgroesse"
+ // einstellt, dann zeigt dieser Dialog zwar 24x18cm an, die
+ // angezeigte Seite ist aber anders. Das sieht man, wenn man
+ // ein Rechteck seitenfuellend aufzieht und sich dessen Groesse
+ // ansieht. Die importierten Abmessungen sind auf jeden Fall
+ // die, die auch im Ppt-File stehen. Ich denke, das es sich
+ // hier eher um ein Bug in PowerPoint handelt, das im
+ // Seitenformat-Dialog bei "Bildschirmgroesse" falsche Masse
+ // angezeigt werden (vielleicht ja auch bildschirmabhaengig?).
+// case PPTPF_SCREEN : aRet.Width()=4082; aRet.Height()=5443; break;
case PPTPF_USLETTER: aRet.Width()=4896; aRet.Height()=6336; break;
case PPTPF_A4 : aRet.Width()=4762; aRet.Height()=6735; break;
-// case PPTPF_35MMDIA : aRet.Width()=4082; aRet.Height()=6123; break;
-// case PPTPF_OVERHEAD: aRet.Width()=4082; aRet.Height()=5443; break;
- }
- if ( aRet.Width() )
+// case PPTPF_35MMDIA : aRet.Width()=4082; aRet.Height()=6123; break;
+// case PPTPF_OVERHEAD: aRet.Width()=4082; aRet.Height()=5443; break;
+ }
+ if ( aRet.Width() )
{
- if ( rSiz.Width() > rSiz.Height() )
+ if ( rSiz.Width() > rSiz.Height() )
{ // Querformat
- long nMerk = aRet.Width();
- aRet.Width() = aRet.Height();
- aRet.Height() = nMerk;
- }
- }
+ long nMerk = aRet.Width();
+ aRet.Width() = aRet.Height();
+ aRet.Height() = nMerk;
+ }
+ }
else // CustomFormat oder Unbekannt oder Screen,Dia,Overhead
- aRet = rSiz;
- return aRet;
+ aRet = rSiz;
+ return aRet;
*/
}
@@ -321,12 +321,12 @@ SvStream& operator>>(SvStream& rIn, PptDocumentAtom& rAtom)
// 38 bRightToLeft 1
// 39 bShowComments 1
- DffRecordHeader aHd;
- sal_Int32 nSlideX,nSlideY, nNoticeX, nNoticeY, nDummy;
- sal_uInt16 nSlidePageFormat;
- sal_Int8 nEmbeddedTrueType, nTitlePlaceHoldersOmitted, nRightToLeft, nShowComments;
+ DffRecordHeader aHd;
+ sal_Int32 nSlideX,nSlideY, nNoticeX, nNoticeY, nDummy;
+ sal_uInt16 nSlidePageFormat;
+ sal_Int8 nEmbeddedTrueType, nTitlePlaceHoldersOmitted, nRightToLeft, nShowComments;
- rIn >> aHd
+ rIn >> aHd
>> nSlideX >> nSlideY
>> nNoticeX >> nNoticeY
>> nDummy >> nDummy // ZoomRation ueberspringen
@@ -344,111 +344,111 @@ SvStream& operator>>(SvStream& rIn, PptDocumentAtom& rAtom)
rAtom.aNotesPageSize.Height() = nNoticeY;
rAtom.eSlidesPageFormat = (PptPageFormat)nSlidePageFormat;
rAtom.bEmbeddedTrueType = nEmbeddedTrueType;
- rAtom.bTitlePlaceholdersOmitted = nTitlePlaceHoldersOmitted;
- rAtom.bRightToLeft = nRightToLeft;
- rAtom.bShowComments = nShowComments;
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
+ rAtom.bTitlePlaceholdersOmitted = nTitlePlaceHoldersOmitted;
+ rAtom.bRightToLeft = nRightToLeft;
+ rAtom.bShowComments = nShowComments;
+ aHd.SeekToEndOfRecord( rIn );
+ return rIn;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void PptSlideLayoutAtom::Clear()
{
- eLayout = 0;
- for ( sal_uInt16 i = 0; i < 8; i++ )
+ eLayout = 0;
+ for ( sal_uInt16 i = 0; i < 8; i++ )
{
- aPlaceholderId[ i ] = 0;
- aPlacementId[ i ] = 0;
- }
+ aPlaceholderId[ i ] = 0;
+ aPlacementId[ i ] = 0;
+ }
}
SvStream& operator>>( SvStream& rIn, PptSlideLayoutAtom& rAtom )
{
- rIn >> rAtom.eLayout;
- rIn.Read( rAtom.aPlaceholderId, 8 );
- return rIn;
+ rIn >> rAtom.eLayout;
+ rIn.Read( rAtom.aPlaceholderId, 8 );
+ return rIn;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
SvStream& operator>>( SvStream& rIn, PptSlideAtom& rAtom )
{
- DffRecordHeader aHd;
- rIn >> aHd
+ DffRecordHeader aHd;
+ rIn >> aHd
>> rAtom.aLayout
>> rAtom.nMasterId
>> rAtom.nNotesId
>> rAtom.nFlags;
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
+ aHd.SeekToEndOfRecord( rIn );
+ return rIn;
}
void PptSlideAtom::Clear()
{
- nMasterId = nNotesId = 0;
- nFlags = 0;
+ nMasterId = nNotesId = 0;
+ nFlags = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
SvStream& operator>>( SvStream& rIn, PptNotesAtom& rAtom )
{
- DffRecordHeader aHd;
- rIn >> aHd
+ DffRecordHeader aHd;
+ rIn >> aHd
>> rAtom.nSlideId
>> rAtom.nFlags;
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
+ aHd.SeekToEndOfRecord( rIn );
+ return rIn;
}
void PptNotesAtom::Clear()
{
- nSlideId = 0;
- nFlags = 0;
+ nSlideId = 0;
+ nFlags = 0;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
void PptColorSchemeAtom::Clear()
{
- memset(&aData[0], 0, 32);
+ memset(&aData[0], 0, 32);
}
Color PptColorSchemeAtom::GetColor( sal_uInt16 nNum ) const
{
Color aRetval;
- if ( nNum < 8 )
+ if ( nNum < 8 )
{
- nNum <<= 2;
- aRetval.SetRed( aData[ nNum++ ] );
- aRetval.SetGreen( aData[ nNum++ ] );
- aRetval.SetBlue( aData[ nNum++ ] );
- }
+ nNum <<= 2;
+ aRetval.SetRed( aData[ nNum++ ] );
+ aRetval.SetGreen( aData[ nNum++ ] );
+ aRetval.SetBlue( aData[ nNum++ ] );
+ }
return aRetval;
}
SvStream& operator>>( SvStream& rIn, PptColorSchemeAtom& rAtom )
{
- DffRecordHeader aHd;
- rIn >> aHd;
- rIn.Read( rAtom.aData, 32 );
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
+ DffRecordHeader aHd;
+ rIn >> aHd;
+ rIn.Read( rAtom.aData, 32 );
+ aHd.SeekToEndOfRecord( rIn );
+ return rIn;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
SvStream& operator>>( SvStream& rIn, PptFontEntityAtom& rAtom )
{
- DffRecordHeader aHd;
- rIn >> aHd;
- sal_Unicode nTemp, cData[ 32 ];
- rIn.Read( cData, 64 );
+ DffRecordHeader aHd;
+ rIn >> aHd;
+ sal_Unicode nTemp, cData[ 32 ];
+ rIn.Read( cData, 64 );
sal_uInt8 lfCharset, lfPitchAndFamily;
- rIn >> lfCharset
+ rIn >> lfCharset
>> rAtom.lfClipPrecision
>> rAtom.lfQuality
>> lfPitchAndFamily;
@@ -522,8 +522,8 @@ SvStream& operator>>( SvStream& rIn, PptFontEntityAtom& rAtom )
rAtom.aName = String( cData, i );
OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
rAtom.bAvailable = pDev->IsFontAvailable( rAtom.aName );
- aHd.SeekToEndOfRecord( rIn );
- return rIn;
+ aHd.SeekToEndOfRecord( rIn );
+ return rIn;
}
SV_DECL_PTRARR_DEL( PptFontEntityAtomList, PptFontEntityAtom*, 16, 16 )
@@ -536,7 +536,7 @@ class PptFontCollection: public PptFontEntityAtomList {
SvStream& operator>>( SvStream& rIn, PptUserEditAtom& rAtom )
{
- rIn >> rAtom.aHd
+ rIn >> rAtom.aHd
>> rAtom.nLastSlideID
>> rAtom.nVersion
>> rAtom.nOffsetLastEdit
@@ -544,8 +544,8 @@ SvStream& operator>>( SvStream& rIn, PptUserEditAtom& rAtom )
>> rAtom.nDocumentRef
>> rAtom.nMaxPersistWritten
>> rAtom.eLastViewType;
- rAtom.aHd.SeekToEndOfRecord(rIn);
- return rIn;
+ rAtom.aHd.SeekToEndOfRecord(rIn);
+ return rIn;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -553,21 +553,21 @@ SvStream& operator>>( SvStream& rIn, PptUserEditAtom& rAtom )
void PptOEPlaceholderAtom::Clear()
{
nPlacementId = 0;
- nPlaceholderSize = nPlaceholderId = 0;
+ nPlaceholderSize = nPlaceholderId = 0;
}
SvStream& operator>>( SvStream& rIn, PptOEPlaceholderAtom& rAtom )
{
- rIn >> rAtom.nPlacementId
+ rIn >> rAtom.nPlacementId
>> rAtom.nPlaceholderId
>> rAtom.nPlaceholderSize;
- return rIn;
+ return rIn;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
PptSlidePersistEntry::PptSlidePersistEntry() :
- pStyleSheet ( NULL ),
+ pStyleSheet ( NULL ),
pHeaderFooterEntry ( NULL ),
pSolverContainer ( NULL ),
nSlidePersistStartOffset( 0 ),
@@ -599,18 +599,18 @@ PptSlidePersistEntry::~PptSlidePersistEntry()
////////////////////////////////////////////////////////////////////////////////////////////////////
SdrEscherImport::SdrEscherImport( PowerPointImportParam& rParam, const String& rBaseURL ) :
- SvxMSDffManager ( rParam.rDocStream, rBaseURL, rParam.pTracer ),
- pFonts ( NULL ),
- nStreamLen ( 0 ),
+ SvxMSDffManager ( rParam.rDocStream, rBaseURL, rParam.pTracer ),
+ pFonts ( NULL ),
+ nStreamLen ( 0 ),
nTextStylesIndex ( 0xffff ),
eCharSetSystem ( gsl_getSystemTextEncoding() ),
bWingdingsChecked ( sal_False ),
- bWingdingsAvailable ( sal_False ),
+ bWingdingsAvailable ( sal_False ),
bMonotypeSortsChecked ( sal_False ),
- bMonotypeSortsAvailable ( sal_False ),
- bTimesNewRomanChecked ( sal_False ),
- bTimesNewRomanAvailable ( sal_False ),
- rImportParam ( rParam )
+ bMonotypeSortsAvailable ( sal_False ),
+ bTimesNewRomanChecked ( sal_False ),
+ bTimesNewRomanAvailable ( sal_False ),
+ rImportParam ( rParam )
{
}
@@ -619,39 +619,39 @@ SdrEscherImport::~SdrEscherImport()
void* pPtr;
for ( pPtr = aOleObjectList.First(); pPtr; pPtr = aOleObjectList.Next() )
delete (PPTOleEntry*)pPtr;
- delete pFonts;
+ delete pFonts;
}
const PptSlideLayoutAtom* SdrEscherImport::GetSlideLayoutAtom() const
{
- return NULL;
+ return NULL;
}
sal_Bool SdrEscherImport::ReadString( String& rStr ) const
{
- sal_Bool bRet = sal_False;
- DffRecordHeader aStrHd;
- rStCtrl >> aStrHd;
- if (aStrHd.nRecType == PPT_PST_TextBytesAtom
+ sal_Bool bRet = sal_False;
+ DffRecordHeader aStrHd;
+ rStCtrl >> aStrHd;
+ if (aStrHd.nRecType == PPT_PST_TextBytesAtom
|| aStrHd.nRecType == PPT_PST_TextCharsAtom
|| aStrHd.nRecType == PPT_PST_CString)
{
- sal_Bool bUniCode =
+ sal_Bool bUniCode =
(aStrHd.nRecType == PPT_PST_TextCharsAtom
|| aStrHd.nRecType == PPT_PST_CString);
- bRet=sal_True;
- sal_uLong nBytes = aStrHd.nRecLen;
- MSDFFReadZString( rStCtrl, rStr, nBytes, bUniCode );
- aStrHd.SeekToEndOfRecord( rStCtrl );
- }
+ bRet=sal_True;
+ sal_uLong nBytes = aStrHd.nRecLen;
+ MSDFFReadZString( rStCtrl, rStr, nBytes, bUniCode );
+ aStrHd.SeekToEndOfRecord( rStCtrl );
+ }
else
- aStrHd.SeekToBegOfRecord( rStCtrl );
- return bRet;
+ aStrHd.SeekToBegOfRecord( rStCtrl );
+ return bRet;
}
FASTBOOL SdrEscherImport::GetColorFromPalette(sal_uInt16 /*nNum*/, Color& /*rColor*/) const
{
- return sal_False;
+ return sal_False;
}
sal_Bool SdrEscherImport::SeekToShape( SvStream& /*rSt*/, void* /*pClientData*/, sal_uInt32 /*nId*/) const
@@ -662,30 +662,30 @@ sal_Bool SdrEscherImport::SeekToShape( SvStream& /*rSt*/, void* /*pClientData*/,
PptFontEntityAtom* SdrEscherImport::GetFontEnityAtom( sal_uInt32 nNum ) const
{
PptFontEntityAtom* pRetValue = NULL;
- if ( pFonts && ( nNum < pFonts->Count() ) )
- pRetValue = (*pFonts)[ (sal_uInt16)nNum ];
- return pRetValue;
+ if ( pFonts && ( nNum < pFonts->Count() ) )
+ pRetValue = (*pFonts)[ (sal_uInt16)nNum ];
+ return pRetValue;
}
CharSet SdrEscherImport::GetCharSet( sal_uInt32 nNum ) const
{
CharSet eRetValue( eCharSetSystem );
- if ( pFonts && ( nNum < pFonts->Count() ) )
- eRetValue = (*pFonts)[ (sal_uInt16)nNum ]->eCharSet;
- return eRetValue;
+ if ( pFonts && ( nNum < pFonts->Count() ) )
+ eRetValue = (*pFonts)[ (sal_uInt16)nNum ]->eCharSet;
+ return eRetValue;
}
sal_Bool SdrEscherImport::IsFontAvailable( sal_uInt32 nNum ) const
{
sal_Bool bRetValue = sal_False;
- if ( pFonts && ( nNum < pFonts->Count() ) )
- bRetValue = (*pFonts)[ (sal_uInt16)nNum ]->bAvailable;
+ if ( pFonts && ( nNum < pFonts->Count() ) )
+ bRetValue = (*pFonts)[ (sal_uInt16)nNum ]->bAvailable;
return bRetValue;
}
SdrObject* SdrEscherImport::ReadObjText( PPTTextObj* /*pTextObj*/, SdrObject* pObj, SdPage* /*pPage*/) const
{
- return pObj;
+ return pObj;
}
void SdrEscherImport::ProcessClientAnchor2( SvStream& rSt, DffRecordHeader& rHd, void* /*pData*/, DffObjData& rObj )
@@ -816,7 +816,7 @@ void SdrEscherImport::RecolorGraphic( SvStream& rSt, sal_uInt32 nRecLen, Graphic
}
}
-/* ProcessObject is called from ImplSdPPTImport::ProcessObj to hanlde all application specific things,
+/* ProcessObject is called from ImplSdPPTImport::ProcessObj to handle all application specific things,
such as the import of text, animation effects, header footer and placeholder.
The parameter pOriginalObj is the object as it was imported by our general escher import, it must either
@@ -886,7 +886,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
nPageNum--;
// replacing the object which we will return with a SdrPageObj
- SdrObject::Free( pRet );
+ SdrObject::Free( pRet );
pRet = new SdrPageObj( rObjData.aBoundRect, pSdrModel->GetPage( nPageNum - 1 ) );
}
else
@@ -963,8 +963,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
if ( bVerticalText )
{
- eTVA = SDRTEXTVERTADJUST_BLOCK;
- eTHA = SDRTEXTHORZADJUST_CENTER;
+ eTVA = SDRTEXTVERTADJUST_BLOCK;
+ eTHA = SDRTEXTHORZADJUST_CENTER;
// Textverankerung lesen
MSO_Anchor eTextAnchor = (MSO_Anchor)GetPropertyValue( DFF_Prop_anchorText, mso_anchorTop );
@@ -1001,7 +1001,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{
// check if it is sensible to use the centered alignment
sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
- if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left and also right aligned pararagraphs
+ if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left and also right aligned paragraphs
eTVA = SDRTEXTVERTADJUST_CENTER; // the text has to be displayed using the full width;
}
break;
@@ -1057,7 +1057,7 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{
// check if it is sensible to use the centered alignment
sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
- if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left and also right aligned pararagraphs
+ if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left and also right aligned paragraphs
eTHA = SDRTEXTHORZADJUST_CENTER; // the text has to be displayed using the full width;
}
break;
@@ -1177,9 +1177,9 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
{
bAutoGrowWidth = sal_False;
- // #119885# re-activationg bFitShapeToText here, could not find deeper explanations
- // for it (it was from 2005). Keeping the old commeht here for reference
- // old comment: // bFitShapeToText; can't be used, because we cut the text if it is too height,
+ // #119885# re-activationg bFitShapeToText here, could not find deeper explanations
+ // for it (it was from 2005). Keeping the old comment here for reference
+ // old comment: // bFitShapeToText; can't be used, because we cut the text if it is too height,
bAutoGrowHeight = bFitShapeToText;
}
}
@@ -1342,10 +1342,10 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
for ( SvxMSDffConnectorRule* pPtr = (SvxMSDffConnectorRule*)rPersistEntry.pSolverContainer->aCList.First();
pPtr; pPtr = (SvxMSDffConnectorRule*)rPersistEntry.pSolverContainer->aCList.Next() )
{
- if ( rObjData.nShapeId == pPtr->nShapeC )
+ if ( rObjData.nShapeId == pPtr->nShapeC )
pPtr->pCObj = pRet;
- else
- {
+ else
+ {
SdrObject* pConnectObj = pRet;
if ( pOriginalObj && pRet->ISA( SdrObjGroup ) )
{ /* check if the original object from the escherimport is part of the group object,
@@ -1361,17 +1361,17 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
}
}
- if ( rObjData.nShapeId == pPtr->nShapeA )
- {
- pPtr->pAObj = pConnectObj;
- pPtr->nSpFlagsA = rObjData.nSpFlags;
- }
- if ( rObjData.nShapeId == pPtr->nShapeB )
- {
- pPtr->pBObj = pConnectObj;
- pPtr->nSpFlagsB = rObjData.nSpFlags;
- }
- }
+ if ( rObjData.nShapeId == pPtr->nShapeA )
+ {
+ pPtr->pAObj = pConnectObj;
+ pPtr->nSpFlagsA = rObjData.nSpFlags;
+ }
+ if ( rObjData.nShapeId == pPtr->nShapeB )
+ {
+ pPtr->pBObj = pConnectObj;
+ pPtr->nSpFlagsB = rObjData.nSpFlags;
+ }
+ }
}
}
if ( rPersistEntry.ePageKind == PPT_MASTERPAGE )
@@ -1401,23 +1401,23 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
void SdrEscherImport::CheckWingdings() const
{
- OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
- ((SdrEscherImport*)this)->bWingdingsAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "WINGDINGS" ) ) );
- ((SdrEscherImport*)this)->bWingdingsChecked = sal_True;
+ OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
+ ((SdrEscherImport*)this)->bWingdingsAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "WINGDINGS" ) ) );
+ ((SdrEscherImport*)this)->bWingdingsChecked = sal_True;
}
void SdrEscherImport::CheckMonotypeSorts() const
{
- OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
- ((SdrEscherImport*)this)->bMonotypeSortsAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "MONOTYPE SORTS" ) ) );
- ((SdrEscherImport*)this)->bMonotypeSortsChecked = sal_True;
+ OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
+ ((SdrEscherImport*)this)->bMonotypeSortsAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "MONOTYPE SORTS" ) ) );
+ ((SdrEscherImport*)this)->bMonotypeSortsChecked = sal_True;
}
void SdrEscherImport::CheckTimesNewRoman() const
{
- OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
- ((SdrEscherImport*)this)->bTimesNewRomanAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "TIMES NEW ROMAN" ) ) );
- ((SdrEscherImport*)this)->bTimesNewRomanChecked = sal_True;
+ OutputDevice* pDev = (OutputDevice*)Application::GetDefaultDevice();
+ ((SdrEscherImport*)this)->bTimesNewRomanAvailable = pDev->IsFontAvailable( String( RTL_CONSTASCII_USTRINGPARAM( "TIMES NEW ROMAN" ) ) );
+ ((SdrEscherImport*)this)->bTimesNewRomanChecked = sal_True;
}
////////////////////////////////////////////////////////////////////////////////////////////////////
@@ -1425,25 +1425,25 @@ void SdrEscherImport::CheckTimesNewRoman() const
////////////////////////////////////////////////////////////////////////////////////////////////////
SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const String& rBaseURL ) :
- SdrEscherImport ( rParam, rBaseURL ),
+ SdrEscherImport ( rParam, rBaseURL ),
bOk ( rStCtrl.GetErrorCode() == SVSTREAM_OK ),
- pPersistPtr ( NULL ),
- nPersistPtrAnz ( 0 ),
- pDefaultSheet ( NULL ),
- pMasterPages ( NULL ),
- pSlidePages ( NULL ),
- pNotePages ( NULL ),
- nAktPageNum ( 0 ),
- nDocStreamPos ( 0 ),
- nPageColorsNum ( 0xFFFF ),
- ePageColorsKind ( PPT_MASTERPAGE ),
- eAktPageKind ( PPT_MASTERPAGE )
+ pPersistPtr ( NULL ),
+ nPersistPtrAnz ( 0 ),
+ pDefaultSheet ( NULL ),
+ pMasterPages ( NULL ),
+ pSlidePages ( NULL ),
+ pNotePages ( NULL ),
+ nAktPageNum ( 0 ),
+ nDocStreamPos ( 0 ),
+ nPageColorsNum ( 0xFFFF ),
+ ePageColorsKind ( PPT_MASTERPAGE ),
+ eAktPageKind ( PPT_MASTERPAGE )
{
DffRecordHeader* pHd;
- if ( bOk )
+ if ( bOk )
{
- rStCtrl.Seek( STREAM_SEEK_TO_END );
- nStreamLen = rStCtrl.Tell();
+ rStCtrl.Seek( STREAM_SEEK_TO_END );
+ nStreamLen = rStCtrl.Tell();
// try to allocate the UserEditAtom via CurrentUserAtom
sal_uInt32 nCurrentUserEdit = rParam.aCurrentUserAtom.nCurrentUserEdit;
@@ -1470,13 +1470,13 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
if ( !pHd )
bOk = sal_False;
}
- }
- if ( rStCtrl.GetError() != 0 )
+ }
+ if ( rStCtrl.GetError() != 0 )
bOk = sal_False;
if ( bOk )
{
- nPersistPtrAnz = aUserEditAtom.nMaxPersistWritten + 1;
+ nPersistPtrAnz = aUserEditAtom.nMaxPersistWritten + 1;
if ( ( nPersistPtrAnz >> 2 ) > nStreamLen ) // sj: at least nPersistPtrAnz is not allowed to be greater than filesize
bOk = sal_False; // (it should not be greater than the PPT_PST_PersistPtrIncrementalBlock, but
// we are reading this block later, so we do not have access yet)
@@ -1542,46 +1542,46 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
}
}
}
- }
- if ( rStCtrl.GetError() != 0 )
+ }
+ if ( rStCtrl.GetError() != 0 )
bOk = sal_False;
- if ( bOk )
+ if ( bOk )
{ // Document PersistEntry checken
- nDocStreamPos = aUserEditAtom.nDocumentRef;
- if ( nDocStreamPos > nPersistPtrAnz )
+ nDocStreamPos = aUserEditAtom.nDocumentRef;
+ if ( nDocStreamPos > nPersistPtrAnz )
{
- DBG_ERROR("SdrPowerPointImport::Ctor(): aUserEditAtom.nDocumentRef ungueltig!");
- bOk = sal_False;
- }
- }
- if ( bOk )
+ DBG_ERROR("SdrPowerPointImport::Ctor(): aUserEditAtom.nDocumentRef ungueltig!");
+ bOk = sal_False;
+ }
+ }
+ if ( bOk )
{ // Document FilePos checken
- nDocStreamPos = pPersistPtr[ nDocStreamPos ];
- if ( nDocStreamPos >= nStreamLen )
+ nDocStreamPos = pPersistPtr[ nDocStreamPos ];
+ if ( nDocStreamPos >= nStreamLen )
{
- DBG_ERROR("SdrPowerPointImport::Ctor(): nDocStreamPos >= nStreamLen!");
- bOk = sal_False;
- }
- }
- if ( bOk )
+ DBG_ERROR("SdrPowerPointImport::Ctor(): nDocStreamPos >= nStreamLen!");
+ bOk = sal_False;
+ }
+ }
+ if ( bOk )
{
- rStCtrl.Seek( nDocStreamPos );
+ rStCtrl.Seek( nDocStreamPos );
aDocRecManager.Consume( rStCtrl );
- DffRecordHeader aDocHd;
- rStCtrl >> aDocHd;
+ DffRecordHeader aDocHd;
+ rStCtrl >> aDocHd;
// DocumentAtom lesen
- DffRecordHeader aDocAtomHd;
- rStCtrl >> aDocAtomHd;
- if ( aDocHd.nRecType == PPT_PST_Document && aDocAtomHd.nRecType == PPT_PST_DocumentAtom )
+ DffRecordHeader aDocAtomHd;
+ rStCtrl >> aDocAtomHd;
+ if ( aDocHd.nRecType == PPT_PST_Document && aDocAtomHd.nRecType == PPT_PST_DocumentAtom )
{
- aDocAtomHd.SeekToBegOfRecord( rStCtrl );
- rStCtrl >> aDocAtom;
- }
+ aDocAtomHd.SeekToBegOfRecord( rStCtrl );
+ rStCtrl >> aDocAtom;
+ }
else
bOk = sal_False;
- if ( bOk )
+ if ( bOk )
{
if ( !pFonts )
ReadFontCollection();
@@ -1768,11 +1768,11 @@ SdrPowerPointImport::SdrPowerPointImport( PowerPointImportParam& rParam, const S
(*pMasterPages)[ i ]->pHeaderFooterEntry = new HeaderFooterEntry( aNormalMaster );
}
}
- }
- }
- if ( ( rStCtrl.GetError() != 0 ) || ( pDefaultSheet == NULL ) )
+ }
+ }
+ if ( ( rStCtrl.GetError() != 0 ) || ( pDefaultSheet == NULL ) )
bOk = sal_False;
- pPPTStyleSheet = pDefaultSheet;
+ pPPTStyleSheet = pDefaultSheet;
rStCtrl.Seek( 0 );
}
@@ -1780,10 +1780,10 @@ SdrPowerPointImport::~SdrPowerPointImport()
{
for ( void* pPtr = aHyperList.First(); pPtr; pPtr = aHyperList.Next() )
delete (SdHyperlinkEntry*)pPtr;
- delete pMasterPages;
- delete pSlidePages;
- delete pNotePages;
- delete[] pPersistPtr;
+ delete pMasterPages;
+ delete pSlidePages;
+ delete pNotePages;
+ delete[] pPersistPtr;
}
sal_Bool PPTConvertOCXControls::InsertControl(
@@ -1912,7 +1912,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
if ( ((SdrPowerPointImport*)this)->maShapeRecords.SeekToContent( rStCtrl, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
{
- DffRecordHeader aPlaceHd;
+ DffRecordHeader aPlaceHd;
while ( ( rStCtrl.GetError() == 0 )
&& ( rStCtrl.Tell() < ((SdrPowerPointImport*)this)->maShapeRecords.Current()->GetRecEndFilePos() ) )
{
@@ -1946,7 +1946,7 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
rStCtrl.SeekRel( 4 );
- ::utl::TempFile aTmpFile;
+ ::utl::TempFile aTmpFile;
aTmpFile.EnableKillingFile( sal_True );
if ( aTmpFile.IsValid() )
@@ -2259,18 +2259,18 @@ void SdrPowerPointImport::SeekOle( SfxObjectShell* pShell, sal_uInt32 nFilterOpt
sal_Bool SdrPowerPointImport::ReadFontCollection()
{
- sal_Bool bRet = sal_False;
+ sal_Bool bRet = sal_False;
DffRecordHeader* pEnvHd = aDocRecManager.GetRecordHeader( PPT_PST_Environment );
if ( pEnvHd )
{
sal_uLong nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer spaetere Restauration
pEnvHd->SeekToContent( rStCtrl );
- DffRecordHeader aListHd;
- if ( SeekToRec( rStCtrl, PPT_PST_FontCollection, pEnvHd->GetRecEndFilePos(), &aListHd ) )
+ DffRecordHeader aListHd;
+ if ( SeekToRec( rStCtrl, PPT_PST_FontCollection, pEnvHd->GetRecEndFilePos(), &aListHd ) )
{
sal_uInt16 nCount2 = 0;
- VirtualDevice* pVDev = NULL;
- while ( SeekToRec( rStCtrl, PPT_PST_FontEntityAtom, aListHd.GetRecEndFilePos() ) )
+ VirtualDevice* pVDev = NULL;
+ while ( SeekToRec( rStCtrl, PPT_PST_FontEntityAtom, aListHd.GetRecEndFilePos() ) )
{
bRet = sal_True;
if ( !pFonts )
@@ -2362,21 +2362,21 @@ sal_Bool SdrPowerPointImport::ReadFontCollection()
pFonts->C40_INSERT( PptFontEntityAtom, pFont, nCount2++ );
}
delete pVDev;
- }
+ }
rStCtrl.Seek( nFPosMerk ); // FilePos restaurieren
- }
- return bRet;
+ }
+ return bRet;
}
PptSlidePersistList* SdrPowerPointImport::GetPageList(PptPageKind ePageKind) const
{
- if ( ePageKind == PPT_MASTERPAGE )
+ if ( ePageKind == PPT_MASTERPAGE )
return pMasterPages;
- if ( ePageKind == PPT_SLIDEPAGE )
+ if ( ePageKind == PPT_SLIDEPAGE )
return pSlidePages;
- if ( ePageKind == PPT_NOTEPAGE )
+ if ( ePageKind == PPT_NOTEPAGE )
return pNotePages;
- return NULL;
+ return NULL;
}
SdrOutliner* SdrPowerPointImport::GetDrawOutliner( SdrTextObj* pSdrText ) const
@@ -2528,7 +2528,7 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
}
}
OutlinerParaObject* pNewText = rOutliner.CreateParaObject();
- rOutliner.Clear();
+ rOutliner.Clear();
rOutliner.SetUpdateMode( bOldUpdateMode );
pText->SetOutlinerParaObject( pNewText );
}
@@ -2537,46 +2537,46 @@ SdrObject* SdrPowerPointImport::ApplyTextObj( PPTTextObj* pTextObj, SdrTextObj*
sal_Bool SdrPowerPointImport::SeekToDocument( DffRecordHeader* pRecHd ) const
{
- sal_Bool bRet;
- sal_uLong nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
- rStCtrl.Seek( nDocStreamPos );
- DffRecordHeader aDocHd;
- rStCtrl >> aDocHd;
- bRet = aDocHd.nRecType == PPT_PST_Document;
- if ( bRet )
+ sal_Bool bRet;
+ sal_uLong nFPosMerk = rStCtrl.Tell(); // FilePos merken fuer ggf. spaetere Restauration
+ rStCtrl.Seek( nDocStreamPos );
+ DffRecordHeader aDocHd;
+ rStCtrl >> aDocHd;
+ bRet = aDocHd.nRecType == PPT_PST_Document;
+ if ( bRet )
{
- if ( pRecHd )
+ if ( pRecHd )
*pRecHd = aDocHd;
- else
+ else
aDocHd.SeekToBegOfRecord( rStCtrl );
- }
- if ( !bRet )
+ }
+ if ( !bRet )
rStCtrl.Seek( nFPosMerk ); // FilePos restaurieren
- return bRet;
+ return bRet;
}
sal_Bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStream& rSt,
- const DffRecordHeader& rSourceHd, DffRecordHeader& rContentHd )
+ const DffRecordHeader& rSourceHd, DffRecordHeader& rContentHd )
{
sal_Bool bRetValue = sal_False;
sal_uInt32 nOldPos = rSt.Tell();
- DffRecordHeader aProgTagsHd, aProgTagBinaryDataHd;
+ DffRecordHeader aProgTagsHd, aProgTagBinaryDataHd;
rSourceHd.SeekToContent( rSt );
- sal_Bool bFound = rSourceHd.nRecType == PPT_PST_ProgTags;
- if ( !bFound )
+ sal_Bool bFound = rSourceHd.nRecType == PPT_PST_ProgTags;
+ if ( !bFound )
bFound = SeekToRec( rSt, PPT_PST_ProgTags, rSourceHd.GetRecEndFilePos(), &aProgTagsHd );
if ( bFound )
- {
- while( SeekToRec( rSt, PPT_PST_ProgBinaryTag, aProgTagsHd.GetRecEndFilePos(), &aProgTagBinaryDataHd ) )
- {
- rSt >> rContentHd;
- if ( rContentHd.nRecType == PPT_PST_CString )
- {
- sal_uInt16 n = 6;
- sal_uInt32 i = rContentHd.nRecLen >> 1;
- if ( i > n )
- {
+ {
+ while( SeekToRec( rSt, PPT_PST_ProgBinaryTag, aProgTagsHd.GetRecEndFilePos(), &aProgTagBinaryDataHd ) )
+ {
+ rSt >> rContentHd;
+ if ( rContentHd.nRecType == PPT_PST_CString )
+ {
+ sal_uInt16 n = 6;
+ sal_uInt32 i = rContentHd.nRecLen >> 1;
+ if ( i > n )
+ {
String aPre, aSuf;
sal_Unicode *pTmp = aPre.AllocBuffer( n );
while ( n-- )
@@ -2599,8 +2599,8 @@ sal_Bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStre
}
}
aProgTagBinaryDataHd.SeekToEndOfRecord( rSt );
- }
- }
+ }
+ }
if ( !bRetValue )
rSt.Seek( nOldPos );
return bRetValue;
@@ -2608,114 +2608,114 @@ sal_Bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStre
sal_uInt32 SdrPowerPointImport::GetAktPageId()
{
- PptSlidePersistList* pList = GetPageList( eAktPageKind );
- if ( pList && nAktPageNum < pList->Count() )
- return (*pList)[ (sal_uInt16)nAktPageNum ]->aPersistAtom.nSlideId;
+ PptSlidePersistList* pList = GetPageList( eAktPageKind );
+ if ( pList && nAktPageNum < pList->Count() )
+ return (*pList)[ (sal_uInt16)nAktPageNum ]->aPersistAtom.nSlideId;
return 0;
}
sal_Bool SdrPowerPointImport::SeekToAktPage( DffRecordHeader* pRecHd ) const
{
- sal_Bool bRet = sal_False;
- PptSlidePersistList* pList = GetPageList( eAktPageKind );
- if ( pList && ( nAktPageNum < pList->Count() ) )
+ sal_Bool bRet = sal_False;
+ PptSlidePersistList* pList = GetPageList( eAktPageKind );
+ if ( pList && ( nAktPageNum < pList->Count() ) )
{
- sal_uLong nPersist = (*pList)[ (sal_uInt16)nAktPageNum ]->aPersistAtom.nPsrReference;
- if ( nPersist > 0 && nPersist < nPersistPtrAnz )
+ sal_uLong nPersist = (*pList)[ (sal_uInt16)nAktPageNum ]->aPersistAtom.nPsrReference;
+ if ( nPersist > 0 && nPersist < nPersistPtrAnz )
{
- sal_uLong nFPos = 0;
- nFPos = pPersistPtr[ nPersist ];
- if ( nFPos < nStreamLen )
+ sal_uLong nFPos = 0;
+ nFPos = pPersistPtr[ nPersist ];
+ if ( nFPos < nStreamLen )
{
- rStCtrl.Seek( nFPos );
- if ( pRecHd )
- rStCtrl >> *pRecHd;
- bRet = sal_True;
- }
- }
- }
- return bRet;
+ rStCtrl.Seek( nFPos );
+ if ( pRecHd )
+ rStCtrl >> *pRecHd;
+ bRet = sal_True;
+ }
+ }
+ }
+ return bRet;
}
sal_uInt16 SdrPowerPointImport::GetPageCount( PptPageKind ePageKind ) const
{
- PptSlidePersistList* pList = GetPageList( ePageKind );
- if ( pList )
+ PptSlidePersistList* pList = GetPageList( ePageKind );
+ if ( pList )
return pList->Count();
- return 0;
+ return 0;
}
void SdrPowerPointImport::SetPageNum( sal_uInt16 nPageNum, PptPageKind eKind )
{
- eAktPageKind = eKind;
- nAktPageNum = nPageNum;
+ eAktPageKind = eKind;
+ nAktPageNum = nPageNum;
- pPPTStyleSheet = NULL;
+ pPPTStyleSheet = NULL;
- sal_Bool bHasMasterPage = sal_True;
- sal_uInt16 nMasterIndex = 0;
+ sal_Bool bHasMasterPage = sal_True;
+ sal_uInt16 nMasterIndex = 0;
- if ( eKind == PPT_MASTERPAGE )
- nMasterIndex = nPageNum;
- else
- {
- if ( HasMasterPage( nPageNum, eKind ) )
- nMasterIndex = GetMasterPageIndex( nPageNum, eKind );
- else
- bHasMasterPage = sal_False;
- }
- if ( bHasMasterPage )
- {
- PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
- if ( pPageList && nMasterIndex < pPageList->Count() )
- {
- PptSlidePersistEntry* pMasterPersist = (*pPageList)[ nMasterIndex ];
- if ( ( pMasterPersist->pStyleSheet == NULL ) && pMasterPersist->aSlideAtom.nMasterId )
- {
- nMasterIndex = pMasterPages->FindPage( pMasterPersist->aSlideAtom.nMasterId );
- if ( nMasterIndex != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
- pMasterPersist = (*pPageList)[ nMasterIndex ];
- }
- pPPTStyleSheet = pMasterPersist->pStyleSheet;
- }
- }
- if ( !pPPTStyleSheet )
- pPPTStyleSheet = pDefaultSheet;
+ if ( eKind == PPT_MASTERPAGE )
+ nMasterIndex = nPageNum;
+ else
+ {
+ if ( HasMasterPage( nPageNum, eKind ) )
+ nMasterIndex = GetMasterPageIndex( nPageNum, eKind );
+ else
+ bHasMasterPage = sal_False;
+ }
+ if ( bHasMasterPage )
+ {
+ PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
+ if ( pPageList && nMasterIndex < pPageList->Count() )
+ {
+ PptSlidePersistEntry* pMasterPersist = (*pPageList)[ nMasterIndex ];
+ if ( ( pMasterPersist->pStyleSheet == NULL ) && pMasterPersist->aSlideAtom.nMasterId )
+ {
+ nMasterIndex = pMasterPages->FindPage( pMasterPersist->aSlideAtom.nMasterId );
+ if ( nMasterIndex != PPTSLIDEPERSIST_ENTRY_NOTFOUND )
+ pMasterPersist = (*pPageList)[ nMasterIndex ];
+ }
+ pPPTStyleSheet = pMasterPersist->pStyleSheet;
+ }
+ }
+ if ( !pPPTStyleSheet )
+ pPPTStyleSheet = pDefaultSheet;
}
Size SdrPowerPointImport::GetPageSize() const
{
- Size aRet( IsNoteOrHandout( nAktPageNum, eAktPageKind ) ? aDocAtom.GetNotesPageSize() : aDocAtom.GetSlidesPageSize() );
- Scale( aRet );
- // PPT arbeitet nur mit Einheiten zu 576DPI. Um Ungenauigkeiten zu
- // vermeiden runde ich die letzte Nachkommastelle metrisch weg.
- if ( nMapMul > 2 * nMapDiv )
+ Size aRet( IsNoteOrHandout( nAktPageNum, eAktPageKind ) ? aDocAtom.GetNotesPageSize() : aDocAtom.GetSlidesPageSize() );
+ Scale( aRet );
+ // PPT arbeitet nur mit Einheiten zu 576DPI. Um Ungenauigkeiten zu
+ // vermeiden runde ich die letzte Nachkommastelle metrisch weg.
+ if ( nMapMul > 2 * nMapDiv )
{
- MapUnit eMap = pSdrModel->GetScaleUnit();
- bool bInch = IsInch( eMap );
- long nInchMul = 1, nInchDiv = 1;
- if ( bInch )
+ MapUnit eMap = pSdrModel->GetScaleUnit();
+ bool bInch = IsInch( eMap );
+ long nInchMul = 1, nInchDiv = 1;
+ if ( bInch )
{ // Size temporaer (zum runden) in nach metric konvertieren
- Fraction aFact(GetMapFactor(eMap,MAP_100TH_MM).X());
- nInchMul = aFact.GetNumerator();
- nInchDiv = aFact.GetDenominator();
- aRet.Width() = BigMulDiv( aRet.Width(), nInchMul, nInchDiv );
- aRet.Height() = BigMulDiv( aRet.Height(), nInchMul, nInchDiv );
- }
- aRet.Width() += 5; aRet.Width() /= 10; aRet.Width()*=10;
- aRet.Height() += 5; aRet.Height() /= 10; aRet.Height()*=10;
- if ( bInch )
+ Fraction aFact(GetMapFactor(eMap,MAP_100TH_MM).X());
+ nInchMul = aFact.GetNumerator();
+ nInchDiv = aFact.GetDenominator();
+ aRet.Width() = BigMulDiv( aRet.Width(), nInchMul, nInchDiv );
+ aRet.Height() = BigMulDiv( aRet.Height(), nInchMul, nInchDiv );
+ }
+ aRet.Width() += 5; aRet.Width() /= 10; aRet.Width()*=10;
+ aRet.Height() += 5; aRet.Height() /= 10; aRet.Height()*=10;
+ if ( bInch )
{
- aRet.Width() = BigMulDiv( aRet.Width(), nInchDiv, nInchMul );
- aRet.Height() = BigMulDiv( aRet.Height(), nInchDiv, nInchMul );
- }
- }
- return aRet;
+ aRet.Width() = BigMulDiv( aRet.Width(), nInchDiv, nInchMul );
+ aRet.Height() = BigMulDiv( aRet.Height(), nInchDiv, nInchMul );
+ }
+ }
+ return aRet;
}
FASTBOOL SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColor ) const
{
- if ( nPageColorsNum != nAktPageNum || ePageColorsKind != eAktPageKind )
+ if ( nPageColorsNum != nAktPageNum || ePageColorsKind != eAktPageKind )
{
sal_uInt16 nSlideFlags = 0;
PptSlidePersistList* pPageList = GetPageList( eAktPageKind );
@@ -2727,44 +2727,44 @@ FASTBOOL SdrPowerPointImport::GetColorFromPalette( sal_uInt16 nNum, Color& rColo
if ( ! ( nSlideFlags & 2 ) )
((SdrPowerPointImport*)this)->aPageColors = pE->aColorScheme;
}
- if ( nSlideFlags & 2 ) // follow master colorscheme ?
+ if ( nSlideFlags & 2 ) // follow master colorscheme?
{
- PptSlidePersistList* pPageList2 = GetPageList( PPT_MASTERPAGE );
- if ( pPageList2 )
- {
- PptSlidePersistEntry* pMasterPersist = NULL;
- if ( eAktPageKind == PPT_MASTERPAGE )
- pMasterPersist = (*pPageList2)[ nAktPageNum ];
- else
- {
- if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
- {
- sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
- if ( nMasterNum < pPageList2->Count() )
- pMasterPersist = (*pPageList2)[ nMasterNum ];
- }
- }
+ PptSlidePersistList* pPageList2 = GetPageList( PPT_MASTERPAGE );
+ if ( pPageList2 )
+ {
+ PptSlidePersistEntry* pMasterPersist = NULL;
+ if ( eAktPageKind == PPT_MASTERPAGE )
+ pMasterPersist = (*pPageList2)[ nAktPageNum ];
+ else
+ {
+ if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
+ {
+ sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
+ if ( nMasterNum < pPageList2->Count() )
+ pMasterPersist = (*pPageList2)[ nMasterNum ];
+ }
+ }
if ( pMasterPersist )
- {
- while( ( pMasterPersist && pMasterPersist->aSlideAtom.nFlags & 2 ) // it is possible that a masterpage
- && pMasterPersist->aSlideAtom.nMasterId ) // itself is following a master colorscheme
- {
- sal_uInt16 nNextMaster = pMasterPages->FindPage( pMasterPersist->aSlideAtom.nMasterId );
- if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
- break;
- else
- pMasterPersist = (*pPageList2)[ nNextMaster ];
- }
+ {
+ while( ( pMasterPersist && pMasterPersist->aSlideAtom.nFlags & 2 ) // it is possible that a masterpage
+ && pMasterPersist->aSlideAtom.nMasterId ) // itself is following a master colorscheme
+ {
+ sal_uInt16 nNextMaster = pMasterPages->FindPage( pMasterPersist->aSlideAtom.nMasterId );
+ if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
+ break;
+ else
+ pMasterPersist = (*pPageList2)[ nNextMaster ];
+ }
((SdrPowerPointImport*)this)->aPageColors = pMasterPersist->aColorScheme;
- }
- }
+ }
+ }
}
// momentanes Farbschema eintragen
- ((SdrPowerPointImport*)this)->nPageColorsNum = nAktPageNum;
- ((SdrPowerPointImport*)this)->ePageColorsKind = eAktPageKind;
- }
- rColor = aPageColors.GetColor( nNum );
- return sal_True;
+ ((SdrPowerPointImport*)this)->nPageColorsNum = nAktPageNum;
+ ((SdrPowerPointImport*)this)->ePageColorsKind = eAktPageKind;
+ }
+ rColor = aPageColors.GetColor( nNum );
+ return sal_True;
}
sal_Bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal_uInt32 nId ) const
@@ -2782,11 +2782,11 @@ sal_Bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal
PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
if ( pPageList && ( nMasterNum < pPageList->Count() ) )
{
- PptSlidePersistEntry* pPersist = (*pPageList)[ nMasterNum ]; // get the masterpage's persistentry
+ PptSlidePersistEntry* pPersist = (*pPageList)[ nMasterNum ]; // get the masterpage's persistentry
if ( pPersist && pPersist->pPresentationObjects )
{
sal_uInt32 nCurrent(0L);
- DffRecordList* pCList = maShapeRecords.pCList; // we got a backup of the current position
+ DffRecordList* pCList = maShapeRecords.pCList; // we got a backup of the current position
if ( pCList )
nCurrent = pCList->nCurrent;
if ( ((SdrEscherImport*)this )->maShapeRecords.SeekToContent( rSt, DFF_msofbtClientData, SEEK_FROM_CURRENT_AND_RESTART ) )
@@ -2836,29 +2836,29 @@ sal_Bool SdrPowerPointImport::SeekToShape( SvStream& rSt, void* pClientData, sal
SdrPage* SdrPowerPointImport::MakeBlancPage( sal_Bool bMaster ) const
{
- SdrPage* pRet = pSdrModel->AllocPage( bMaster );
- pRet->SetSize( GetPageSize() );
+ SdrPage* pRet = pSdrModel->AllocPage( bMaster );
+ pRet->SetSize( GetPageSize() );
/*
SJ (21.08.00) : since bug #77576# i decided not to set a border size.
- Size aPageSize( aDocAtom.GetSlidesPageSize() ); // PageSize in 576DPI-Units
- long nHMarg = aPageSize.Width() - aDocAtom.aSlidesPageSize.Width();
- long nVMarg = aPageSize.Height() - aDocAtom.aSlidesPageSize.Height();
- if ( nHMarg > 0 )
+ Size aPageSize( aDocAtom.GetSlidesPageSize() ); // PageSize in 576DPI-Units
+ long nHMarg = aPageSize.Width() - aDocAtom.aSlidesPageSize.Width();
+ long nVMarg = aPageSize.Height() - aDocAtom.aSlidesPageSize.Height();
+ if ( nHMarg > 0 )
{
- Scale( nHMarg );
- pRet->SetLftBorder( nHMarg / 2 );
- pRet->SetRgtBorder( nHMarg - nHMarg / 2 );
- }
- if ( nVMarg > 0 )
+ Scale( nHMarg );
+ pRet->SetLftBorder( nHMarg / 2 );
+ pRet->SetRgtBorder( nHMarg - nHMarg / 2 );
+ }
+ if ( nVMarg > 0 )
{
- Scale( nVMarg );
- pRet->SetUppBorder( nVMarg / 2 );
- pRet->SetLwrBorder( nVMarg - nVMarg / 2 );
- }
+ Scale( nVMarg );
+ pRet->SetUppBorder( nVMarg / 2 );
+ pRet->SetLwrBorder( nVMarg - nVMarg / 2 );
+ }
*/
- return pRet;
+ return pRet;
}
void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage, DffRecordHeader& rComment10Hd )
@@ -2896,7 +2896,7 @@ void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage,
rStCtrl >> nIndex
>> aDateTime.Year
>> aDateTime.Month
- >> aDateTime.Day // DayOfWeek
+ >> aDateTime.Day // DayOfWeek
>> aDateTime.Day
>> aDateTime.Hours
>> aDateTime.Minutes
@@ -2931,20 +2931,19 @@ void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage,
}
-// be sure not to import masterpages with this method
// be sure not to import masterpages with this method
void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry* pMasterPersist )
{
sal_uInt32 nMerk = rStCtrl.Tell();
- PptSlidePersistList* pList = GetPageList( eAktPageKind );
+ PptSlidePersistList* pList = GetPageList( eAktPageKind );
if ( ( !pList ) || ( pList->Count() <= nAktPageNum ) )
return;
PptSlidePersistEntry& rSlidePersist = *(*pList)[ nAktPageNum ];
- if ( rSlidePersist.bStarDrawFiller )
+ if ( rSlidePersist.bStarDrawFiller )
return;
DffRecordHeader aPageHd;
- if ( SeekToAktPage( &aPageHd ) )
+ if ( SeekToAktPage( &aPageHd ) )
{
if ( mbTracing )
mpTracer->AddAttribute( eAktPageKind == PPT_SLIDEPAGE
@@ -2954,10 +2953,10 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
rSlidePersist.pHeaderFooterEntry = new HeaderFooterEntry( pMasterPersist );
ProcessData aProcessData( rSlidePersist, (SdPage*)pRet );
- sal_Size nLastPosition;
+ sal_Size nLastPosition;
while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aPageHd.GetRecEndFilePos() ) )
{
- nLastPosition = rStCtrl.Tell();
+ nLastPosition = rStCtrl.Tell();
DffRecordHeader aHd;
rStCtrl >> aHd;
switch ( aHd.nRecType )
@@ -2971,7 +2970,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
case PPT_PST_ProgTags :
{
DffRecordHeader aContentDataHd;
- if ( SeekToContentOfProgTag( 10, rStCtrl, aHd, aContentDataHd ) )
+ if ( SeekToContentOfProgTag( 10, rStCtrl, aHd, aContentDataHd ) )
{
DffRecordHeader aComment10Hd;
while( ( rStCtrl.GetError() == 0 ) && SeekToRec( rStCtrl, PPT_PST_Comment10, aContentDataHd.GetRecEndFilePos(), &aComment10Hd ) )
@@ -3000,21 +2999,21 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
case DFF_msofbtSpContainer :
{
Rectangle aPageSize( Point(), pRet->GetSize() );
- if ( rSlidePersist.aSlideAtom.nFlags & 4 ) // follow master background ?
+ if ( rSlidePersist.aSlideAtom.nFlags & 4 ) // follow master background ?
{
- if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
- {
- sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
+ if ( HasMasterPage( nAktPageNum, eAktPageKind ) )
+ {
+ sal_uInt16 nMasterNum = GetMasterPageIndex( nAktPageNum, eAktPageKind );
PptSlidePersistList* pPageList = GetPageList( PPT_MASTERPAGE );
PptSlidePersistEntry* pE = (*pPageList)[ nMasterNum ];
- while( ( pE->aSlideAtom.nFlags & 4 ) && pE->aSlideAtom.nMasterId )
- {
- sal_uInt16 nNextMaster = pMasterPages->FindPage( pE->aSlideAtom.nMasterId );
- if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
- break;
- else
- pE = (*pPageList)[ nNextMaster ];
- }
+ while( ( pE->aSlideAtom.nFlags & 4 ) && pE->aSlideAtom.nMasterId )
+ {
+ sal_uInt16 nNextMaster = pMasterPages->FindPage( pE->aSlideAtom.nMasterId );
+ if ( nNextMaster == PPTSLIDEPERSIST_ENTRY_NOTFOUND )
+ break;
+ else
+ pE = (*pPageList)[ nNextMaster ];
+ }
if ( pE->nBackgroundOffset )
{
// do not follow master colorscheme ?
@@ -3025,7 +3024,7 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
rSlidePersist.bBObjIsTemporary = bTemporary;
rStCtrl.Seek( nPos );
}
- }
+ }
}
else
{
@@ -3064,11 +3063,11 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
DffRecordHeader aShapeHd;
if ( SeekToRec( rStCtrl, DFF_msofbtSpContainer, aEscherObjListHd.GetRecEndFilePos(), &aShapeHd ) )
{
- sal_Size nShapeLastPosition;
+ sal_Size nShapeLastPosition;
aShapeHd.SeekToEndOfRecord( rStCtrl );
while ( ( rStCtrl.GetError() == 0 ) && ( rStCtrl.Tell() < aEscherObjListHd.GetRecEndFilePos() ) )
{
- nShapeLastPosition = rStCtrl.Tell();
+ nShapeLastPosition = rStCtrl.Tell();
rStCtrl >> aShapeHd;
if ( ( aShapeHd.nRecType == DFF_msofbtSpContainer ) || ( aShapeHd.nRecType == DFF_msofbtSpgrContainer ) )
{
@@ -3089,10 +3088,10 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
}
}
aShapeHd.SeekToEndOfRecord( rStCtrl );
- if (rStCtrl.Tell() == nShapeLastPosition) {
- // We are inside an endless loop
- break;
- }
+ if (rStCtrl.Tell() == nShapeLastPosition) {
+ // We are inside an endless loop
+ break;
+ }
}
}
}
@@ -3133,11 +3132,11 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
}
if ( rSlidePersist.pBObj )
{
- // #i99386# transfer the attributes from the temporary BackgroundObject
- // to the Page and delete it. Maybe rSlidePersist.bBObjIsTemporary is
- // obsolete here, too.
- pRet->getSdrPageProperties().ClearItem();
- pRet->getSdrPageProperties().PutItemSet(rSlidePersist.pBObj->GetMergedItemSet());
+ // #i99386# transfer the attributes from the temporary BackgroundObject
+ // to the Page and delete it. Maybe rSlidePersist.bBObjIsTemporary is
+ // obsolete here, too.
+ pRet->getSdrPageProperties().ClearItem();
+ pRet->getSdrPageProperties().PutItemSet(rSlidePersist.pBObj->GetMergedItemSet());
SdrObject::Free( rSlidePersist.pBObj );
}
}
@@ -3145,13 +3144,13 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
break;
}
aHd.SeekToEndOfRecord( rStCtrl );
- if (rStCtrl.Tell() == nLastPosition) {
- // We are inside an endless loop
- break;
- }
+ if (rStCtrl.Tell() == nLastPosition) {
+ // We are inside an endless loop
+ break;
+ }
}
if ( rSlidePersist.pSolverContainer )
- SolveSolver( *rSlidePersist.pSolverContainer );
+ SolveSolver( *rSlidePersist.pSolverContainer );
if ( mbTracing )
mpTracer->RemoveAttribute( eAktPageKind == PPT_SLIDEPAGE
? rtl::OUString::createFromAscii( "Page" )
@@ -3162,14 +3161,14 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
const PptSlideLayoutAtom* SdrPowerPointImport::GetSlideLayoutAtom() const
{
- PptSlidePersistList* pPageList = GetPageList( eAktPageKind );
- if ( pPageList && nAktPageNum < pPageList->Count() )
+ PptSlidePersistList* pPageList = GetPageList( eAktPageKind );
+ if ( pPageList && nAktPageNum < pPageList->Count() )
{
- PptSlidePersistEntry* pE = (*pPageList)[ nAktPageNum ];
- if ( pE )
- return &pE->aSlideAtom.aLayout;
- }
- return NULL;
+ PptSlidePersistEntry* pE = (*pPageList)[ nAktPageNum ];
+ if ( pE )
+ return &pE->aSlideAtom.aLayout;
+ }
+ return NULL;
}
sal_Bool SdrPowerPointImport::IsNoteOrHandout( sal_uInt16 nPageNum, PptPageKind /*ePageKind*/) const
@@ -3857,7 +3856,7 @@ sal_Bool PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rM
{
rNumberFormat.SetNumberingType( SVX_NUM_NUMBER_UPPER_ZH );
}
- break;
+ break;
case 17: // Simplified Chinese with single-byte period.
{
rNumberFormat.SetNumberingType( SVX_NUM_NUMBER_UPPER_ZH );
@@ -3914,7 +3913,7 @@ sal_Bool PPTNumberFormatCreator::ImplGetExtNumberFormat( SdrPowerPointImport& rM
rStartNumbering = boost::optional< sal_Int16 >( nAnmScheme >> 16 );
sal_Int16 nBuStart = *rStartNumbering;
//The Seventh bit of nBuFlags that specifies whether fBulletHasAutoNumber exists,
- //and fBulletHasAutoNumber that specifies whether this paragraph has an automatic numbering scheme.
+ //and fBulletHasAutoNumber that specifies whether this paragraph has an automatic numbering scheme.
if ( ( nBuFlags & 0x02000000 ) && ( nBuStart != 1 ))
{
rNumberFormat.SetStart( static_cast<sal_uInt16>(nBuStart) );
@@ -4347,7 +4346,7 @@ void PPTParaSheet::UpdateBulletRelSize( sal_uInt32 nLevel, sal_uInt16 nFontHeig
sal_Int16 nBulletRelSize = ( sal_Int16 )maParaLevel[ nLevel ].mnBulletHeight;
nBulletRelSize = nFontHeight ? ((-nBulletRelSize) * 100 ) / nFontHeight : 100;
if ( nBulletRelSize < 0 ) //bullet size over flow
- nBulletRelSize = 100;
+ nBulletRelSize = 100;
maParaLevel[ nLevel ].mnBulletHeight = nBulletRelSize;
}
}
@@ -5146,7 +5145,7 @@ void StyleTextProp9::Read( SvStream& rIn )
rIn >> mnBuBlip;
if ( mnExtParagraphMask & 0x2000000 )
rIn >> mnHasAnm;
- if ( mnExtParagraphMask & 0x1000000 )
+ if ( mnExtParagraphMask & 0x1000000 )
rIn >> mnAnmScheme;
if ( mnExtParagraphMask & 0x4000000 )
rIn >> mpfPP10Ext;
@@ -5167,7 +5166,7 @@ PPTStyleTextPropReader::PPTStyleTextPropReader( SvStream& rIn, SdrPowerPointImpo
}
void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport& rMan, const DffRecordHeader& rTextHeader,
- const String& aString, PPTTextRulerInterpreter& rRuler,
+ const String& aString, PPTTextRulerInterpreter& rRuler,
sal_uInt32& nCharCount, sal_Bool& bTextPropAtom )
{
sal_uInt32 nMask = 0; //TODO: nMask initialized here to suppress warning for now, see corresponding TODO below
@@ -5316,11 +5315,11 @@ void PPTStyleTextPropReader::ReadParaProps( SvStream& rIn, SdrPowerPointImport&
}
}
-void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aCharPropSet, const String& aString,
+void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aCharPropSet, const String& aString,
sal_uInt32& nCharCount, sal_uInt32 nCharAnzRead,
- sal_Bool& bTextPropAtom, sal_uInt32 nExtParaPos,
- const std::vector< StyleTextProp9 >& aStyleTextProp9,
- sal_uInt32& nExtParaFlags, sal_uInt16& nBuBlip,
+ sal_Bool& bTextPropAtom, sal_uInt32 nExtParaPos,
+ const std::vector< StyleTextProp9 >& aStyleTextProp9,
+ sal_uInt32& nExtParaFlags, sal_uInt16& nBuBlip,
sal_uInt16& nHasAnm, sal_uInt32& nAnmScheme )
{
sal_uInt32 nMask = 0; //TODO: nMask initialized here to suppress warning for now, see corresponding TODO below
@@ -5400,7 +5399,7 @@ void PPTStyleTextPropReader::ReadCharProps( SvStream& rIn, PPTCharPropSet& aChar
{
if ( nExtParaNibble && ( ( nExtBuInd + nExtParaNibble ) < aStyleTextProp9.size() ) )
nExtBuInd += nExtParaNibble;
-
+
nExtParaFlags = aStyleTextProp9[ nExtBuInd ].mnExtParagraphMask;
nBuBlip = aStyleTextProp9[ nExtBuInd ].mnBuBlip;
nHasAnm = aStyleTextProp9[ nExtBuInd ].mnHasAnm;
@@ -5516,10 +5515,10 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con
sal_uInt32 nExtParaFlags = 0, nAnmScheme = 0;
sal_uInt16 nBuBlip = 0xffff, nHasAnm = 0;
ReadCharProps( rIn, aCharPropSet, aString, nCharCount, nCharAnzRead,
- bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
+ bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
nBuBlip, nHasAnm, nAnmScheme );
-
- aCharPropList.Insert(
+
+ aCharPropList.Insert(
new PPTCharPropSet( aCharPropSet, 0 ), LIST_APPEND );
}
}
@@ -5545,7 +5544,7 @@ void PPTStyleTextPropReader::Init( SvStream& rIn, SdrPowerPointImport& rMan, con
PPTCharPropSet aCharPropSet( nCurrentPara );
if ( bTextPropAtom )
ReadCharProps( rIn, aCharPropSet, aString, nCharCount, nCharAnzRead,
- bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
+ bTextPropAtom, nExtParaPos, aStyleTextProp9, nExtParaFlags,
nBuBlip, nHasAnm, nAnmScheme );
else
nCharCount = nStringLen;
@@ -5867,7 +5866,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, s
{
rSet.Put( SvxFontItem( pFontEnityAtom->eFamily, pFontEnityAtom->aName, String(), pFontEnityAtom->ePitch, pFontEnityAtom->eCharSet, EE_CHAR_FONTINFO_CJK ) );
rSet.Put( SvxFontItem( pFontEnityAtom->eFamily, pFontEnityAtom->aName, String(), pFontEnityAtom->ePitch, pFontEnityAtom->eCharSet, EE_CHAR_FONTINFO_CTL ) );
- }
+ }
}
}
if ( GetAttrib( PPT_CharAttr_FontHeight, nVal, nDestinationInstance ) ) // Schriftgrad in Point
@@ -5879,7 +5878,7 @@ void PPTPortionObj::ApplyTo( SfxItemSet& rSet, SdrPowerPointImport& rManager, s
}
if ( GetAttrib( PPT_CharAttr_Embossed, nVal, nDestinationInstance ) )
- rSet.Put( SvxCharReliefItem( nVal != 0 ? RELIEF_EMBOSSED : RELIEF_NONE, EE_CHAR_RELIEF ) );
+ rSet.Put( SvxCharReliefItem( nVal != 0 ? RELIEF_EMBOSSED : RELIEF_NONE, EE_CHAR_RELIEF ) );
if ( nVal ) /* if Embossed is set, the font color depends to the fillstyle/color of the object,
if the object has no fillstyle, the font color depends to fillstyle of the background */
{
@@ -6516,7 +6515,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
if ( nVal2 <= 0 )
{
aItem.SetLineHeight( (sal_uInt16)( rManager.ScalePoint( -nVal2 ) / 8 ) );
- aItem.GetLineSpaceRule() = SVX_LINE_SPACE_FIX;
+ aItem.GetLineSpaceRule() = SVX_LINE_SPACE_FIX;
}
else
{
@@ -6576,7 +6575,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
SvxTabStopItem aTabItem( 0, 0, SVX_TAB_ADJUST_DEFAULT, EE_PARA_TABS );
if ( GetTabCount() )
{
- //paragraph offset = MIN(first_line_offset, hanging_offset)
+ // paragraph offset = MIN(first_line_offset, hanging_offset)
sal_uInt32 nParaOffset = Min( nTextOfs2, nTab );
for ( i = 0; i < GetTabCount(); i++ )
{
@@ -6589,7 +6588,7 @@ void PPTParagraphObj::ApplyTo( SfxItemSet& rSet, boost::optional< sal_Int16 >&
case 3 : eTabAdjust = SVX_TAB_ADJUST_DECIMAL; break;
default : eTabAdjust = SVX_TAB_ADJUST_LEFT;
}
- if ( nTab > nParaOffset )//If tab stop greater than paragraph offset
+ if ( nTab > nParaOffset ) // If tab stop greater than paragraph offset
aTabItem.Insert( SvxTabStop( ( ( (long( nTab - nTextOfs2 )) * 2540 ) / 576 ), eTabAdjust ) );
}
nLatestManTab = nTab;
@@ -6913,11 +6912,11 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
mpImplTextObj->mnInstance = nInstance;
sal_uInt32 nFilePos = rIn.Tell();
- if ( rSdrPowerPointImport.SeekToRec2( PPT_PST_TextBytesAtom,
- PPT_PST_TextCharsAtom,
- aClientTextBoxHd.GetRecEndFilePos() )
+ if ( rSdrPowerPointImport.SeekToRec2( PPT_PST_TextBytesAtom,
+ PPT_PST_TextCharsAtom,
+ aClientTextBoxHd.GetRecEndFilePos() )
|| rSdrPowerPointImport.SeekToRec( rIn,
- PPT_PST_StyleTextPropAtom,
+ PPT_PST_StyleTextPropAtom,
aClientTextBoxHd.GetRecEndFilePos() ) )
{
PPTTextRulerInterpreter aTextRulerInterpreter( nTextRulerAtomOfs, rSdrPowerPointImport,
@@ -6944,7 +6943,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
{
sal_uInt32 nCharIdx = pSpecInfo->nCharIdx;
- // portions and text have to been splitted in some cases
+ // portions and text have to been split in some cases
for ( ; nI < aStyleTextPropReader.aCharPropList.Count(); )
{
PPTCharPropSet* pSet = (PPTCharPropSet*)aStyleTextPropReader.aCharPropList.GetObject( nI );
@@ -6953,7 +6952,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
pSet->mnLanguage[ 0 ] = pSpecInfo->nLanguage[ 0 ];
pSet->mnLanguage[ 1 ] = pSpecInfo->nLanguage[ 1 ];
pSet->mnLanguage[ 2 ] = pSpecInfo->nLanguage[ 2 ];
- // test if the current portion needs to be splitted
+ // test if the current portion needs to be split
if ( pSet->maString.Len() > 1 )
{
sal_Int32 nIndexOfNextPortion = pSet->maString.Len() + pSet->mnOriginalTextPos;
@@ -7060,7 +7059,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
case PPT_PST_RTFDateTimeMCAtom:
{
- // Rude workaround for one specal case reported
+ // Rude workaround for one special case reported
// by a customer. (#i75203#)
// Don't even attempt to handle the general use
@@ -7236,7 +7235,7 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
}
else
{
- if ( pFE->nTextRangeEnd ) // text range hyperlink
+ if ( pFE->nTextRangeEnd ) // text range hyperlink
{
sal_uInt32 nHyperLen = pFE->nTextRangeEnd - nPos;
if ( nHyperLen )
@@ -7582,7 +7581,7 @@ void CreateTableRows( Reference< XTableRows > xTableRows, const std::set< sal_In
Reference< XIndexAccess > xIndexAccess( xTableRows, UNO_QUERY_THROW );
for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ )
{
- sal_Int32 nHeight;
+ sal_Int32 nHeight;
if ( ++aIter != rRows.end() )
{
nHeight = *aIter - nLastPosition;
@@ -7608,7 +7607,7 @@ void CreateTableColumns( Reference< XTableColumns > xTableColumns, const std::se
for ( sal_Int32 n = 0; n < xIndexAccess->getCount(); n++ )
{
sal_Int32 nWidth;
- if ( ++aIter != rColumns.end() )
+ if ( ++aIter != rColumns.end() )
{
nWidth = *aIter - nLastPosition;
nLastPosition = *aIter;
@@ -7624,22 +7623,22 @@ void CreateTableColumns( Reference< XTableColumns > xTableColumns, const std::se
void MergeCells( const Reference< XTable >& xTable, sal_Int32 nCol, sal_Int32 nRow, sal_Int32 nColSpan, sal_Int32 nRowSpan )
{
- DBG_ASSERT( (nColSpan > 1) || (nRowSpan > 1), "nonsense parameter!!" );
- DBG_ASSERT( (nCol >= 0) && (nCol < xTable->getColumnCount()) && (nRow >= 0) && (nRow < xTable->getRowCount()), "die celle gibts nicht!!" );
- DBG_ASSERT( (nColSpan >= 1) && ((nCol + nColSpan - 1) < xTable->getColumnCount()), "nColSpan murks!" );
- DBG_ASSERT( (nRowSpan >= 1) && ((nRow + nRowSpan - 1) < xTable->getRowCount()), "nRowSpan murks!" );
-
- if( xTable.is() ) try
- {
- Reference< XMergeableCellRange > xRange( xTable->createCursorByRange( xTable->getCellRangeByPosition( nCol, nRow,nCol + nColSpan - 1, nRow + nRowSpan - 1 ) ), UNO_QUERY_THROW );
- if( xRange->isMergeable() )
- xRange->merge();
- }
- catch( Exception& )
- {
- DBG_ASSERT( false, "exception caught!" );
- }
-}
+ DBG_ASSERT( (nColSpan > 1) || (nRowSpan > 1), "nonsense parameter!!" );
+ DBG_ASSERT( (nCol >= 0) && (nCol < xTable->getColumnCount()) && (nRow >= 0) && (nRow < xTable->getRowCount()), "die zelle gibt es nicht!!" );
+ DBG_ASSERT( (nColSpan >= 1) && ((nCol + nColSpan - 1) < xTable->getColumnCount()), "nColSpan murks!" );
+ DBG_ASSERT( (nRowSpan >= 1) && ((nRow + nRowSpan - 1) < xTable->getRowCount()), "nRowSpan murks!" );
+
+ if( xTable.is() ) try
+ {
+ Reference< XMergeableCellRange > xRange( xTable->createCursorByRange( xTable->getCellRangeByPosition( nCol, nRow,nCol + nColSpan - 1, nRow + nRowSpan - 1 ) ), UNO_QUERY_THROW );
+ if( xRange->isMergeable() )
+ xRange->merge();
+ }
+ catch( Exception& )
+ {
+ DBG_ASSERT( false, "exception caught!" );
+ }
+}
void ApplyCellAttributes( const SdrObject* pObj, Reference< XCell >& xCell )
{
@@ -7773,8 +7772,8 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl
Color aLineColor( ((XLineColorItem&)pLine->GetMergedItem( XATTR_LINECOLOR )).GetColorValue() );
aBorderLine.Color = aLineColor.GetColor();
// Avoid width = 0, the min value should be 1.
- aBorderLine.OuterLineWidth = std::max( static_cast< sal_Int16 >( 1 ), static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4) );
- aBorderLine.InnerLineWidth = std::max( static_cast< sal_Int16 >( 1 ), static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4) );
+ aBorderLine.OuterLineWidth = std::max( static_cast< sal_Int16 >( 1 ), static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4) );
+ aBorderLine.InnerLineWidth = std::max( static_cast< sal_Int16 >( 1 ), static_cast< sal_Int16 >( ((const XLineWidthItem&)(pLine->GetMergedItem(XATTR_LINEWIDTH))).GetValue() / 4) );
aBorderLine.LineDistance = 0;
}
break;
@@ -7793,7 +7792,7 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl
static const rtl::OUString sTopBorder( String( RTL_CONSTASCII_USTRINGPARAM( "TopBorder" ) ) );
static const rtl::OUString sBottomBorder( String( RTL_CONSTASCII_USTRINGPARAM( "BottomBorder" ) ) );
static const rtl::OUString sLeftBorder( String( RTL_CONSTASCII_USTRINGPARAM( "LeftBorder" ) ) );
- static const rtl::OUString sRightBorder( String( RTL_CONSTASCII_USTRINGPARAM( "RightBorder" ) ) );
+ static const rtl::OUString sRightBorder( String( RTL_CONSTASCII_USTRINGPARAM( "RightBorder" ) ) );
static const rtl::OUString sDiagonalTLBR( RTL_CONSTASCII_USTRINGPARAM ( "DiagonalTLBR" ) );
static const rtl::OUString sDiagonalBLTR( RTL_CONSTASCII_USTRINGPARAM ( "DiagonalBLTR" ) );
@@ -7804,7 +7803,7 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl
Reference< XCell > xCell( xCellRange->getCellByPosition( nColumn, nRow ) );
Reference< XPropertySet > xPropSet( xCell, UNO_QUERY_THROW );
- if ( nFlags & LinePositionLeft )
+ if ( nFlags & LinePositionLeft )
xPropSet->setPropertyValue( sLeftBorder, Any( aBorderLine ) );
if ( nFlags & LinePositionTop )
xPropSet->setPropertyValue( sTopBorder, Any( aBorderLine ) );
@@ -7817,7 +7816,7 @@ void ApplyCellLineAttributes( const SdrObject* pLine, Reference< XTable >& xTabl
if ( nFlags & LinePositionBLTR )
xPropSet->setPropertyValue( sDiagonalBLTR, Any( sal_True ) );
aIter++;
- }
+ }
}
catch( Exception& )
{
@@ -7856,7 +7855,7 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
CreateTableRows( xColumnRowRange->getRows(), aRows, pGroup->GetSnapRect().Bottom() );
CreateTableColumns( xColumnRowRange->getColumns(), aColumns, pGroup->GetSnapRect().Right() );
-
+
sal_Int32 nCellCount = aRows.size() * aColumns.size();
sal_Int32 *pMergedCellIndexTable = new sal_Int32[ nCellCount ];
for ( sal_Int32 i = 0; i < nCellCount; i++ )
@@ -7892,7 +7891,7 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
}
}
}
-
+
// applying text
OutlinerParaObject* pParaObject = pObj->GetOutlinerParaObject();
if ( pParaObject )
@@ -7912,21 +7911,21 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
{
std::vector< sal_Int32 > vPositions; // containing cell indexes + cell position
GetLinePositions( pObj, aRows, aColumns, vPositions, pGroup->GetSnapRect() );
-
+
// correcting merged cell position
std::vector< sal_Int32 >::iterator aIter( vPositions.begin() );
while( aIter != vPositions.end() )
{
sal_Int32 nOldPosition = *aIter & 0xffff;
- sal_Int32 nOldFlags = *aIter & 0xffff0000;
+ sal_Int32 nOldFlags = *aIter & 0xffff0000;
sal_Int32 nNewPosition = pMergedCellIndexTable[ nOldPosition ] | nOldFlags;
- *aIter++ = nNewPosition;
+ *aIter++ = nNewPosition;
}
ApplyCellLineAttributes( pObj, xTable, vPositions, aColumns.size() );
}
}
delete[] pMergedCellIndexTable;
-
+
// we are replacing the whole group object by a single table object, so
// possibly connections to the group object have to be removed.
if ( pSolverContainer )
@@ -7943,9 +7942,9 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
if ( pPtr->pBObj == pPartObj )
pPtr->pBObj = NULL;
}
- //In MS, the one_row_one_col table is made up of five shape,the connector is connected to some part of a table.
- //but in AOO, the connector is connected to the whole group table,so the connector obj is a group table when export by AOO.
- //should process this situation when import.
+ //I n MS, the one_row_one_col table is made up of five shape,the connector is connected to some part of a table.
+ // but in AOO, the connector is connected to the whole group table,so the connector obj is a group table when export by AOO.
+ // should process this situation when import.
if ( pPtr->pAObj == pGroup )
pPtr->pAObj = pTable;
if ( pPtr->pBObj == pGroup )
@@ -7956,7 +7955,7 @@ SdrObject* SdrPowerPointImport::CreateTable( SdrObject* pGroup, sal_uInt32* pTab
pTable->SetSnapRect( pGroup->GetSnapRect() );
pRet = pTable;
- //Remove Objects from shape map
+ // Remove Objects from shape map
SdrObjListIter aIter( *pGroup, IM_DEEPWITHGROUPS );
while( aIter.IsMore() )
{
@@ -7987,7 +7986,7 @@ sal_Bool SdrPowerPointImport::IsVerticalText() const
MSO_TextFlow eTextFlow = (MSO_TextFlow)( GetPropertyValue( DFF_Prop_txflTextFlow ) & 0xFFFF );
switch( eTextFlow )
{
- case mso_txflTtoBA : // Top to Bottom @-font, above -> below
+ case mso_txflTtoBA : // Top to Bottom @-font, above -> below
case mso_txflTtoBN : // Top to Bottom non-@, above -> below
case mso_txflVertN : // Vertical, non-@, above -> below
bVerticalText = !bVerticalText;
@@ -7995,7 +7994,7 @@ sal_Bool SdrPowerPointImport::IsVerticalText() const
default: break;
}
}
-
+
return bVerticalText;
}
@@ -8003,12 +8002,12 @@ void SdrPowerPointImport::ApplyTextAnchorAttributes( PPTTextObj& rTextObj, SfxIt
{
SdrTextVertAdjust eTVA;
SdrTextHorzAdjust eTHA;
-
+
sal_uInt32 nTextFlags = rTextObj.GetTextFlags();
nTextFlags &= PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT
| PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_CENTER | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_BLOCK;
-
+
if ( IsVerticalText() )
{
eTVA = SDRTEXTVERTADJUST_BLOCK;
@@ -8034,8 +8033,8 @@ void SdrPowerPointImport::ApplyTextAnchorAttributes( PPTTextObj& rTextObj, SfxIt
eTHA = SDRTEXTHORZADJUST_LEFT;
break;
- default:
- break;
+ default:
+ break;
}
// if there is a 100% use of following attributes, the textbox can been aligned also in vertical direction
switch ( eTextAnchor )
@@ -8046,7 +8045,7 @@ void SdrPowerPointImport::ApplyTextAnchorAttributes( PPTTextObj& rTextObj, SfxIt
{
// check if it is sensible to use the centered alignment
sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
- if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left or also right aligned pararagraphs
+ if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left or also right aligned paragraphs
eTVA = SDRTEXTVERTADJUST_CENTER; // the text has to be displayed using the full width;
}
break;
@@ -8086,8 +8085,8 @@ void SdrPowerPointImport::ApplyTextAnchorAttributes( PPTTextObj& rTextObj, SfxIt
eTVA = SDRTEXTVERTADJUST_BOTTOM;
break;
- default:
- break;
+ default:
+ break;
}
// if there is a 100% usage of following attributes, the textbox can be aligned also in horizontal direction
switch ( eTextAnchor )
@@ -8098,7 +8097,7 @@ void SdrPowerPointImport::ApplyTextAnchorAttributes( PPTTextObj& rTextObj, SfxIt
{
// check if it is sensible to use the centered alignment
sal_uInt32 nMask = PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_LEFT | PPT_TEXTOBJ_FLAGS_PARA_ALIGNMENT_USED_RIGHT;
- if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left or also right aligned pararagraphs
+ if ( ( nTextFlags & nMask ) != nMask ) // if the textobject has left or also right aligned paragraphs
eTHA = SDRTEXTHORZADJUST_CENTER; // the text has to be displayed using the full width;
}
break;
@@ -8116,3 +8115,5 @@ void SdrPowerPointImport::ApplyTextAnchorAttributes( PPTTextObj& rTextObj, SfxIt
rSet.Put( SdrTextVertAdjustItem( eTVA ) );
rSet.Put( SdrTextHorzAdjustItem( eTHA ) );
}
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/fpicker/source/win32/filepicker/asyncrequests.hxx b/main/fpicker/source/win32/filepicker/asyncrequests.hxx
index b0b931b383..46d4ea4517 100644
--- a/main/fpicker/source/win32/filepicker/asyncrequests.hxx
+++ b/main/fpicker/source/win32/filepicker/asyncrequests.hxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -41,9 +41,9 @@
//-----------------------------------------------------------------------------
#ifdef css
- #error "Clash on using CSS as namespace define."
+ #error "Clash on using CSS as namespace define."
#else
- #define css ::com::sun::star
+ #define css ::com::sun::star
#endif
namespace fpicker{
@@ -55,80 +55,80 @@ namespace vista{
*/
class Request
{
- //-------------------------------------------------------------------------
- public:
-
- static const ::sal_Int32 WAIT_INFINITE = 0;
-
- //-------------------------------------------------------------------------
- // interface
- //-------------------------------------------------------------------------
-
- public:
-
- //---------------------------------------------------------------------
- explicit Request()
- : m_aJoiner ( )
- , m_nRequest (-1)
- , m_lArguments( )
- {
- m_aJoiner.reset();
- }
-
- //---------------------------------------------------------------------
- virtual ~Request() {};
-
- //---------------------------------------------------------------------
- void setRequest(::sal_Int32 nRequest)
- {
- m_nRequest = nRequest;
- }
-
- //---------------------------------------------------------------------
- ::sal_Int32 getRequest()
- {
- return m_nRequest;
- }
-
- //---------------------------------------------------------------------
- void clearArguments()
- {
- m_lArguments.clear();
- }
-
- //---------------------------------------------------------------------
- template< class TArgumentType >
- void setArgument(const ::rtl::OUString& sName ,
- const TArgumentType& aValue)
- {
- m_lArguments[sName] <<= aValue;
- }
-
- //---------------------------------------------------------------------
- template< class TArgumentType >
- TArgumentType getArgumentOrDefault(const ::rtl::OUString& sName ,
- const TArgumentType& aDefault)
- {
- return m_lArguments.getUnpackedValueOrDefault(sName, aDefault);
- }
-
- //---------------------------------------------------------------------
- void wait(::sal_Int32 nMilliSeconds = WAIT_INFINITE);
-
+ //-------------------------------------------------------------------------
+ public:
+
+ static const ::sal_Int32 WAIT_INFINITE = 0;
+
+ //-------------------------------------------------------------------------
+ // interface
+ //-------------------------------------------------------------------------
+
+ public:
+
+ //---------------------------------------------------------------------
+ explicit Request()
+ : m_aJoiner ( )
+ , m_nRequest (-1)
+ , m_lArguments( )
+ {
+ m_aJoiner.reset();
+ }
+
+ //---------------------------------------------------------------------
+ virtual ~Request() {};
+
+ //---------------------------------------------------------------------
+ void setRequest(::sal_Int32 nRequest)
+ {
+ m_nRequest = nRequest;
+ }
+
+ //---------------------------------------------------------------------
+ ::sal_Int32 getRequest()
+ {
+ return m_nRequest;
+ }
+
+ //---------------------------------------------------------------------
+ void clearArguments()
+ {
+ m_lArguments.clear();
+ }
+
+ //---------------------------------------------------------------------
+ template< class TArgumentType >
+ void setArgument(const ::rtl::OUString& sName ,
+ const TArgumentType& aValue)
+ {
+ m_lArguments[sName] <<= aValue;
+ }
+
+ //---------------------------------------------------------------------
+ template< class TArgumentType >
+ TArgumentType getArgumentOrDefault(const ::rtl::OUString& sName ,
+ const TArgumentType& aDefault)
+ {
+ return m_lArguments.getUnpackedValueOrDefault(sName, aDefault);
+ }
+
+ //---------------------------------------------------------------------
+ void wait(::sal_Int32 nMilliSeconds = WAIT_INFINITE);
+
void waitProcessMessages();
-
- //---------------------------------------------------------------------
- void notify();
-
- //-------------------------------------------------------------------------
- // member
- //-------------------------------------------------------------------------
-
- private:
-
- ::osl::Condition m_aJoiner;
- ::sal_Int32 m_nRequest;
- ::comphelper::SequenceAsHashMap m_lArguments;
+
+ //---------------------------------------------------------------------
+ void notify();
+
+ //-------------------------------------------------------------------------
+ // member
+ //-------------------------------------------------------------------------
+
+ private:
+
+ ::osl::Condition m_aJoiner;
+ ::sal_Int32 m_nRequest;
+ ::comphelper::SequenceAsHashMap m_lArguments;
};
typedef ::boost::shared_ptr< Request > RequestRef;
@@ -137,81 +137,81 @@ typedef ::std::queue< RequestRef > RequestQueue;
//-----------------------------------------------------------------------------
class RequestHandler
{
- public:
- virtual void before() = 0;
- virtual void doRequest(const RequestRef& rRequest) = 0;
- virtual void after() = 0;
+ public:
+ virtual void before() = 0;
+ virtual void doRequest(const RequestRef& rRequest) = 0;
+ virtual void after() = 0;
};
typedef ::boost::shared_ptr< RequestHandler > RequestHandlerRef;
//-----------------------------------------------------------------------------
-/** @todo docuemnt me
+/** @todo document me
*/
class AsyncRequests : private ::cppu::BaseMutex
- , public ::osl::Thread
+ , public ::osl::Thread
{
- public:
- static const ::sal_Int16 PROCESS_MESSAGES = 2;
- static const ::sal_Int16 BLOCKED = 1;
- static const ::sal_Int16 NON_BLOCKED = 0;
-
- //---------------------------------------------------------------------
- /** creates the new asynchronous request executor.
- */
- explicit AsyncRequests(const RequestHandlerRef& rHandler);
-
- void setHandler(const RequestHandlerRef& rHandler)
- {
- m_rHandler = rHandler;
- }
-
- //---------------------------------------------------------------------
- /** does nothing special / except to make sure our class won't be inline .-)
- */
- virtual ~AsyncRequests();
-
- //---------------------------------------------------------------------
- /** @todo document me
- */
+ public:
+ static const ::sal_Int16 PROCESS_MESSAGES = 2;
+ static const ::sal_Int16 BLOCKED = 1;
+ static const ::sal_Int16 NON_BLOCKED = 0;
+
+ //---------------------------------------------------------------------
+ /** creates the new asynchronous request executor.
+ */
+ explicit AsyncRequests(const RequestHandlerRef& rHandler);
+
+ void setHandler(const RequestHandlerRef& rHandler)
+ {
+ m_rHandler = rHandler;
+ }
+
+ //---------------------------------------------------------------------
+ /** does nothing special / except to make sure our class won't be inline .-)
+ */
+ virtual ~AsyncRequests();
+
+ //---------------------------------------------------------------------
+ /** @todo document me
+ */
void triggerRequestProcessMessages (const RequestRef& rRequest);
-
- //---------------------------------------------------------------------
- /** @todo document me
- */
- void triggerRequestBlocked(const RequestRef& rRequest);
-
- //---------------------------------------------------------------------
- /** @todo document me
- */
- void triggerRequestNonBlocked(const RequestRef& rRequest);
-
- //---------------------------------------------------------------------
- /** @todo document me
- */
- void triggerRequestDirectly(const RequestRef& rRequest);
-
- //---------------------------------------------------------------------
- /** @todo document me
- */
- void triggerRequestThreadAware(const RequestRef& rRequest,
- ::sal_Int16 nWait );
-
- private:
-
- //---------------------------------------------------------------------
- /** our STA .-)
- * Will run between start() & finish(). Internally it runs a loop ...
- * waiting for requests. Every request will be executed synchronously
- * in blocked mode.
- */
- virtual void SAL_CALL run();
-
- private:
-
- ::sal_Bool m_bFinish;
- RequestHandlerRef m_rHandler;
- RequestQueue m_lRequests;
+
+ //---------------------------------------------------------------------
+ /** @todo document me
+ */
+ void triggerRequestBlocked(const RequestRef& rRequest);
+
+ //---------------------------------------------------------------------
+ /** @todo document me
+ */
+ void triggerRequestNonBlocked(const RequestRef& rRequest);
+
+ //---------------------------------------------------------------------
+ /** @todo document me
+ */
+ void triggerRequestDirectly(const RequestRef& rRequest);
+
+ //---------------------------------------------------------------------
+ /** @todo document me
+ */
+ void triggerRequestThreadAware(const RequestRef& rRequest,
+ ::sal_Int16 nWait );
+
+ private:
+
+ //---------------------------------------------------------------------
+ /** our STA .-)
+ * Will run between start() & finish(). Internally it runs a loop...
+ * waiting for requests. Every request will be executed synchronously
+ * in blocked mode.
+ */
+ virtual void SAL_CALL run();
+
+ private:
+
+ ::sal_Bool m_bFinish;
+ RequestHandlerRef m_rHandler;
+ RequestQueue m_lRequests;
};
} // namespace vista
@@ -221,3 +221,5 @@ class AsyncRequests : private ::cppu::BaseMutex
#undef css
#endif // FPICKER_WIN32_VISTA_ASYNCREQUESTS_HXX
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/l10ntools/source/tagtest.cxx b/main/l10ntools/source/tagtest.cxx
index 898172f62a..7a294d880d 100644
--- a/main/l10ntools/source/tagtest.cxx
+++ b/main/l10ntools/source/tagtest.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -34,7 +34,7 @@
#define HAS_FLAG( nFlags, nFlag ) ( ( nFlags & nFlag ) != 0 )
#define SET_FLAG( nFlags, nFlag ) ( nFlags |= nFlag )
-#define RESET_FLAG( nFlags, nFlag ) ( nFlags &= ~nFlag ) // ~ = Bitweises NOT
+#define RESET_FLAG( nFlags, nFlag ) ( nFlags &= ~nFlag ) // ~ = bitwise NOT
@@ -48,8 +48,8 @@ TokenInfo::TokenInfo( TokenId pnId, sal_uInt16 nP, String paStr, ParserMessageLi
, nId( pnId )
, nPos(nP)
{
- if ( nId == TAG_COMMONSTART || nId == TAG_COMMONEND )
- SplitTag( rErrorList );
+ if ( nId == TAG_COMMONSTART || nId == TAG_COMMONEND )
+ SplitTag( rErrorList );
}
enum tagcheck { TC_START, TC_HAS_TAG_NAME, TC_HAS_PROP_NAME_EQ, TC_HAS_PROP_NAME_EQ_SP, TC_HAS_PROP_NAME_SP, TC_INSIDE_STRING, TC_PROP_FINISHED, TC_CLOSED, TC_CLOSED_SPACE, TC_CLOSETAG, TC_CLOSETAG_HAS_TAG_NAME, TC_FINISHED, TC_ERROR };
@@ -86,34 +86,34 @@ CLOSETAG_HAS_TAG_NAME '>' -> FINISHED
*/
void TokenInfo::SplitTag( ParserMessageList &rErrorList )
{
- sal_uInt16 nLastPos = 2; // skip initial \<
- sal_uInt16 nCheckPos = nLastPos;
- String aDelims( String::CreateFromAscii( " \\=>/" ) );
- String aPortion;
- String aValue; // store the value of a property
- ByteString aName; // store the name of a property/tag
- sal_Bool bCheckName = sal_False;
- sal_Bool bCheckEmpty = sal_False;
- sal_Unicode cDelim;
- tagcheck aState = TC_START;
-
- // skip blanks
- while ( nLastPos < aTokenString.Len() && aTokenString.GetChar( nLastPos ) == ' ')
- nLastPos++;
-
- nCheckPos = aTokenString.SearchChar( aDelims.GetBuffer(), nLastPos );
- while ( nCheckPos != STRING_NOTFOUND && !( aState == TC_FINISHED || aState == TC_ERROR ) )
- {
- aPortion = aTokenString.Copy( nLastPos, nCheckPos-nLastPos );
+ sal_uInt16 nLastPos = 2; // skip initial \<
+ sal_uInt16 nCheckPos = nLastPos;
+ String aDelims( String::CreateFromAscii( " \\=>/" ) );
+ String aPortion;
+ String aValue; // store the value of a property
+ ByteString aName; // store the name of a property/tag
+ sal_Bool bCheckName = sal_False;
+ sal_Bool bCheckEmpty = sal_False;
+ sal_Unicode cDelim;
+ tagcheck aState = TC_START;
+
+ // skip blanks
+ while ( nLastPos < aTokenString.Len() && aTokenString.GetChar( nLastPos ) == ' ')
+ nLastPos++;
+
+ nCheckPos = aTokenString.SearchChar( aDelims.GetBuffer(), nLastPos );
+ while ( nCheckPos != STRING_NOTFOUND && !( aState == TC_FINISHED || aState == TC_ERROR ) )
+ {
+ aPortion = aTokenString.Copy( nLastPos, nCheckPos-nLastPos );
- if ( aTokenString.GetChar( nCheckPos ) == '\\' )
- nCheckPos++;
+ if ( aTokenString.GetChar( nCheckPos ) == '\\' )
+ nCheckPos++;
- cDelim = aTokenString.GetChar( nCheckPos );
- nCheckPos++;
+ cDelim = aTokenString.GetChar( nCheckPos );
+ nCheckPos++;
- switch ( aState )
- {
+ switch ( aState )
+ {
// START ' ' -> HAS_TAG_NAME
// START '/' -> CLOSED
// START '>' -> FINISHED
@@ -124,7 +124,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
case ' ': aState = TC_HAS_TAG_NAME;
bCheckName = sal_True;
break;
- case '/':
+ case '/':
{
if ( aPortion.Len() == 0 )
{
@@ -211,7 +211,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
case TC_INSIDE_STRING:
switch ( cDelim )
{
- case '\"':
+ case '\"':
{
aState = TC_PROP_FINISHED;
aValue += aPortion;
@@ -231,7 +231,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
}
}
break;
- default:
+ default:
{
aState = TC_INSIDE_STRING;
aValue += aPortion;
@@ -331,7 +331,7 @@ void TokenInfo::SplitTag( ParserMessageList &rErrorList )
else
{
aName = ByteString( aPortion, RTL_TEXTENCODING_UTF8 );
- // "a-zA-Z_-.0-9"
+ // "a-zA-Z_-.0-9"
xub_StrLen nCount;
sal_Bool bBroken = sal_False;
const sal_Char* aBuf = aName.GetBuffer();
@@ -391,7 +391,7 @@ sal_Bool TokenInfo::IsPropertyRelevant( const ByteString &aName, const String &a
return sal_False;
if ( aTagName.EqualsAscii( "image" ) && (aName.Equals( "width" ) || aName.Equals( "height" )) )
return sal_False;
-
+
return sal_True;
}
@@ -406,7 +406,7 @@ sal_Bool TokenInfo::IsPropertyValueValid( const ByteString &aName, const String
} */
if ( aTagName.EqualsAscii( "caseinline" ) && aName.Equals( "select" ) )
{
- return /*!aValue.EqualsAscii("OS2") && removed due to i56740 */
+ return /*!aValue.EqualsAscii("OS2") && removed due to i56740 */
!aValue.EqualsAscii("");
}
@@ -433,10 +433,10 @@ sal_Bool TokenInfo::IsPropertyInvariant( const ByteString &aName, const String &
sal_Bool TokenInfo::IsPropertyFixable( const ByteString &aName ) const
{
// name everything that is allowed to be fixed automatically here
- if ( (aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "hid" ))
- || (aTagName.EqualsAscii( "link" ) && aName.Equals( "href" ))
- || (aTagName.EqualsAscii( "alt" ) && aName.Equals( "id" ))
- || (aTagName.EqualsAscii( "variable" ) && aName.Equals( "id" ))
+ if ( (aTagName.EqualsAscii( "ahelp" ) && aName.Equals( "hid" ))
+ || (aTagName.EqualsAscii( "link" ) && aName.Equals( "href" ))
+ || (aTagName.EqualsAscii( "alt" ) && aName.Equals( "id" ))
+ || (aTagName.EqualsAscii( "variable" ) && aName.Equals( "id" ))
|| (aTagName.EqualsAscii( "image" ) && aName.Equals( "src" ))
|| (aTagName.EqualsAscii( "image" ) && aName.Equals( "id" ) ))
return sal_True;
@@ -455,7 +455,7 @@ sal_Bool TokenInfo::MatchesTranslation( TokenInfo& rInfo, sal_Bool bGenErrors, P
if ( !aTagName.Equals( rInfo.aTagName ) )
return sal_False;
- // If one of the tags has formating errors already it does make no sense to check here, so return right away
+ // If one of the tags has formatting errors already it does make no sense to check here, so return right away
if ( bGenErrors && ( bIsBroken || rInfo.bIsBroken ) )
return sal_True;
@@ -509,7 +509,7 @@ sal_Bool TokenInfo::MatchesTranslation( TokenInfo& rInfo, sal_Bool bGenErrors, P
}
}
- // if we reach here eather
+ // if we reach here either
// the tags match completely or
// the tags match but not the properties and we generated errors for that
return sal_True;
@@ -546,26 +546,26 @@ String TokenInfo::MakeTag() const
void ParserMessageList::AddError( sal_uInt16 nErrorNr, ByteString aErrorText, const TokenInfo &rTag )
{
- Insert( new ParserError( nErrorNr, aErrorText, rTag ), LIST_APPEND );
+ Insert( new ParserError( nErrorNr, aErrorText, rTag ), LIST_APPEND );
}
void ParserMessageList::AddWarning( sal_uInt16 nErrorNr, ByteString aErrorText, const TokenInfo &rTag )
{
- Insert( new ParserWarning( nErrorNr, aErrorText, rTag ), LIST_APPEND );
+ Insert( new ParserWarning( nErrorNr, aErrorText, rTag ), LIST_APPEND );
}
sal_Bool ParserMessageList::HasErrors()
{
- sal_uInt16 i;
- for ( i=0 ; i < Count() ; i++ )
- if ( GetObject( i )->IsError() )
- return sal_True;
- return sal_False;
+ sal_uInt16 i;
+ for ( i=0 ; i < Count() ; i++ )
+ if ( GetObject( i )->IsError() )
+ return sal_True;
+ return sal_False;
}
struct Tag
{
- String GetName() const { return String::CreateFromAscii( pName ); };
+ String GetName() const { return String::CreateFromAscii( pName ); };
const char* pName;
TokenId nTag;
};
@@ -603,7 +603,7 @@ static const Tag aKnownTags[] =
{ "<#GRAPHIC>", TAG_GRAPHIC },
{ "<#NEXTVERSION>", TAG_NEXTVERSION },
- // { "<#GROUP_SYSSWITCH>", TAG_GROUP_SYSSWITCH },
+ // { "<#GROUP_SYSSWITCH>", TAG_GROUP_SYSSWITCH },
{ "<#WIN>", TAG_WIN },
{ "<#UNIX>", TAG_UNIX },
{ "<#MAC>", TAG_MAC },
@@ -642,7 +642,7 @@ static const Tag aKnownTags[] =
{ "<Common Tag>", TAG_COMMONSTART },
{ "</Common Tag>", TAG_COMMONEND },
- { "<no more tags>", TAG_NOMORETAGS },
+ { "<no more tags>", TAG_NOMORETAGS },
{ "", TAG_UNKNOWN_TAG },
};
@@ -655,10 +655,10 @@ SimpleParser::SimpleParser()
void SimpleParser::Parse( String PaSource )
{
- aSource = PaSource;
+ aSource = PaSource;
nPos = 0;
aLastToken.Erase();
- aNextTag = TokenInfo( TAG_NOMORETAGS, TOK_INVALIDPOS );
+ aNextTag = TokenInfo( TAG_NOMORETAGS, TOK_INVALIDPOS );
aTokenList.Clear();
};
@@ -684,7 +684,7 @@ TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList )
bool bEven = true;
sal_uInt16 nQuotePos = 0;
sal_uInt16 nQuotedQuotesPos = aLastToken.SearchAscii( "\\\"" );
- sal_uInt16 nQuotedBackPos = aLastToken.SearchAscii( "\\\\" ); // this is only to kick out quoted backslashes
+ sal_uInt16 nQuotedBackPos = aLastToken.SearchAscii( "\\\\" ); // this is only to kick out quoted backslashes
while ( nQuotedQuotesPos != STRING_NOTFOUND )
{
if ( nQuotedBackPos <= nQuotedQuotesPos )
@@ -695,7 +695,7 @@ TokenInfo SimpleParser::GetNextToken( ParserMessageList &rErrorList )
bEven = !bEven;
}
nQuotedQuotesPos = aLastToken.SearchAscii( "\\\"", nQuotePos );
- nQuotedBackPos = aLastToken.SearchAscii( "\\\\", nQuotePos ); // this is only to kick out quoted backslashes
+ nQuotedBackPos = aLastToken.SearchAscii( "\\\\", nQuotePos ); // this is only to kick out quoted backslashes
}
if ( !bEven )
{
@@ -740,7 +740,7 @@ String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, sal_uInt
// sal_uInt16 nStyle1StartPos = aSource.SearchAscii( "<#", nPos );
sal_uInt16 nStyle2StartPos = aSource.SearchAscii( "$[", nPos );
sal_uInt16 nStyle3StartPos = aSource.SearchAscii( "\\<", nPos );
- sal_uInt16 nStyle4StartPos = aSource.SearchAscii( "\\\\", nPos ); // this is only to kick out quoted backslashes
+ sal_uInt16 nStyle4StartPos = aSource.SearchAscii( "\\\\", nPos ); // this is only to kick out quoted backslashes
rTagStartPos = 0;
@@ -750,15 +750,15 @@ String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, sal_uInt
nStyle3StartPos = aSource.SearchAscii( "\\<", nStyle3StartPos+1 );
*/
if ( STRING_NOTFOUND == nStyle2StartPos && STRING_NOTFOUND == nStyle3StartPos )
- return String(); // no more tokens
+ return String(); // no more tokens
- if ( nStyle4StartPos < nStyle2StartPos && nStyle4StartPos <= nStyle3StartPos ) // <= to make sure \\ is always handled first
+ if ( nStyle4StartPos < nStyle2StartPos && nStyle4StartPos <= nStyle3StartPos ) // <= to make sure \\ is always handled first
{ // Skip quoted Backslash
nPos = nStyle4StartPos +2;
return GetNextTokenString( rErrorList, rTagStartPos );
}
-/* if ( nStyle1StartPos < nStyle2StartPos && nStyle1StartPos <= nStyle3StartPos ) // <= to make sure our spechial tags are recognized before all others
+/* if ( nStyle1StartPos < nStyle2StartPos && nStyle1StartPos <= nStyle3StartPos ) // <= to make sure our special tags are recognized before all others
{ // test for <# ... > style tokens
sal_uInt16 nEndPos = aSource.SearchAscii( ">", nStyle1StartPos );
if ( nEndPos == STRING_NOTFOUND )
@@ -785,11 +785,11 @@ String SimpleParser::GetNextTokenString( ParserMessageList &rErrorList, sal_uInt
else
{ // test for \< ... \> style tokens
sal_uInt16 nEndPos = aSource.SearchAscii( "\\>", nStyle3StartPos);
- sal_uInt16 nQuotedBackPos = aSource.SearchAscii( "\\\\", nStyle3StartPos ); // this is only to kick out quoted backslashes
+ sal_uInt16 nQuotedBackPos = aSource.SearchAscii( "\\\\", nStyle3StartPos ); // this is only to kick out quoted backslashes
while ( nQuotedBackPos <= nEndPos && nQuotedBackPos != STRING_NOTFOUND )
{
nEndPos = aSource.SearchAscii( "\\>", nQuotedBackPos +2);
- nQuotedBackPos = aSource.SearchAscii( "\\\\", nQuotedBackPos +2 ); // this is only to kick out quoted backslashes
+ nQuotedBackPos = aSource.SearchAscii( "\\\\", nQuotedBackPos +2 ); // this is only to kick out quoted backslashes
}
if ( nEndPos == STRING_NOTFOUND )
{ // Token is incomplete. Skip start and search for better ones
@@ -827,7 +827,7 @@ TokenParser::TokenParser()
void TokenParser::Parse( const String &aCode, ParserMessageList* pList )
{
- pErrorList = pList;
+ pErrorList = pList;
//Scanner initialisieren
aParser.Parse( aCode );
@@ -842,7 +842,7 @@ void TokenParser::Parse( const String &aCode, ParserMessageList* pList )
nActiveRefTypes = 0;
- //Ausfuehren der Start-Produktion
+ //Ausfuehren der Start-Produktion
Paragraph();
//Es wurde nicht die ganze Kette abgearbeitet, bisher ist aber
@@ -898,7 +898,7 @@ void TokenParser::Parse( const String &aCode, ParserMessageList* pList )
}
}
}
- pErrorList = NULL;
+ pErrorList = NULL;
}
void TokenParser::Paragraph()
@@ -1215,9 +1215,9 @@ void TokenParser::TagPair()
break;
case TAG_COMMONSTART:
{
- //remember tag so we can give the original tag in case of an error
- TokenInfo aEndTag( aTag );
- aEndTag.nId = TAG_COMMONEND;
+ // remember tag so we can give the original tag in case of an error
+ TokenInfo aEndTag( aTag );
+ aEndTag.nId = TAG_COMMONEND;
match( aTag, TAG_COMMONSTART );
Paragraph();
match( aTag, aEndTag );
@@ -1235,25 +1235,25 @@ void TokenParser::TagRef()
{
case TAG_GRAPHIC:
case TAG_NEXTVERSION:
- {
+ {
if ( !HAS_FLAG( nActiveRefTypes, TAG_NOGROUP( aTag.nId ) ) )
{
TokenId aThisToken = aTag.nId;
SET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) );
match( aTag, aTag );
Paragraph();
- if ( aThisToken == TAG_GRAPHIC )
+ if ( aThisToken == TAG_GRAPHIC )
match( aTag, TAG_ENDGRAPHIC );
- else
+ else
match( aTag, TAG_VERSIONEND );
- // don't reset since allowed only once per paragraph
+ // don't reset since allowed only once per paragraph
// RESET_FLAG( nActiveRefTypes, TAG_NOGROUP( aThisToken ) );
}
else
{
ParseError( 11, "Tags <#GRAPHIC>,<#NEXTVERSION> allowed only once per paragraph at", aTag );
}
- }
+ }
break;
case TAG_AVIS:
case TAG_AHID:
@@ -1282,7 +1282,7 @@ void TokenParser::TagRef()
case TAG_KEY:
case TAG_INDEX:
case TAG_TITEL:
- case TAG_REFSTART:
+ case TAG_REFSTART:
{
if ( !HAS_FLAG( nActiveRefTypes, TAG_NOGROUP( aTag.nId ) ) )
{
@@ -1309,40 +1309,40 @@ void TokenParser::TagRef()
sal_Bool TokenParser::match( const TokenInfo &aCurrentToken, const TokenId &aExpectedToken )
{
- return match( aCurrentToken, TokenInfo( aExpectedToken, TOK_INVALIDPOS ) );
+ return match( aCurrentToken, TokenInfo( aExpectedToken, TOK_INVALIDPOS ) );
}
sal_Bool TokenParser::match( const TokenInfo &aCurrentToken, const TokenInfo &rExpectedToken )
{
- TokenInfo aExpectedToken( rExpectedToken );
+ TokenInfo aExpectedToken( rExpectedToken );
if ( aCurrentToken.nId == aExpectedToken.nId )
{
- if ( ( aCurrentToken.nId == TAG_COMMONEND
+ if ( ( aCurrentToken.nId == TAG_COMMONEND
&& aCurrentToken.GetTagName().Equals( aExpectedToken.GetTagName() ) )
|| aCurrentToken.nId != TAG_COMMONEND )
- {
- aTag = aParser.GetNextToken( *pErrorList );
- return sal_True;
- }
+ {
+ aTag = aParser.GetNextToken( *pErrorList );
+ return sal_True;
+ }
}
- if ( aExpectedToken.nId == TAG_COMMONEND )
- {
- aExpectedToken.aTokenString.Insert( String::CreateFromAscii( "Close tag for " ), 0 );
- }
+ if ( aExpectedToken.nId == TAG_COMMONEND )
+ {
+ aExpectedToken.aTokenString.Insert( String::CreateFromAscii( "Close tag for " ), 0 );
+ }
- ByteString sTmp( "Expected Symbol" );
- if ( aCurrentToken.nId == TAG_NOMORETAGS )
- {
+ ByteString sTmp( "Expected Symbol" );
+ if ( aCurrentToken.nId == TAG_NOMORETAGS )
+ {
ParseError( 7, sTmp, aExpectedToken );
- }
- else
- {
+ }
+ else
+ {
sTmp += ": ";
sTmp += ByteString( aParser.GetLexem( aExpectedToken ), RTL_TEXTENCODING_UTF8 );
sTmp += " near ";
ParseError( 7, sTmp, aCurrentToken );
- }
+ }
return sal_False;
}
@@ -1350,7 +1350,7 @@ void TokenParser::ParseError( sal_uInt16 nErrNr, ByteString aErrMsg, const Token
{
pErrorList->AddError( nErrNr, aErrMsg, rTag);
- // Das Fehlerhafte Tag ueberspringen
+ // Das Fehlerhafte Tag ueberspringen
aTag = aParser.GetNextToken( *pErrorList );
}
@@ -1361,17 +1361,17 @@ ParserMessage::ParserMessage( sal_uInt16 PnErrorNr, ByteString PaErrorText, cons
, nTagBegin( 0 )
, nTagLength( 0 )
{
- String aLexem( SimpleParser::GetLexem( rTag ) );
- aErrorText.Append(": ");
+ String aLexem( SimpleParser::GetLexem( rTag ) );
+ aErrorText.Append(": ");
aErrorText += ByteString( aLexem, RTL_TEXTENCODING_UTF8 );
- if ( rTag.nId == TAG_NOMORETAGS )
- aErrorText.Append(" at end of line ");
- else if ( rTag.nPos != TOK_INVALIDPOS )
- {
- aErrorText.Append(" at Position ");
- aErrorText.Append( ByteString::CreateFromInt32( rTag.nPos ) );
- }
- nTagBegin = rTag.nPos;
+ if ( rTag.nId == TAG_NOMORETAGS )
+ aErrorText.Append(" at end of line ");
+ else if ( rTag.nPos != TOK_INVALIDPOS )
+ {
+ aErrorText.Append(" at Position ");
+ aErrorText.Append( ByteString::CreateFromInt32( rTag.nPos ) );
+ }
+ nTagBegin = rTag.nPos;
nTagLength = aLexem.Len();
}
@@ -1396,23 +1396,23 @@ sal_Bool LingTest::IsTagMandatory( TokenInfo const &aToken, TokenId &aMetaTokens
|| TAG_AHID == aTokenId
|| TAG_GRAPHIC == aTokenId
|| TAG_NEXTVERSION == aTokenId
- || ( TAG_GROUP_META == aTokenGroup && (aMetaTokens & aTokenId) == aTokenId ) )
- {
- if ( TAG_GROUP_META == aTokenGroup )
- aMetaTokens |= aTokenId;
- return sal_True;
- }
- else if ( TAG_COMMONSTART == aTokenId
- || TAG_COMMONEND == aTokenId )
- {
- String aTagName = aToken.GetTagName();
- return !(aTagName.EqualsIgnoreCaseAscii( "comment" )
+ || ( TAG_GROUP_META == aTokenGroup && (aMetaTokens & aTokenId) == aTokenId ) )
+ {
+ if ( TAG_GROUP_META == aTokenGroup )
+ aMetaTokens |= aTokenId;
+ return sal_True;
+ }
+ else if ( TAG_COMMONSTART == aTokenId
+ || TAG_COMMONEND == aTokenId )
+ {
+ String aTagName = aToken.GetTagName();
+ return !(aTagName.EqualsIgnoreCaseAscii( "comment" )
|| aTagName.EqualsIgnoreCaseAscii( "bookmark_value" )
|| aTagName.EqualsIgnoreCaseAscii( "emph" )
|| aTagName.EqualsIgnoreCaseAscii( "item" )
|| aTagName.EqualsIgnoreCaseAscii( "br" ) );
- }
- return sal_False;
+ }
+ return sal_False;
}
void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, sal_Bool bFixTags )
@@ -1425,54 +1425,54 @@ void LingTest::CheckTags( TokenList &aReference, TokenList &aTestee, sal_Bool bF
aCompareWarningList.Remove();
}
- /* in xml tags, do not require the following tags
- comment
- bookmark_value
- emph
- item
- br
- */
+ /* in xml tags, do not require the following tags
+ comment
+ bookmark_value
+ emph
+ item
+ br
+ */
- // filter uninteresting Tags
- TokenId aMetaTokens = 0;
+ // filter uninteresting Tags
+ TokenId aMetaTokens = 0;
for ( i=0 ; i < aReference.Count() ; i++ )
{
if ( !IsTagMandatory( aReference.GetObject( i ), aMetaTokens ) )
aReference.GetObject( i ).SetDone();
}
- aMetaTokens = 0;
+ aMetaTokens = 0;
for ( i=0 ; i < aTestee.Count() ; i++ )
{
if ( !IsTagMandatory( aTestee.GetObject( i ), aMetaTokens ) )
aTestee.GetObject( i ).SetDone();
}
- // remove all matching tags
+ // remove all matching tags
for ( i=0 ; i < aReference.Count() ; i++ )
- {
- if ( aReference.GetObject( i ).IsDone() )
- continue;
+ {
+ if ( aReference.GetObject( i ).IsDone() )
+ continue;
- sal_Bool bTagFound = sal_False;
- for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ )
- {
- if ( aTestee.GetObject( j ).IsDone() )
- continue;
+ sal_Bool bTagFound = sal_False;
+ for ( j=0 ; j < aTestee.Count() && !bTagFound ; j++ )
+ {
+ if ( aTestee.GetObject( j ).IsDone() )
+ continue;
- if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), sal_False, aCompareWarningList ) )
- {
- aReference.GetObject( i ).SetDone();
- aTestee.GetObject( j ).SetDone();
- bTagFound = sal_True;
- }
- }
- }
+ if ( aReference.GetObject( i ).MatchesTranslation( aTestee.GetObject( j ), sal_False, aCompareWarningList ) )
+ {
+ aReference.GetObject( i ).SetDone();
+ aTestee.GetObject( j ).SetDone();
+ bTagFound = sal_True;
+ }
+ }
+ }
- sal_Bool bCanFix = sal_True;
+ sal_Bool bCanFix = sal_True;
- if ( bFixTags )
- {
+ if ( bFixTags )
+ {
// we fix only if its a really simple case
sal_uInt16 nTagCount = 0;
for ( i=0 ; i < aReference.Count() ; i++ )
@@ -1568,3 +1568,4 @@ void LingTest::CheckTestee( GSILine *aTestee, sal_Bool bHasSourceLine, sal_Bool
}
}
+
diff --git a/main/sw/source/core/text/pormulti.cxx b/main/sw/source/core/text/pormulti.cxx
index 98a3762116..512b39c68c 100644
--- a/main/sw/source/core/text/pormulti.cxx
+++ b/main/sw/source/core/text/pormulti.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -32,10 +32,10 @@
#include <editeng/charrotateitem.hxx>
#include <vcl/outdev.hxx>
#include <fmtfld.hxx>
-#include <fldbas.hxx> // SwField
+#include <fldbas.hxx> // SwField
#include <txatbase.hxx>
-#include <fmtruby.hxx> // SwFmtRuby
-#include <txtatr.hxx> // SwTxtRuby
+#include <fmtruby.hxx> // SwFmtRuby
+#include <txtatr.hxx> // SwTxtRuby
#include <charfmt.hxx>
#include <txtinet.hxx>
#include <fchrfmt.hxx>
@@ -43,7 +43,7 @@
#include <SwPortionHandler.hxx>
#include <pormulti.hxx> // SwMultiPortion
#include <inftxt.hxx> // SwTxtSizeInfo
-#include <itrpaint.hxx> // SwTxtPainter
+#include <itrpaint.hxx> // SwTxtPainter
#include <viewopt.hxx> // SwViewOptions
#include <itrform2.hxx> // SwTxtFormatter
#include <porfld.hxx> // SwFldPortion
@@ -51,7 +51,7 @@
#include <breakit.hxx>
#include <pagefrm.hxx>
#include <rowfrm.hxx>
-#include <pagedesc.hxx> // SwPageDesc
+#include <pagedesc.hxx> // SwPageDesc
#include <tgrditem.hxx>
#include <swtable.hxx>
#include <fmtfsize.hxx>
@@ -60,7 +60,7 @@ using namespace ::com::sun::star;
extern sal_Bool IsUnderlineBreak( const SwLinePortion& rPor, const SwFont& rFnt );
/*-----------------10.10.00 15:23-------------------
- * class SwMultiPortion
+ * class SwMultiPortion
*
* A SwMultiPortion is not a simple portion,
* it's a container, which contains almost a SwLineLayoutPortion.
@@ -98,7 +98,7 @@ void SwMultiPortion::CalcSize( SwTxtFormatter& rLine, SwTxtFormatInfo &rInf )
SetFlyInCntnt( sal_True );
if( IsRuby() && ( OnTop() == ( pLay == &GetRoot() ) ) )
{
- // An empty phonetic line don't need an ascent or a height.
+ // An empty phonetic line doesn't need an ascent or a height.
if( !pLay->Width() )
{
pLay->SetAscent( 0 );
@@ -120,8 +120,8 @@ void SwMultiPortion::CalcSize( SwTxtFormatter& rLine, SwTxtFormatInfo &rInf )
if( nTmp > Height() )
{
KSHORT nAdd = ( nTmp - Height() ) / 2;
- GetRoot().SetAscent( GetRoot().GetAscent() + nAdd );
- GetRoot().Height( GetRoot().Height() + nAdd );
+ GetRoot().SetAscent( GetRoot().GetAscent() + nAdd );
+ GetRoot().Height( GetRoot().Height() + nAdd );
Height( nTmp );
}
nTmp = ((SwDoubleLinePortion*)this)->GetBrackets()->nAscent;
@@ -137,16 +137,16 @@ long SwMultiPortion::CalcSpacing( long , const SwTxtSizeInfo & ) const
sal_Bool SwMultiPortion::ChgSpaceAdd( SwLineLayout*, long ) const
{
- return sal_False;
+ return sal_False;
}
/*************************************************************************
- * virtual SwMultiPortion::HandlePortion()
+ * virtual SwMultiPortion::HandlePortion()
*************************************************************************/
void SwMultiPortion::HandlePortion( SwPortionHandler& rPH ) const
{
- rPH.Text( GetLen(), GetWhichPor() );
+ rPH.Text( GetLen(), GetWhichPor() );
}
/*-----------------01.11.00 14:21-------------------
@@ -179,29 +179,29 @@ void SwMultiPortion::ActualizeTabulator()
* --------------------------------------------------*/
SwRotatedPortion::SwRotatedPortion( const SwMultiCreator& rCreate,
- xub_StrLen nEnd, sal_Bool bRTL ) : SwMultiPortion( nEnd )
+ xub_StrLen nEnd, sal_Bool bRTL ) : SwMultiPortion( nEnd )
{
const SvxCharRotateItem* pRot = (SvxCharRotateItem*)rCreate.pItem;
if( !pRot )
{
- const SwTxtAttr& rAttr = *rCreate.pAttr;
- const SfxPoolItem *const pItem =
- CharFmt::GetItem(rAttr, RES_CHRATR_ROTATE);
- if ( pItem )
- {
- pRot = static_cast<const SvxCharRotateItem*>(pItem);
- }
+ const SwTxtAttr& rAttr = *rCreate.pAttr;
+ const SfxPoolItem *const pItem =
+ CharFmt::GetItem(rAttr, RES_CHRATR_ROTATE);
+ if ( pItem )
+ {
+ pRot = static_cast<const SvxCharRotateItem*>(pItem);
+ }
}
if( pRot )
- {
- sal_uInt8 nDir;
- if ( bRTL )
- nDir = pRot->IsBottomToTop() ? 3 : 1;
- else
- nDir = pRot->IsBottomToTop() ? 1 : 3;
-
- SetDirection( nDir );
- }
+ {
+ sal_uInt8 nDir;
+ if ( bRTL )
+ nDir = pRot->IsBottomToTop() ? 3 : 1;
+ else
+ nDir = pRot->IsBottomToTop() ? 1 : 3;
+
+ SetDirection( nDir );
+ }
}
/*---------------------------------------------------
@@ -209,55 +209,55 @@ SwRotatedPortion::SwRotatedPortion( const SwMultiCreator& rCreate,
* --------------------------------------------------*/
SwBidiPortion::SwBidiPortion( xub_StrLen nEnd, sal_uInt8 nLv )
- : SwMultiPortion( nEnd ), nLevel( nLv )
+ : SwMultiPortion( nEnd ), nLevel( nLv )
{
- SetBidi();
+ SetBidi();
- if ( nLevel % 2 )
- SetDirection( DIR_RIGHT2LEFT );
- else
- SetDirection( DIR_LEFT2RIGHT );
+ if ( nLevel % 2 )
+ SetDirection( DIR_RIGHT2LEFT );
+ else
+ SetDirection( DIR_LEFT2RIGHT );
}
long SwBidiPortion::CalcSpacing( long nSpaceAdd, const SwTxtSizeInfo& rInf ) const
{
- return HasTabulator() ? 0 : GetSpaceCnt(rInf) * nSpaceAdd / SPACING_PRECISION_FACTOR;
+ return HasTabulator() ? 0 : GetSpaceCnt(rInf) * nSpaceAdd / SPACING_PRECISION_FACTOR;
}
sal_Bool SwBidiPortion::ChgSpaceAdd( SwLineLayout* pCurr, long nSpaceAdd ) const
{
sal_Bool bRet = sal_False;
- if( !HasTabulator() && nSpaceAdd > 0 && !pCurr->IsSpaceAdd() )
- {
- pCurr->CreateSpaceAdd();
- pCurr->SetLLSpaceAdd( nSpaceAdd, 0 );
- bRet = sal_True;
- }
-
- return bRet;
+ if( !HasTabulator() && nSpaceAdd > 0 && !pCurr->IsSpaceAdd() )
+ {
+ pCurr->CreateSpaceAdd();
+ pCurr->SetLLSpaceAdd( nSpaceAdd, 0 );
+ bRet = sal_True;
+ }
+
+ return bRet;
}
xub_StrLen SwBidiPortion::GetSpaceCnt( const SwTxtSizeInfo &rInf ) const
{
- // Calculate number of blanks for justified alignment
- SwLinePortion* pPor = GetRoot().GetFirstPortion();
- xub_StrLen nTmpStart = rInf.GetIdx();
- xub_StrLen nNull = 0;
- xub_StrLen nBlanks;
-
- for( nBlanks = 0; pPor; pPor = pPor->GetPortion() )
- {
- if( pPor->InTxtGrp() )
- nBlanks = nBlanks + ((SwTxtPortion*)pPor)->GetSpaceCnt( rInf, nNull );
- else if ( pPor->IsMultiPortion() &&
- ((SwMultiPortion*)pPor)->IsBidi() )
- nBlanks = nBlanks + ((SwBidiPortion*)pPor)->GetSpaceCnt( rInf );
-
- ((SwTxtSizeInfo &)rInf).SetIdx( rInf.GetIdx() + pPor->GetLen() );
- }
- ((SwTxtSizeInfo &)rInf).SetIdx( nTmpStart );
- return nBlanks;
+ // Calculate number of blanks for justified alignment
+ SwLinePortion* pPor = GetRoot().GetFirstPortion();
+ xub_StrLen nTmpStart = rInf.GetIdx();
+ xub_StrLen nNull = 0;
+ xub_StrLen nBlanks;
+
+ for( nBlanks = 0; pPor; pPor = pPor->GetPortion() )
+ {
+ if( pPor->InTxtGrp() )
+ nBlanks = nBlanks + ((SwTxtPortion*)pPor)->GetSpaceCnt( rInf, nNull );
+ else if ( pPor->IsMultiPortion() &&
+ ((SwMultiPortion*)pPor)->IsBidi() )
+ nBlanks = nBlanks + ((SwBidiPortion*)pPor)->GetSpaceCnt( rInf );
+
+ ((SwTxtSizeInfo &)rInf).SetIdx( rInf.GetIdx() + pPor->GetLen() );
+ }
+ ((SwTxtSizeInfo &)rInf).SetIdx( nTmpStart );
+ return nBlanks;
}
/*-----------------01.11.00 14:22-------------------
@@ -269,12 +269,12 @@ xub_StrLen SwBidiPortion::GetSpaceCnt( const SwTxtSizeInfo &rInf ) const
* --------------------------------------------------*/
SwDoubleLinePortion::SwDoubleLinePortion( SwDoubleLinePortion& rDouble,
- xub_StrLen nEnd ) :
- SwMultiPortion( nEnd ),
- pBracket( 0 )
+ xub_StrLen nEnd ) :
+ SwMultiPortion( nEnd ),
+ pBracket( 0 )
{
- SetDirection( rDouble.GetDirection() );
- SetDouble();
+ SetDirection( rDouble.GetDirection() );
+ SetDouble();
if( rDouble.GetBrackets() )
{
SetBrackets( rDouble );
@@ -308,12 +308,12 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwMultiCreator& rCreate,
const SwTxtAttr& rAttr = *rCreate.pAttr;
pBracket->nStart = *rAttr.GetStart();
- const SfxPoolItem * const pItem =
- CharFmt::GetItem( rAttr, RES_CHRATR_TWO_LINES );
- if ( pItem )
- {
- pTwo = static_cast<const SvxTwoLinesItem*>(pItem);
- }
+ const SfxPoolItem * const pItem =
+ CharFmt::GetItem( rAttr, RES_CHRATR_TWO_LINES );
+ if ( pItem )
+ {
+ pTwo = static_cast<const SvxTwoLinesItem*>(pItem);
+ }
}
if( pTwo )
{
@@ -329,15 +329,15 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwMultiCreator& rCreate,
if( pBracket->cPre > 255 )
{
String aTxt( pBracket->cPre );
- nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 );
+ nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 );
}
pBracket->nPreScript = nTmp;
nTmp = SW_SCRIPTS;
if( pBracket->cPost > 255 )
{
String aTxt( pBracket->cPost );
- nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 );
- }
+ nTmp = SwScriptInfo::WhichFont( 0, &aTxt, 0 );
+ }
pBracket->nPostScript = nTmp;
if( !pBracket->cPre && !pBracket->cPost )
@@ -346,11 +346,11 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwMultiCreator& rCreate,
pBracket = 0;
}
- // double line portions have the same direction as the frame directions
- if ( rCreate.nLevel % 2 )
- SetDirection( DIR_RIGHT2LEFT );
- else
- SetDirection( DIR_LEFT2RIGHT );
+ // double line portions have the same direction as the frame directions
+ if ( rCreate.nLevel % 2 )
+ SetDirection( DIR_RIGHT2LEFT );
+ else
+ SetDirection( DIR_LEFT2RIGHT );
}
@@ -363,8 +363,8 @@ SwDoubleLinePortion::SwDoubleLinePortion( const SwMultiCreator& rCreate,
* --------------------------------------------------*/
void SwDoubleLinePortion::PaintBracket( SwTxtPaintInfo &rInf,
- long nSpaceAdd,
- sal_Bool bOpen ) const
+ long nSpaceAdd,
+ sal_Bool bOpen ) const
{
sal_Unicode cCh = bOpen ? pBracket->cPre : pBracket->cPost;
if( !cCh )
@@ -395,7 +395,7 @@ void SwDoubleLinePortion::PaintBracket( SwTxtPaintInfo &rInf,
}
/*-----------------25.10.00 16:26-------------------
- * SwDoubleLinePortion::SetBrackets creates the bracket-structur
+ * SwDoubleLinePortion::SetBrackets creates the bracket-structure
* and fills it, if not both characters are 0x00.
* --------------------------------------------------*/
@@ -523,7 +523,7 @@ void SwDoubleLinePortion::CalcBlanks( SwTxtFormatInfo &rInf )
long SwDoubleLinePortion::CalcSpacing( long nSpaceAdd, const SwTxtSizeInfo & ) const
{
- return HasTabulator() ? 0 : GetSpaceCnt() * nSpaceAdd / SPACING_PRECISION_FACTOR;
+ return HasTabulator() ? 0 : GetSpaceCnt() * nSpaceAdd / SPACING_PRECISION_FACTOR;
}
/*-----------------01.11.00 14:29-------------------
@@ -537,35 +537,35 @@ long SwDoubleLinePortion::CalcSpacing( long nSpaceAdd, const SwTxtSizeInfo & ) c
* --------------------------------------------------*/
sal_Bool SwDoubleLinePortion::ChgSpaceAdd( SwLineLayout* pCurr,
- long nSpaceAdd ) const
+ long nSpaceAdd ) const
{
sal_Bool bRet = sal_False;
if( !HasTabulator() && nSpaceAdd > 0 )
{
- if( !pCurr->IsSpaceAdd() )
- {
- // The wider line gets the spaceadd from the surrounding line direct
+ if( !pCurr->IsSpaceAdd() )
+ {
+ // The wider line gets the spaceadd from the surrounding line direct
pCurr->CreateSpaceAdd();
- pCurr->SetLLSpaceAdd( nSpaceAdd, 0 );
+ pCurr->SetLLSpaceAdd( nSpaceAdd, 0 );
bRet = sal_True;
}
else
{
xub_StrLen nMyBlank = GetSmallerSpaceCnt();
xub_StrLen nOther = GetSpaceCnt();
- SwTwips nMultiSpace = pCurr->GetLLSpaceAdd( 0 ) * nMyBlank + nOther * nSpaceAdd;
+ SwTwips nMultiSpace = pCurr->GetLLSpaceAdd( 0 ) * nMyBlank + nOther * nSpaceAdd;
- if( nMyBlank )
+ if( nMyBlank )
nMultiSpace /= nMyBlank;
- if( nMultiSpace < KSHRT_MAX * SPACING_PRECISION_FACTOR )
+ if( nMultiSpace < KSHRT_MAX * SPACING_PRECISION_FACTOR )
{
-// pCurr->SetLLSpaceAdd( nMultiSpace, 0 );
- // --> FME 2006-07-11 #i65711# SetLLSpaceAdd replaces the first value,
- // instead we want to insert a new first value:
- std::vector<long>* pVec = pCurr->GetpLLSpaceAdd();
- pVec->insert( pVec->begin(), nMultiSpace );
- // <--
+// pCurr->SetLLSpaceAdd( nMultiSpace, 0 );
+ // --> FME 2006-07-11 #i65711# SetLLSpaceAdd replaces the first value,
+ // instead we want to insert a new first value:
+ std::vector<long>* pVec = pCurr->GetpLLSpaceAdd();
+ pVec->insert( pVec->begin(), nMultiSpace );
+ // <--
bRet = sal_True;
}
}
@@ -579,8 +579,8 @@ sal_Bool SwDoubleLinePortion::ChgSpaceAdd( SwLineLayout* pCurr,
void SwDoubleLinePortion::ResetSpaceAdd( SwLineLayout* pCurr )
{
- pCurr->RemoveFirstLLSpaceAdd();;
- if( !pCurr->GetLLSpaceAddCount() )
+ pCurr->RemoveFirstLLSpaceAdd();;
+ if( !pCurr->GetLLSpaceAddCount() )
pCurr->FinishSpaceAdd();
}
@@ -597,13 +597,13 @@ SwDoubleLinePortion::~SwDoubleLinePortion()
SwRubyPortion::SwRubyPortion( const SwRubyPortion& rRuby, xub_StrLen nEnd ) :
- SwMultiPortion( nEnd ),
- nRubyOffset( rRuby.GetRubyOffset() ),
- nAdjustment( rRuby.GetAdjustment() )
+ SwMultiPortion( nEnd ),
+ nRubyOffset( rRuby.GetRubyOffset() ),
+ nAdjustment( rRuby.GetAdjustment() )
{
- SetDirection( rRuby.GetDirection() ),
- SetTop( rRuby.OnTop() );
- SetRuby();
+ SetDirection( rRuby.GetDirection() ),
+ SetTop( rRuby.OnTop() );
+ SetRuby();
}
/*-----------------13.11.00 14:50-------------------
@@ -613,44 +613,44 @@ SwRubyPortion::SwRubyPortion( const SwRubyPortion& rRuby, xub_StrLen nEnd ) :
* --------------------------------------------------*/
SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
- const IDocumentSettingAccess& rIDocumentSettingAccess,
- xub_StrLen nEnd, xub_StrLen nOffs,
- const sal_Bool* pForceRubyPos )
- : SwMultiPortion( nEnd )
+ const IDocumentSettingAccess& rIDocumentSettingAccess,
+ xub_StrLen nEnd, xub_StrLen nOffs,
+ const sal_Bool* pForceRubyPos )
+ : SwMultiPortion( nEnd )
{
SetRuby();
- ASSERT( SW_MC_RUBY == rCreate.nId, "Ruby expected" );
+ ASSERT( SW_MC_RUBY == rCreate.nId, "Ruby expected" );
ASSERT( RES_TXTATR_CJK_RUBY == rCreate.pAttr->Which(), "Wrong attribute" );
const SwFmtRuby& rRuby = rCreate.pAttr->GetRuby();
nAdjustment = rRuby.GetAdjustment();
nRubyOffset = nOffs;
- // in grid mode we force the ruby text to the upper or lower line
- if ( pForceRubyPos )
- SetTop( *pForceRubyPos );
- else
- SetTop( ! rRuby.GetPosition() );
+ // in grid mode we force the ruby text to the upper or lower line
+ if ( pForceRubyPos )
+ SetTop( *pForceRubyPos );
+ else
+ SetTop( ! rRuby.GetPosition() );
- const SwCharFmt* pFmt = ((SwTxtRuby*)rCreate.pAttr)->GetCharFmt();
+ const SwCharFmt* pFmt = ((SwTxtRuby*)rCreate.pAttr)->GetCharFmt();
SwFont *pRubyFont;
if( pFmt )
{
const SwAttrSet& rSet = pFmt->GetAttrSet();
pRubyFont = new SwFont( rFnt );
- pRubyFont->SetDiffFnt( &rSet, &rIDocumentSettingAccess );
+ pRubyFont->SetDiffFnt( &rSet, &rIDocumentSettingAccess );
- // we do not allow a vertical font for the ruby text
- pRubyFont->SetVertical( rFnt.GetOrientation() );
+ // we do not allow a vertical font for the ruby text
+ pRubyFont->SetVertical( rFnt.GetOrientation() );
}
else
pRubyFont = NULL;
String aStr( rRuby.GetText(), nOffs, STRING_LEN );
SwFldPortion *pFld = new SwFldPortion( aStr, pRubyFont );
- pFld->SetNextOffset( nOffs );
+ pFld->SetNextOffset( nOffs );
pFld->SetFollow( sal_True );
- if( OnTop() )
+ if( OnTop() )
GetRoot().SetPortion( pFld );
else
{
@@ -658,19 +658,19 @@ SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
GetRoot().GetNext()->SetPortion( pFld );
}
- // ruby portions have the same direction as the frame directions
- if ( rCreate.nLevel % 2 )
- {
- // switch right and left ruby adjustment in rtl environment
- if ( 0 == nAdjustment )
- nAdjustment = 2;
- else if ( 2 == nAdjustment )
- nAdjustment = 0;
+ // ruby portions have the same direction as the frame directions
+ if ( rCreate.nLevel % 2 )
+ {
+ // switch right and left ruby adjustment in rtl environment
+ if ( 0 == nAdjustment )
+ nAdjustment = 2;
+ else if ( 2 == nAdjustment )
+ nAdjustment = 0;
- SetDirection( DIR_RIGHT2LEFT );
- }
- else
- SetDirection( DIR_LEFT2RIGHT );
+ SetDirection( DIR_RIGHT2LEFT );
+ }
+ else
+ SetDirection( DIR_LEFT2RIGHT );
}
/*-----------------13.11.00 14:56-------------------
@@ -678,7 +678,7 @@ SwRubyPortion::SwRubyPortion( const SwMultiCreator& rCreate, const SwFont& rFnt,
* In ruby portion there are different alignments for
* the ruby text and the main text.
* Left, right, centered and two possibilities of block adjustment
- * The block adjustment is realized by spacing between the characteres,
+ * The block adjustment is realized by spacing between the characters,
* either with a half space or no space in front of the first letter and
* a half space at the end of the last letter.
* Notice: the smaller line will be manipulated, normally it's the ruby line,
@@ -694,14 +694,14 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
return;
SwLineLayout *pCurr;
if( nLineDiff < 0 )
- { // The first line has to be adjusted.
+ { // The first line has to be adjusted.
if( GetTab1() )
return;
pCurr = &GetRoot();
nLineDiff = -nLineDiff;
}
else
- { // The second line has to be adjusted.
+ { // The second line has to be adjusted.
if( GetTab2() )
return;
pCurr = GetRoot().GetNext();
@@ -712,9 +712,9 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
sal_uInt16 nSub = 0;
switch ( nAdjustment )
{
- case 1: nRight = static_cast<sal_uInt16>(nLineDiff / 2); // no break
- case 2: nLeft = static_cast<sal_uInt16>(nLineDiff - nRight); break;
- case 3: nSub = 1; // no break
+ case 1: nRight = static_cast<sal_uInt16>(nLineDiff / 2); // no break
+ case 2: nLeft = static_cast<sal_uInt16>(nLineDiff - nRight); break;
+ case 3: nSub = 1; // no break
case 4:
{
xub_StrLen nCharCnt = 0;
@@ -728,19 +728,19 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
if( nCharCnt > nSub )
{
SwTwips nCalc = nLineDiff / ( nCharCnt - nSub );
- short nTmp;
+ short nTmp;
if( nCalc < SHRT_MAX )
nTmp = -short(nCalc);
else
nTmp = SHRT_MIN;
- pCurr->CreateSpaceAdd( SPACING_PRECISION_FACTOR * nTmp );
+ pCurr->CreateSpaceAdd( SPACING_PRECISION_FACTOR * nTmp );
nLineDiff -= nCalc * ( nCharCnt - 1 );
}
if( nLineDiff > 1 )
{
- nRight = static_cast<sal_uInt16>(nLineDiff / 2);
- nLeft = static_cast<sal_uInt16>(nLineDiff - nRight);
+ nRight = static_cast<sal_uInt16>(nLineDiff / 2);
+ nLeft = static_cast<sal_uInt16>(nLineDiff - nRight);
}
break;
}
@@ -765,7 +765,7 @@ void SwRubyPortion::_Adjust( SwTxtFormatInfo &rInf )
}
}
- pCurr->Width( Width() );
+ pCurr->Width( Width() );
rInf.SetIdx( nOldIdx );
}
@@ -829,19 +829,19 @@ void SwRubyPortion::CalcRubyOffset()
sal_Bool lcl_Has2Lines( const SwTxtAttr& rAttr, const SvxTwoLinesItem* &rpRef,
sal_Bool &rValue )
{
- const SfxPoolItem* pItem = CharFmt::GetItem( rAttr, RES_CHRATR_TWO_LINES );
- if( pItem )
- {
- rValue = ((SvxTwoLinesItem*)pItem)->GetValue();
- if( !rpRef )
- rpRef = (SvxTwoLinesItem*)pItem;
- else if( ((SvxTwoLinesItem*)pItem)->GetEndBracket() !=
- rpRef->GetEndBracket() ||
- ((SvxTwoLinesItem*)pItem)->GetStartBracket() !=
- rpRef->GetStartBracket() )
- rValue = sal_False;
- return sal_True;
- }
+ const SfxPoolItem* pItem = CharFmt::GetItem( rAttr, RES_CHRATR_TWO_LINES );
+ if( pItem )
+ {
+ rValue = ((SvxTwoLinesItem*)pItem)->GetValue();
+ if( !rpRef )
+ rpRef = (SvxTwoLinesItem*)pItem;
+ else if( ((SvxTwoLinesItem*)pItem)->GetEndBracket() !=
+ rpRef->GetEndBracket() ||
+ ((SvxTwoLinesItem*)pItem)->GetStartBracket() !=
+ rpRef->GetStartBracket() )
+ rValue = sal_False;
+ return sal_True;
+ }
return sal_False;
}
@@ -859,81 +859,81 @@ sal_Bool lcl_Has2Lines( const SwTxtAttr& rAttr, const SvxTwoLinesItem* &rpRef,
sal_Bool lcl_HasRotation( const SwTxtAttr& rAttr,
const SvxCharRotateItem* &rpRef, sal_Bool &rValue )
{
- const SfxPoolItem* pItem = CharFmt::GetItem( rAttr, RES_CHRATR_ROTATE );
- if ( pItem )
- {
- rValue = 0 != ((SvxCharRotateItem*)pItem)->GetValue();
- if( !rpRef )
- rpRef = (SvxCharRotateItem*)pItem;
- else if( ((SvxCharRotateItem*)pItem)->GetValue() !=
- rpRef->GetValue() )
- rValue = sal_False;
- return sal_True;
- }
+ const SfxPoolItem* pItem = CharFmt::GetItem( rAttr, RES_CHRATR_ROTATE );
+ if ( pItem )
+ {
+ rValue = 0 != ((SvxCharRotateItem*)pItem)->GetValue();
+ if( !rpRef )
+ rpRef = (SvxCharRotateItem*)pItem;
+ else if( ((SvxCharRotateItem*)pItem)->GetValue() !=
+ rpRef->GetValue() )
+ rValue = sal_False;
+ return sal_True;
+ }
return sal_False;
}
SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
- SwMultiPortion* pMulti ) const
+ SwMultiPortion* pMulti ) const
{
- SwScriptInfo& rSI = ((SwParaPortion*)GetParaPortion())->GetScriptInfo();
-
- // get the last embedding level
- sal_uInt8 nCurrLevel;
- if ( pMulti )
- {
- ASSERT( pMulti->IsBidi(), "Nested MultiPortion is not BidiPortion" )
- // level associated with bidi-portion;
- nCurrLevel = ((SwBidiPortion*)pMulti)->GetLevel();
- }
- else
- // no nested bidi portion required
- nCurrLevel = GetTxtFrm()->IsRightToLeft() ? 1 : 0;
-
- // check if there is a field at rPos:
- sal_uInt8 nNextLevel = nCurrLevel;
- sal_Bool bFldBidi = sal_False;
-
- if ( CH_TXTATR_BREAKWORD == GetChar( rPos ) )
- {
+ SwScriptInfo& rSI = ((SwParaPortion*)GetParaPortion())->GetScriptInfo();
+
+ // get the last embedding level
+ sal_uInt8 nCurrLevel;
+ if ( pMulti )
+ {
+ ASSERT( pMulti->IsBidi(), "Nested MultiPortion is not BidiPortion" )
+ // level associated with bidi-portion;
+ nCurrLevel = ((SwBidiPortion*)pMulti)->GetLevel();
+ }
+ else
+ // no nested bidi portion required
+ nCurrLevel = GetTxtFrm()->IsRightToLeft() ? 1 : 0;
+
+ // check if there is a field at rPos:
+ sal_uInt8 nNextLevel = nCurrLevel;
+ sal_Bool bFldBidi = sal_False;
+
+ if ( CH_TXTATR_BREAKWORD == GetChar( rPos ) )
+ {
bFldBidi = sal_True;
/*
- // examining the script of the field text should be sufficient
- // for 99% of all cases
- XubString aTxt = GetTxtFrm()->GetTxtNode()->GetExpandTxt( rPos, 1 );
-
- if ( pBreakIt->GetBreakIter().is() && aTxt.Len() )
- {
- sal_Bool bFldDir = ( i18n::ScriptType::COMPLEX ==
- pBreakIt->GetRealScriptOfText( aTxt, 0 ) );
- sal_Bool bCurrDir = ( 0 != ( nCurrLevel % 2 ) );
- if ( bFldDir != bCurrDir )
- {
- nNextLevel = nCurrLevel + 1;
- bFldBidi = sal_True;
- }
- }*/
- }
- else
- nNextLevel = rSI.DirType( rPos );
-
- if ( GetTxt().Len() != rPos && nNextLevel > nCurrLevel )
- {
- rPos = bFldBidi ? rPos + 1 : rSI.NextDirChg( rPos, &nCurrLevel );
- if ( STRING_LEN == rPos )
- return NULL;
- SwMultiCreator *pRet = new SwMultiCreator;
+ // examining the script of the field text should be sufficient
+ // for 99% of all cases
+ XubString aTxt = GetTxtFrm()->GetTxtNode()->GetExpandTxt( rPos, 1 );
+
+ if ( pBreakIt->GetBreakIter().is() && aTxt.Len() )
+ {
+ sal_Bool bFldDir = ( i18n::ScriptType::COMPLEX ==
+ pBreakIt->GetRealScriptOfText( aTxt, 0 ) );
+ sal_Bool bCurrDir = ( 0 != ( nCurrLevel % 2 ) );
+ if ( bFldDir != bCurrDir )
+ {
+ nNextLevel = nCurrLevel + 1;
+ bFldBidi = sal_True;
+ }
+ }*/
+ }
+ else
+ nNextLevel = rSI.DirType( rPos );
+
+ if ( GetTxt().Len() != rPos && nNextLevel > nCurrLevel )
+ {
+ rPos = bFldBidi ? rPos + 1 : rSI.NextDirChg( rPos, &nCurrLevel );
+ if ( STRING_LEN == rPos )
+ return NULL;
+ SwMultiCreator *pRet = new SwMultiCreator;
pRet->pItem = NULL;
- pRet->pAttr = NULL;
- pRet->nId = SW_MC_BIDI;
- pRet->nLevel = nCurrLevel + 1;
+ pRet->pAttr = NULL;
+ pRet->nId = SW_MC_BIDI;
+ pRet->nLevel = nCurrLevel + 1;
return pRet;
- }
+ }
- // a bidi portion can only contain other bidi portions
- if ( pMulti )
- return NULL;
+ // a bidi portion can only contain other bidi portions
+ if ( pMulti )
+ return NULL;
const SvxCharRotateItem* pRotate = NULL;
const SfxPoolItem* pRotItem;
@@ -997,8 +997,8 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
pRet->pItem = NULL;
pRet->pAttr = pRuby;
pRet->nId = SW_MC_RUBY;
- pRet->nLevel = GetTxtFrm()->IsRightToLeft() ? 1 : 0;
- return pRet;
+ pRet->nLevel = GetTxtFrm()->IsRightToLeft() ? 1 : 0;
+ return pRet;
}
if( n2Lines < nCount || ( pItem && pItem == p2Lines &&
rPos < GetTxt().Len() ) )
@@ -1035,7 +1035,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
aEnd.push_front( GetTxt().Len() );
}
pRet->nId = SW_MC_DOUBLE;
- pRet->nLevel = GetTxtFrm()->IsRightToLeft() ? 1 : 0;
+ pRet->nLevel = GetTxtFrm()->IsRightToLeft() ? 1 : 0;
// n2Lines is the index of the last 2-line-attribute, which contains
// the actual position.
@@ -1047,7 +1047,7 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
// - ruby attributes stops the 2-line-attribute, the end of the
// multiline is the start of the ruby attribute
// - 2-line-attributes with value "Off" or with different brackets,
- // these attributes may interrupt the winner, but they could be
+ // these attributes may interrupt the winner, but they could be
// neutralized by another 2-line-attribute starting at the same
// position with the same brackets as the winner-attribute.
@@ -1090,15 +1090,15 @@ SwMultiCreator* SwTxtSizeInfo::GetMultiCreator( xub_StrLen &rPos,
if( RES_TXTATR_CJK_RUBY == pTmp->Which() )
return pRet;
if( lcl_Has2Lines( *pTmp, p2Lines, bTwo ) )
- { // We have an interesting attribute..
+ { // We have an interesting attribute..
if( bTwo == bOn )
- { // .. with the same state, so the last attribute could
+ { // ...with the same state, so the last attribute could
// be continued.
if( aEnd.back() < *pTmp->End() )
aEnd.back() = *pTmp->End();
}
else
- { // .. with a different state.
+ { // ...with a different state.
bOn = bTwo;
// If this is smaller than the last on the stack, we put
// it on the stack. If it has the same endposition, the last
@@ -1275,21 +1275,21 @@ class SwSpaceManipulator
{
SwTxtPaintInfo& rInfo;
SwMultiPortion& rMulti;
- std::vector<long>* pOldSpaceAdd;
+ std::vector<long>* pOldSpaceAdd;
MSHORT nOldSpIdx;
- long nSpaceAdd;
+ long nSpaceAdd;
sal_Bool bSpaceChg : 1;
sal_uInt8 nOldDir : 2;
public:
SwSpaceManipulator( SwTxtPaintInfo& rInf, SwMultiPortion& rMult );
~SwSpaceManipulator();
void SecondLine();
- inline long GetSpaceAdd() const { return nSpaceAdd; }
+ inline long GetSpaceAdd() const { return nSpaceAdd; }
};
SwSpaceManipulator::SwSpaceManipulator( SwTxtPaintInfo& rInf,
- SwMultiPortion& rMult ) :
- rInfo( rInf ), rMulti( rMult )
+ SwMultiPortion& rMult ) :
+ rInfo( rInf ), rMulti( rMult )
{
pOldSpaceAdd = rInfo.GetpSpaceAdd();
nOldSpIdx = rInfo.GetSpaceIdx();
@@ -1297,22 +1297,22 @@ SwSpaceManipulator::SwSpaceManipulator( SwTxtPaintInfo& rInf,
rInfo.SetDirection( rMulti.GetDirection() );
bSpaceChg = sal_False;
- if( rMulti.IsDouble() )
+ if( rMulti.IsDouble() )
{
nSpaceAdd = ( pOldSpaceAdd && !rMulti.HasTabulator() ) ?
rInfo.GetSpaceAdd() : 0;
- if( rMulti.GetRoot().IsSpaceAdd() )
+ if( rMulti.GetRoot().IsSpaceAdd() )
{
- rInfo.SetpSpaceAdd( rMulti.GetRoot().GetpLLSpaceAdd() );
+ rInfo.SetpSpaceAdd( rMulti.GetRoot().GetpLLSpaceAdd() );
rInfo.ResetSpaceIdx();
bSpaceChg = rMulti.ChgSpaceAdd( &rMulti.GetRoot(), nSpaceAdd );
}
else if( rMulti.HasTabulator() )
- rInfo.SetpSpaceAdd( NULL );
+ rInfo.SetpSpaceAdd( NULL );
}
- else if ( ! rMulti.IsBidi() )
- {
- rInfo.SetpSpaceAdd( rMulti.GetRoot().GetpLLSpaceAdd() );
+ else if ( ! rMulti.IsBidi() )
+ {
+ rInfo.SetpSpaceAdd( rMulti.GetRoot().GetpLLSpaceAdd() );
rInfo.ResetSpaceIdx();
}
}
@@ -1321,19 +1321,19 @@ void SwSpaceManipulator::SecondLine()
{
if( bSpaceChg )
{
- rInfo.RemoveFirstSpaceAdd();
+ rInfo.RemoveFirstSpaceAdd();
bSpaceChg = sal_False;
}
SwLineLayout *pLay = rMulti.GetRoot().GetNext();
- if( pLay->IsSpaceAdd() )
+ if( pLay->IsSpaceAdd() )
{
- rInfo.SetpSpaceAdd( pLay->GetpLLSpaceAdd() );
+ rInfo.SetpSpaceAdd( pLay->GetpLLSpaceAdd() );
rInfo.ResetSpaceIdx();
bSpaceChg = rMulti.ChgSpaceAdd( pLay, nSpaceAdd );
}
else
{
- rInfo.SetpSpaceAdd( (!rMulti.IsDouble() || rMulti.HasTabulator() ) ?
+ rInfo.SetpSpaceAdd( (!rMulti.IsDouble() || rMulti.HasTabulator() ) ?
0 : pOldSpaceAdd );
rInfo.SetSpaceIdx( nOldSpIdx);
}
@@ -1343,10 +1343,10 @@ SwSpaceManipulator::~SwSpaceManipulator()
{
if( bSpaceChg )
{
- rInfo.RemoveFirstSpaceAdd();
+ rInfo.RemoveFirstSpaceAdd();
bSpaceChg = sal_False;
}
- rInfo.SetpSpaceAdd( pOldSpaceAdd );
+ rInfo.SetpSpaceAdd( pOldSpaceAdd );
rInfo.SetSpaceIdx( nOldSpIdx);
rInfo.SetDirection( nOldDir );
}
@@ -1358,66 +1358,65 @@ SwSpaceManipulator::~SwSpaceManipulator()
* --------------------------------------------------*/
void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
- SwMultiPortion& rMulti, const SwMultiPortion* pEnvPor )
+ SwMultiPortion& rMulti, const SwMultiPortion* pEnvPor )
{
- GETGRID( pFrm->FindPageFrm() )
- const sal_Bool bHasGrid = pGrid && GetInfo().SnapToGrid();
- sal_uInt16 nGridWidth = 0;
- sal_uInt16 nRubyHeight = 0;
- sal_Bool bRubyTop = sal_False;
-
- if ( bHasGrid )
- {
- nGridWidth = pGrid->GetBaseHeight();
- nRubyHeight = pGrid->GetRubyHeight();
- bRubyTop = ! pGrid->GetRubyTextBelow();
- }
-
- // do not allow grid mode for first line in ruby portion
- const sal_Bool bRubyInGrid = bHasGrid && rMulti.IsRuby();
-
- const sal_uInt16 nOldHeight = rMulti.Height();
- const sal_Bool bOldGridModeAllowed = GetInfo().SnapToGrid();
-
- if ( bRubyInGrid )
- {
- GetInfo().SetSnapToGrid( ! bRubyTop );
- rMulti.Height( pCurr->Height() );
- }
-
- SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() );
- sal_uInt8 nEnvDir = 0;
- sal_uInt8 nThisDir = 0;
- sal_uInt8 nFrmDir = 0;
- if ( rMulti.IsBidi() )
- {
- // these values are needed for the calculation of the x coordinate
- // and the layout mode
- ASSERT( ! pEnvPor || pEnvPor->IsBidi(),
- "Oh no, I expected a BidiPortion" )
- nFrmDir = GetInfo().GetTxtFrm()->IsRightToLeft() ? 1 : 0;
- nEnvDir = pEnvPor ? ((SwBidiPortion*)pEnvPor)->GetLevel() % 2 : nFrmDir;
- nThisDir = ((SwBidiPortion&)rMulti).GetLevel() % 2;
- }
+ GETGRID( pFrm->FindPageFrm() )
+ const sal_Bool bHasGrid = pGrid && GetInfo().SnapToGrid();
+ sal_uInt16 nGridWidth = 0;
+ sal_uInt16 nRubyHeight = 0;
+ sal_Bool bRubyTop = sal_False;
+
+ if ( bHasGrid )
+ {
+ nGridWidth = pGrid->GetBaseHeight();
+ nRubyHeight = pGrid->GetRubyHeight();
+ bRubyTop = ! pGrid->GetRubyTextBelow();
+ }
+
+ // do not allow grid mode for first line in ruby portion
+ const sal_Bool bRubyInGrid = bHasGrid && rMulti.IsRuby();
+
+ const sal_uInt16 nOldHeight = rMulti.Height();
+ const sal_Bool bOldGridModeAllowed = GetInfo().SnapToGrid();
+
+ if ( bRubyInGrid )
+ {
+ GetInfo().SetSnapToGrid( ! bRubyTop );
+ rMulti.Height( pCurr->Height() );
+ }
+
+ SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() );
+ sal_uInt8 nEnvDir = 0;
+ sal_uInt8 nThisDir = 0;
+ sal_uInt8 nFrmDir = 0;
+ if ( rMulti.IsBidi() )
+ {
+ // these values are needed for the calculation of the x coordinate
+ // and the layout mode
+ ASSERT( ! pEnvPor || pEnvPor->IsBidi(), "I expected a BidiPortion" )
+ nFrmDir = GetInfo().GetTxtFrm()->IsRightToLeft() ? 1 : 0;
+ nEnvDir = pEnvPor ? ((SwBidiPortion*)pEnvPor)->GetLevel() % 2 : nFrmDir;
+ nThisDir = ((SwBidiPortion&)rMulti).GetLevel() % 2;
+ }
#if OSL_DEBUG_LEVEL > 1
- // only paint first level bidi portions
- if( rMulti.Width() > 1 && ! pEnvPor )
- GetInfo().DrawViewOpt( rMulti, POR_FLD );
+ // only paint first level bidi portions
+ if( rMulti.Width() > 1 && ! pEnvPor )
+ GetInfo().DrawViewOpt( rMulti, POR_FLD );
#endif
- if ( bRubyInGrid )
- rMulti.Height( nOldHeight );
+ if ( bRubyInGrid )
+ rMulti.Height( nOldHeight );
- // do we have to repaint a post it portion?
- if( GetInfo().OnWin() && rMulti.GetPortion() &&
- ! rMulti.GetPortion()->Width() )
- rMulti.GetPortion()->PrePaint( GetInfo(), &rMulti );
+ // do we have to repaint a post it portion?
+ if( GetInfo().OnWin() && rMulti.GetPortion() &&
+ ! rMulti.GetPortion()->Width() )
+ rMulti.GetPortion()->PrePaint( GetInfo(), &rMulti );
// old values must be saved and restored at the end
xub_StrLen nOldLen = GetInfo().GetLen();
KSHORT nOldX = KSHORT(GetInfo().X());
- long nOldY = GetInfo().Y();
+ long nOldY = GetInfo().Y();
xub_StrLen nOldIdx = GetInfo().GetIdx();
SwSpaceManipulator aManip( GetInfo(), rMulti );
@@ -1443,109 +1442,109 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
if( rMulti.HasBrackets() )
{
- xub_StrLen nTmpOldIdx = GetInfo().GetIdx();
+ xub_StrLen nTmpOldIdx = GetInfo().GetIdx();
GetInfo().SetIdx(((SwDoubleLinePortion&)rMulti).GetBrackets()->nStart);
SeekAndChg( GetInfo() );
((SwDoubleLinePortion&)rMulti).PaintBracket( GetInfo(), 0, sal_True );
- GetInfo().SetIdx( nTmpOldIdx );
+ GetInfo().SetIdx( nTmpOldIdx );
}
KSHORT nTmpX = KSHORT(GetInfo().X());
SwLineLayout* pLay = &rMulti.GetRoot();// the first line of the multiportion
SwLinePortion* pPor = pLay->GetFirstPortion();//first portion of these line
- SwTwips nOfst = 0;
+ SwTwips nOfst = 0;
- // GetInfo().Y() is the baseline from the surrounding line. We must switch
+ // GetInfo().Y() is the baseline from the surrounding line. We must switch
// this temporary to the baseline of the inner lines of the multiportion.
- if( rMulti.HasRotation() )
- {
- if( rMulti.IsRevers() )
- {
- GetInfo().Y( nOldY - rMulti.GetAscent() );
- nOfst = nTmpX + rMulti.Width();
- }
- else
- {
- GetInfo().Y( nOldY - rMulti.GetAscent() + rMulti.Height() );
- nOfst = nTmpX;
- }
- }
- else if ( rMulti.IsBidi() )
- {
- // does the current bidi portion has the same direction
- // as its environment?
- if ( nEnvDir != nThisDir )
- {
- // different directions, we have to adjust the x coordinate
- SwTwips nMultiWidth = rMulti.Width() +
- rMulti.CalcSpacing( GetInfo().GetSpaceAdd(), GetInfo() );
-
- if ( nFrmDir == nThisDir )
- GetInfo().X( GetInfo().X() - nMultiWidth );
- else
- GetInfo().X( GetInfo().X() + nMultiWidth );
- }
-
- nOfst = nOldY - rMulti.GetAscent();
-
- // set layout mode
- aLayoutModeModifier.Modify( nThisDir );
- }
- else
- nOfst = nOldY - rMulti.GetAscent();
-
- sal_Bool bRest = pLay->IsRest();
+ if( rMulti.HasRotation() )
+ {
+ if( rMulti.IsRevers() )
+ {
+ GetInfo().Y( nOldY - rMulti.GetAscent() );
+ nOfst = nTmpX + rMulti.Width();
+ }
+ else
+ {
+ GetInfo().Y( nOldY - rMulti.GetAscent() + rMulti.Height() );
+ nOfst = nTmpX;
+ }
+ }
+ else if ( rMulti.IsBidi() )
+ {
+ // does the current bidi portion has the same direction
+ // as its environment?
+ if ( nEnvDir != nThisDir )
+ {
+ // different directions, we have to adjust the x coordinate
+ SwTwips nMultiWidth = rMulti.Width() +
+ rMulti.CalcSpacing( GetInfo().GetSpaceAdd(), GetInfo() );
+
+ if ( nFrmDir == nThisDir )
+ GetInfo().X( GetInfo().X() - nMultiWidth );
+ else
+ GetInfo().X( GetInfo().X() + nMultiWidth );
+ }
+
+ nOfst = nOldY - rMulti.GetAscent();
+
+ // set layout mode
+ aLayoutModeModifier.Modify( nThisDir );
+ }
+ else
+ nOfst = nOldY - rMulti.GetAscent();
+
+ sal_Bool bRest = pLay->IsRest();
sal_Bool bFirst = sal_True;
- ASSERT( 0 == GetInfo().GetUnderFnt() || rMulti.IsBidi(),
- " Only BiDi portions are allowed to use the common underlining font" )
-
- do
- {
- if ( bHasGrid )
- {
- if( rMulti.HasRotation() )
- {
- const sal_uInt16 nAdjustment = ( pLay->Height() - pPor->Height() ) / 2 +
- pPor->GetAscent();
- if( rMulti.IsRevers() )
- GetInfo().X( nOfst - nAdjustment );
- else
- GetInfo().X( nOfst + nAdjustment );
- }
- else
- {
- // special treatment for ruby portions in grid mode
- SwTwips nAdjustment = 0;
- if ( rMulti.IsRuby() )
- {
- if ( bRubyTop != ( pLay == &rMulti.GetRoot() ) )
- // adjust base text
- nAdjustment = ( pCurr->Height() - nRubyHeight - pPor->Height() ) / 2;
- else if ( bRubyTop )
- // adjust upper ruby text
- nAdjustment = nRubyHeight - pPor->Height();
- // else adjust lower ruby text
- }
-
- GetInfo().Y( nOfst + nAdjustment + pPor->GetAscent() );
- }
- }
- else if( rMulti.HasRotation() )
- {
- if( rMulti.IsRevers() )
- GetInfo().X( nOfst - AdjustBaseLine( *pLay, pPor, 0, 0, sal_True ) );
- else
- GetInfo().X( nOfst + AdjustBaseLine( *pLay, pPor ) );
- }
- else
- GetInfo().Y( nOfst + AdjustBaseLine( *pLay, pPor ) );
-
- sal_Bool bSeeked = sal_True;
+ ASSERT( 0 == GetInfo().GetUnderFnt() || rMulti.IsBidi(),
+ " Only BiDi portions are allowed to use the common underlining font" )
+
+ do
+ {
+ if ( bHasGrid )
+ {
+ if( rMulti.HasRotation() )
+ {
+ const sal_uInt16 nAdjustment = ( pLay->Height() - pPor->Height() ) / 2 +
+ pPor->GetAscent();
+ if( rMulti.IsRevers() )
+ GetInfo().X( nOfst - nAdjustment );
+ else
+ GetInfo().X( nOfst + nAdjustment );
+ }
+ else
+ {
+ // special treatment for ruby portions in grid mode
+ SwTwips nAdjustment = 0;
+ if ( rMulti.IsRuby() )
+ {
+ if ( bRubyTop != ( pLay == &rMulti.GetRoot() ) )
+ // adjust base text
+ nAdjustment = ( pCurr->Height() - nRubyHeight - pPor->Height() ) / 2;
+ else if ( bRubyTop )
+ // adjust upper ruby text
+ nAdjustment = nRubyHeight - pPor->Height();
+ // else adjust lower ruby text
+ }
+
+ GetInfo().Y( nOfst + nAdjustment + pPor->GetAscent() );
+ }
+ }
+ else if( rMulti.HasRotation() )
+ {
+ if( rMulti.IsRevers() )
+ GetInfo().X( nOfst - AdjustBaseLine( *pLay, pPor, 0, 0, sal_True ) );
+ else
+ GetInfo().X( nOfst + AdjustBaseLine( *pLay, pPor ) );
+ }
+ else
+ GetInfo().Y( nOfst + AdjustBaseLine( *pLay, pPor ) );
+
+ sal_Bool bSeeked = sal_True;
GetInfo().SetLen( pPor->GetLen() );
- if( bRest && pPor->InFldGrp() && !pPor->GetLen() )
+ if( bRest && pPor->InFldGrp() && !pPor->GetLen() )
{
if( ((SwFldPortion*)pPor)->HasFont() )
bSeeked = sal_False;
@@ -1562,119 +1561,119 @@ void SwTxtPainter::PaintMultiPortion( const SwRect &rPaint,
SeekAndChgBefore( GetInfo() );
}
else
- bSeeked = sal_False;
+ bSeeked = sal_False;
SwLinePortion *pNext = pPor->GetPortion();
if(GetInfo().OnWin() && pNext && !pNext->Width() )
{
if ( !bSeeked )
SeekAndChg( GetInfo() );
- pNext->PrePaint( GetInfo(), pPor );
+ pNext->PrePaint( GetInfo(), pPor );
+ }
+
+ CheckSpecialUnderline( pPor );
+ SwUnderlineFont* pUnderLineFnt = GetInfo().GetUnderFnt();
+ if ( pUnderLineFnt )
+ {
+ if ( rMulti.IsDouble() )
+ pUnderLineFnt->GetFont().SetProportion( 50 );
+ pUnderLineFnt->SetPos( GetInfo().GetPos() );
+ }
+
+ if ( rMulti.IsBidi() )
+ {
+ // we do not allow any rotation inside a bidi portion
+ SwFont* pTmpFont = GetInfo().GetFont();
+ pTmpFont->SetVertical( 0, GetInfo().GetTxtFrm()->IsVertical() );
}
- CheckSpecialUnderline( pPor );
- SwUnderlineFont* pUnderLineFnt = GetInfo().GetUnderFnt();
- if ( pUnderLineFnt )
- {
- if ( rMulti.IsDouble() )
- pUnderLineFnt->GetFont().SetProportion( 50 );
- pUnderLineFnt->SetPos( GetInfo().GetPos() );
- }
-
- if ( rMulti.IsBidi() )
- {
- // we do not allow any rotation inside a bidi portion
- SwFont* pTmpFont = GetInfo().GetFont();
- pTmpFont->SetVertical( 0, GetInfo().GetTxtFrm()->IsVertical() );
- }
-
- if( pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() )
- {
- // but we do allow nested bidi portions
- ASSERT( rMulti.IsBidi(), "Only nesting of bidi portions is allowed" )
- PaintMultiPortion( rPaint, (SwMultiPortion&)*pPor, &rMulti );
- }
- else
- pPor->Paint( GetInfo() );
-
- if( GetFnt()->IsURL() && pPor->InTxtGrp() )
+ if( pPor->IsMultiPortion() && ((SwMultiPortion*)pPor)->IsBidi() )
+ {
+ // but we do allow nested bidi portions
+ ASSERT( rMulti.IsBidi(), "Only nesting of bidi portions is allowed" )
+ PaintMultiPortion( rPaint, (SwMultiPortion&)*pPor, &rMulti );
+ }
+ else
+ pPor->Paint( GetInfo() );
+
+ if( GetFnt()->IsURL() && pPor->InTxtGrp() )
GetInfo().NotifyURL( *pPor );
bFirst &= !pPor->GetLen();
if( pNext || !pPor->IsMarginPortion() )
pPor->Move( GetInfo() );
- pPor = pNext;
+ pPor = pNext;
// If there's no portion left, we go to the next line
if( !pPor && pLay->GetNext() )
{
- pLay = pLay->GetNext();
- pPor = pLay->GetFirstPortion();
- bRest = pLay->IsRest();
- aManip.SecondLine();
-
- // delete underline font
- delete GetInfo().GetUnderFnt();
- GetInfo().SetUnderFnt( 0 );
-
- if( rMulti.HasRotation() )
- {
- if( rMulti.IsRevers() )
- {
- nOfst += pLay->Height();
- GetInfo().Y( nOldY - rMulti.GetAscent() );
- }
- else
- {
- nOfst -= pLay->Height();
- GetInfo().Y( nOldY - rMulti.GetAscent() + rMulti.Height() );
- }
- }
- else if ( bHasGrid && rMulti.IsRuby() )
- {
- GetInfo().X( nTmpX );
- if ( bRubyTop )
- {
- nOfst += nRubyHeight;
- GetInfo().SetSnapToGrid( sal_True );
- }
- else
- {
- nOfst += pCurr->Height() - nRubyHeight;
- GetInfo().SetSnapToGrid( sal_False );
- }
- } else
- {
- GetInfo().X( nTmpX );
- // We switch to the baseline of the next inner line
- nOfst += rMulti.GetRoot().Height();
- }
+ pLay = pLay->GetNext();
+ pPor = pLay->GetFirstPortion();
+ bRest = pLay->IsRest();
+ aManip.SecondLine();
+
+ // delete underline font
+ delete GetInfo().GetUnderFnt();
+ GetInfo().SetUnderFnt( 0 );
+
+ if( rMulti.HasRotation() )
+ {
+ if( rMulti.IsRevers() )
+ {
+ nOfst += pLay->Height();
+ GetInfo().Y( nOldY - rMulti.GetAscent() );
+ }
+ else
+ {
+ nOfst -= pLay->Height();
+ GetInfo().Y( nOldY - rMulti.GetAscent() + rMulti.Height() );
+ }
+ }
+ else if ( bHasGrid && rMulti.IsRuby() )
+ {
+ GetInfo().X( nTmpX );
+ if ( bRubyTop )
+ {
+ nOfst += nRubyHeight;
+ GetInfo().SetSnapToGrid( sal_True );
+ }
+ else
+ {
+ nOfst += pCurr->Height() - nRubyHeight;
+ GetInfo().SetSnapToGrid( sal_False );
+ }
+ } else
+ {
+ GetInfo().X( nTmpX );
+ // We switch to the baseline of the next inner line
+ nOfst += rMulti.GetRoot().Height();
+ }
}
} while( pPor );
- if ( bRubyInGrid )
- GetInfo().SetSnapToGrid( bOldGridModeAllowed );
+ if ( bRubyInGrid )
+ GetInfo().SetSnapToGrid( bOldGridModeAllowed );
- // delete underline font
- if ( ! rMulti.IsBidi() )
- {
- delete GetInfo().GetUnderFnt();
- GetInfo().SetUnderFnt( 0 );
- }
+ // delete underline font
+ if ( ! rMulti.IsBidi() )
+ {
+ delete GetInfo().GetUnderFnt();
+ GetInfo().SetUnderFnt( 0 );
+ }
- GetInfo().SetIdx( nOldIdx );
+ GetInfo().SetIdx( nOldIdx );
GetInfo().Y( nOldY );
if( rMulti.HasBrackets() )
{
- xub_StrLen nTmpOldIdx = GetInfo().GetIdx();
+ xub_StrLen nTmpOldIdx = GetInfo().GetIdx();
GetInfo().SetIdx(((SwDoubleLinePortion&)rMulti).GetBrackets()->nStart);
SeekAndChg( GetInfo() );
GetInfo().X( nOldX );
((SwDoubleLinePortion&)rMulti).PaintBracket( GetInfo(),
aManip.GetSpaceAdd(), sal_False );
- GetInfo().SetIdx( nTmpOldIdx );
+ GetInfo().SetIdx( nTmpOldIdx );
}
// Restore the saved values
GetInfo().X( nOldX );
@@ -1709,32 +1708,32 @@ sal_Bool lcl_ExtractFieldFollow( SwLineLayout* pLine, SwLinePortion* &rpFld )
}
/*----------------------------------------------------
- * lcl_TruncateMultiPortion
+ * lcl_TruncateMultiPortion
* If a multi portion completely has to go to the
- * next line, this function is called to trunctate
+ * next line, this function is called to truncate
* the rest of the remaining multi portion
* --------------------------------------------------*/
void lcl_TruncateMultiPortion( SwMultiPortion& rMulti, SwTxtFormatInfo& rInf,
- xub_StrLen nStartIdx )
+ xub_StrLen nStartIdx )
{
- rMulti.GetRoot().Truncate();
- rMulti.GetRoot().SetLen(0);
- rMulti.GetRoot().Width(0);
-// rMulti.CalcSize( *this, aInf );
- if ( rMulti.GetRoot().GetNext() )
- {
- rMulti.GetRoot().GetNext()->Truncate();
- rMulti.GetRoot().GetNext()->SetLen( 0 );
- rMulti.GetRoot().GetNext()->Width( 0 );
- }
- rMulti.Width( 0 );
- rMulti.SetLen(0);
- rInf.SetIdx( nStartIdx );
+ rMulti.GetRoot().Truncate();
+ rMulti.GetRoot().SetLen(0);
+ rMulti.GetRoot().Width(0);
+// rMulti.CalcSize( *this, aInf );
+ if ( rMulti.GetRoot().GetNext() )
+ {
+ rMulti.GetRoot().GetNext()->Truncate();
+ rMulti.GetRoot().GetNext()->SetLen( 0 );
+ rMulti.GetRoot().GetNext()->Width( 0 );
+ }
+ rMulti.Width( 0 );
+ rMulti.SetLen(0);
+ rInf.SetIdx( nStartIdx );
}
/*-----------------------------------------------------------------------------
- * SwTxtFormatter::BuildMultiPortion
+ * SwTxtFormatter::BuildMultiPortion
* manages the formatting of a SwMultiPortion. External, for the calling
* function, it seems to be a normal Format-function, internal it is like a
* SwTxtFrm::_Format with multiple BuildPortions
@@ -1744,14 +1743,14 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
SwMultiPortion& rMulti )
{
SwTwips nMaxWidth = rInf.Width();
- KSHORT nOldX = 0;
+ KSHORT nOldX = 0;
if( rMulti.HasBrackets() )
{
xub_StrLen nOldIdx = rInf.GetIdx();
rInf.SetIdx( ((SwDoubleLinePortion&)rMulti).GetBrackets()->nStart );
SeekAndChg( rInf );
- nOldX = KSHORT(GetInfo().X());
+ nOldX = KSHORT(GetInfo().X());
((SwDoubleLinePortion&)rMulti).FormatBrackets( rInf, nMaxWidth );
rInf.SetIdx( nOldIdx );
}
@@ -1771,59 +1770,59 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
else
pFontSave = NULL;
- SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() );
- if ( rMulti.IsBidi() )
- {
- // set layout mode
- aLayoutModeModifier.Modify( ! rInf.GetTxtFrm()->IsRightToLeft() );
- }
-
- SwTwips nTmpX = 0;
-
- if( rMulti.HasRotation() )
- {
- // For nMaxWidth we take the height of the body frame.
- // #i25067#: If the current frame is inside a table, we restrict
- // nMaxWidth to the current frame height, unless the frame size
- // attribute is set to variable size:
-
- // We set nTmpX (which is used for portion calculating) to the
- // current Y value
- const SwPageFrm* pPage = pFrm->FindPageFrm();
- ASSERT( pPage, "No page in frame!");
- const SwLayoutFrm* pUpperFrm = pPage;
-
- if ( pFrm->IsInTab() )
- {
- pUpperFrm = pFrm->GetUpper();
- while ( pUpperFrm && !pUpperFrm->IsCellFrm() )
- pUpperFrm = pUpperFrm->GetUpper();
- ASSERT( pUpperFrm, "pFrm is in table but does not have an upper cell frame" )
- const SwTableLine* pLine = ((SwRowFrm*)pUpperFrm->GetUpper())->GetTabLine();
- const SwFmtFrmSize& rFrmFmtSize = pLine->GetFrmFmt()->GetFrmSize();
- if ( ATT_VAR_SIZE == rFrmFmtSize.GetHeightSizeType() )
- pUpperFrm = pPage;
- }
- if ( pUpperFrm == pPage && !pFrm->IsInFtn() )
- pUpperFrm = pPage->FindBodyCont();
-
- nMaxWidth = pUpperFrm ?
- ( rInf.GetTxtFrm()->IsVertical() ?
- pUpperFrm->Prt().Width() :
- pUpperFrm->Prt().Height() ) :
- USHRT_MAX;
- }
- else
- nTmpX = rInf.X();
-
- SwMultiPortion* pOldMulti = pMulti;
-
- pMulti = &rMulti;
+ SwLayoutModeModifier aLayoutModeModifier( *GetInfo().GetOut() );
+ if ( rMulti.IsBidi() )
+ {
+ // set layout mode
+ aLayoutModeModifier.Modify( ! rInf.GetTxtFrm()->IsRightToLeft() );
+ }
+
+ SwTwips nTmpX = 0;
+
+ if( rMulti.HasRotation() )
+ {
+ // For nMaxWidth we take the height of the body frame.
+ // #i25067#: If the current frame is inside a table, we restrict
+ // nMaxWidth to the current frame height, unless the frame size
+ // attribute is set to variable size:
+
+ // We set nTmpX (which is used for portion calculating) to the
+ // current Y value
+ const SwPageFrm* pPage = pFrm->FindPageFrm();
+ ASSERT( pPage, "No page in frame!");
+ const SwLayoutFrm* pUpperFrm = pPage;
+
+ if ( pFrm->IsInTab() )
+ {
+ pUpperFrm = pFrm->GetUpper();
+ while ( pUpperFrm && !pUpperFrm->IsCellFrm() )
+ pUpperFrm = pUpperFrm->GetUpper();
+ ASSERT( pUpperFrm, "pFrm is in table but does not have an upper cell frame" )
+ const SwTableLine* pLine = ((SwRowFrm*)pUpperFrm->GetUpper())->GetTabLine();
+ const SwFmtFrmSize& rFrmFmtSize = pLine->GetFrmFmt()->GetFrmSize();
+ if ( ATT_VAR_SIZE == rFrmFmtSize.GetHeightSizeType() )
+ pUpperFrm = pPage;
+ }
+ if ( pUpperFrm == pPage && !pFrm->IsInFtn() )
+ pUpperFrm = pPage->FindBodyCont();
+
+ nMaxWidth = pUpperFrm ?
+ ( rInf.GetTxtFrm()->IsVertical() ?
+ pUpperFrm->Prt().Width() :
+ pUpperFrm->Prt().Height() ) :
+ USHRT_MAX;
+ }
+ else
+ nTmpX = rInf.X();
+
+ SwMultiPortion* pOldMulti = pMulti;
+
+ pMulti = &rMulti;
SwLineLayout *pOldCurr = pCurr;
xub_StrLen nOldStart = GetStart();
SwTwips nMinWidth = nTmpX + 1;
- SwTwips nActWidth = nMaxWidth;
- const xub_StrLen nStartIdx = rInf.GetIdx();
+ SwTwips nActWidth = nMaxWidth;
+ const xub_StrLen nStartIdx = rInf.GetIdx();
xub_StrLen nMultiLen = rMulti.GetLen();
SwLinePortion *pFirstRest;
@@ -1851,34 +1850,34 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
nMultiLen = nMultiLen - rInf.GetIdx();
}
- // save some values
+ // save some values
const XubString* pOldTxt = &(rInf.GetTxt());
- const SwTwips nOldPaintOfst = rInf.GetPaintOfst();
+ const SwTwips nOldPaintOfst = rInf.GetPaintOfst();
XubString aMultiStr( rInf.GetTxt(), 0, nMultiLen + rInf.GetIdx() );
rInf.SetTxt( aMultiStr );
SwTxtFormatInfo aInf( rInf, rMulti.GetRoot(), nActWidth );
- // Do we allow break cuts? The FirstMulti-Flag is evaluated during
- // line break determination.
- sal_Bool bFirstMulti = rInf.GetIdx() != rInf.GetLineStart();
+ // Do we allow break cuts? The FirstMulti-Flag is evaluated during
+ // line break determination.
+ sal_Bool bFirstMulti = rInf.GetIdx() != rInf.GetLineStart();
SwLinePortion *pNextFirst = NULL;
SwLinePortion *pNextSecond = NULL;
sal_Bool bRet = sal_False;
- GETGRID( pFrm->FindPageFrm() )
- const sal_Bool bHasGrid = pGrid && GRID_LINES_CHARS == pGrid->GetGridType();
+ GETGRID( pFrm->FindPageFrm() )
+ const sal_Bool bHasGrid = pGrid && GRID_LINES_CHARS == pGrid->GetGridType();
- sal_uInt16 nGridWidth = 0;
- sal_uInt16 nRubyHeight = 0;
- sal_Bool bRubyTop = sal_False;
+ sal_uInt16 nGridWidth = 0;
+ sal_uInt16 nRubyHeight = 0;
+ sal_Bool bRubyTop = sal_False;
- if ( bHasGrid )
- {
- nGridWidth = pGrid->GetBaseHeight();
- nRubyHeight = pGrid->GetRubyHeight();
- bRubyTop = ! pGrid->GetRubyTextBelow();
- }
+ if ( bHasGrid )
+ {
+ nGridWidth = pGrid->GetBaseHeight();
+ nRubyHeight = pGrid->GetRubyHeight();
+ bRubyTop = ! pGrid->GetRubyTextBelow();
+ }
do
{
@@ -1889,13 +1888,13 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
aInf.X( nTmpX );
aInf.Width( KSHORT(nActWidth) );
aInf.RealWidth( KSHORT(nActWidth) );
- aInf.SetFirstMulti( bFirstMulti );
- aInf.SetNumDone( rInf.IsNumDone() );
- aInf.SetFtnDone( rInf.IsFtnDone() );
+ aInf.SetFirstMulti( bFirstMulti );
+ aInf.SetNumDone( rInf.IsNumDone() );
+ aInf.SetFtnDone( rInf.IsFtnDone() );
- if( pFirstRest )
+ if( pFirstRest )
{
- ASSERT( pFirstRest->InFldGrp(), "BuildMulti: Fieldrest expected");
+ ASSERT( pFirstRest->InFldGrp(), "BuildMulti: Fieldrest expected");
SwFldPortion *pFld =
((SwFldPortion*)pFirstRest)->Clone(
((SwFldPortion*)pFirstRest)->GetExp() );
@@ -1904,35 +1903,35 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
}
aInf.SetRuby( rMulti.IsRuby() && rMulti.OnTop() );
- // in grid mode we temporarily have to disable the grid for the ruby line
- const sal_Bool bOldGridModeAllowed = GetInfo().SnapToGrid();
- if ( bHasGrid && aInf.IsRuby() && bRubyTop )
- aInf.SetSnapToGrid( sal_False );
+ // in grid mode we temporarily have to disable the grid for the ruby line
+ const sal_Bool bOldGridModeAllowed = GetInfo().SnapToGrid();
+ if ( bHasGrid && aInf.IsRuby() && bRubyTop )
+ aInf.SetSnapToGrid( sal_False );
- // If there's no more rubytext, then buildportion is forbidden
+ // If there's no more rubytext, then buildportion is forbidden
if( pFirstRest || !aInf.IsRuby() )
BuildPortions( aInf );
- aInf.SetSnapToGrid( bOldGridModeAllowed );
+ aInf.SetSnapToGrid( bOldGridModeAllowed );
rMulti.CalcSize( *this, aInf );
- pCurr->SetRealHeight( pCurr->Height() );
+ pCurr->SetRealHeight( pCurr->Height() );
- if( rMulti.IsBidi() )
- {
- pNextFirst = aInf.GetRest();
- break;
- }
+ if( rMulti.IsBidi() )
+ {
+ pNextFirst = aInf.GetRest();
+ break;
+ }
if( rMulti.HasRotation() && !rMulti.IsDouble() )
break;
- // second line has to be formatted
- else if( pCurr->GetLen()<nMultiLen || rMulti.IsRuby() || aInf.GetRest())
+ // second line has to be formatted
+ else if( pCurr->GetLen()<nMultiLen || rMulti.IsRuby() || aInf.GetRest())
{
xub_StrLen nFirstLen = pCurr->GetLen();
delete pCurr->GetNext();
pCurr->SetNext( new SwLineLayout() );
- pCurr = pCurr->GetNext();
+ pCurr = pCurr->GetNext();
nStart = aInf.GetIdx();
aInf.X( nTmpX );
SwTxtFormatInfo aTmp( aInf, *pCurr, nActWidth );
@@ -1942,7 +1941,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
pNextFirst = aInf.GetRest();
if( pSecondRest )
{
- ASSERT( pSecondRest->InFldGrp(), "Fieldrest expected");
+ ASSERT( pSecondRest->InFldGrp(), "Fieldrest expected");
SwFldPortion *pFld = ((SwFldPortion*)pSecondRest)->Clone(
((SwFldPortion*)pSecondRest)->GetExp() );
pFld->SetFollow( sal_True );
@@ -1955,16 +1954,16 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
aTmp.SetRest( aInf.GetRest() );
aInf.SetRest( NULL );
- // in grid mode we temporarily have to disable the grid for the ruby line
- if ( bHasGrid && aTmp.IsRuby() && ! bRubyTop )
- aTmp.SetSnapToGrid( sal_False );
+ // in grid mode we temporarily have to disable the grid for the ruby line
+ if ( bHasGrid && aTmp.IsRuby() && ! bRubyTop )
+ aTmp.SetSnapToGrid( sal_False );
- BuildPortions( aTmp );
+ BuildPortions( aTmp );
- aTmp.SetSnapToGrid( bOldGridModeAllowed );
+ aTmp.SetSnapToGrid( bOldGridModeAllowed );
- rMulti.CalcSize( *this, aInf );
- rMulti.GetRoot().SetRealHeight( rMulti.GetRoot().Height() );
+ rMulti.CalcSize( *this, aInf );
+ rMulti.GetRoot().SetRealHeight( rMulti.GetRoot().Height() );
pCurr->SetRealHeight( pCurr->Height() );
if( rMulti.IsRuby() )
{
@@ -1976,49 +1975,49 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
pNextFirst = aTmp.GetRest();
if( ( !aTmp.IsRuby() && nFirstLen + pCurr->GetLen() < nMultiLen )
|| aTmp.GetRest() )
- // our guess for width of multiportion was too small,
- // text did not fit into multiportion
+ // our guess for width of multiportion was too small,
+ // text did not fit into multiportion
bRet = sal_True;
}
- if( rMulti.IsRuby() )
- break;
+ if( rMulti.IsRuby() )
+ break;
if( bRet )
{
- // our guess for multiportion width was too small,
- // we set min to act
+ // our guess for multiportion width was too small,
+ // we set min to act
nMinWidth = nActWidth;
nActWidth = ( 3 * nMaxWidth + nMinWidth + 3 ) / 4;
- if ( nActWidth == nMaxWidth && rInf.GetLineStart() == rInf.GetIdx() )
- // we have too less space, we must allow break cuts
- // ( the first multi flag is considered during TxtPortion::_Format() )
- bFirstMulti = sal_False;
- if( nActWidth <= nMinWidth )
+ if ( nActWidth == nMaxWidth && rInf.GetLineStart() == rInf.GetIdx() )
+ // we have too less space, we must allow break cuts
+ // ( the first multi flag is considered during TxtPortion::_Format() )
+ bFirstMulti = sal_False;
+ if( nActWidth <= nMinWidth )
break;
}
else
- {
- // For Solaris, this optimisation can causes trouble:
- // Setting this to the portion width ( = rMulti.Width() )
- // can make GetTextBreak inside SwTxtGuess::Guess return to small
- // values. Therefore we add some extra twips.
- if( nActWidth > nTmpX + rMulti.Width() + 6 )
- nActWidth = nTmpX + rMulti.Width() + 6;
- nMaxWidth = nActWidth;
+ {
+ // For Solaris, this optimization can causes trouble:
+ // Setting this to the portion width ( = rMulti.Width() )
+ // can make GetTextBreak inside SwTxtGuess::Guess return to small
+ // values. Therefore we add some extra twips.
+ if( nActWidth > nTmpX + rMulti.Width() + 6 )
+ nActWidth = nTmpX + rMulti.Width() + 6;
+ nMaxWidth = nActWidth;
nActWidth = ( 3 * nMaxWidth + nMinWidth + 3 ) / 4;
if( nActWidth >= nMaxWidth )
break;
- // we do not allow break cuts during formatting
- bFirstMulti = sal_True;
+ // we do not allow break cuts during formatting
+ bFirstMulti = sal_True;
}
delete pNextFirst;
pNextFirst = NULL;
} while ( sal_True );
- pMulti = pOldMulti;
+ pMulti = pOldMulti;
pCurr = pOldCurr;
nStart = nOldStart;
- SetPropFont( 0 );
+ SetPropFont( 0 );
rMulti.SetLen( rMulti.GetRoot().GetLen() + ( rMulti.GetRoot().GetNext() ?
rMulti.GetRoot().GetNext()->GetLen() : 0 ) );
@@ -2043,11 +2042,11 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
rInf.SetIdx( nStartIdx );
}
if( ((SwDoubleLinePortion&)rMulti).GetBrackets() )
- {
- rMulti.Width( rMulti.Width() +
- ((SwDoubleLinePortion&)rMulti).BracketWidth() );
- GetInfo().X( nOldX );
- }
+ {
+ rMulti.Width( rMulti.Width() +
+ ((SwDoubleLinePortion&)rMulti).BracketWidth() );
+ GetInfo().X( nOldX );
+ }
}
else
{
@@ -2069,111 +2068,111 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
rMulti.Width( rMulti.Height() );
rMulti.Height( KSHORT(nH) );
rMulti.SetAscent( KSHORT(nAsc) );
- bRet = ( rInf.GetPos().X() + rMulti.Width() > rInf.Width() ) &&
- nStartIdx != rInf.GetLineStart();
+ bRet = ( rInf.GetPos().X() + rMulti.Width() > rInf.Width() ) &&
+ nStartIdx != rInf.GetLineStart();
+ }
+ else if ( rMulti.IsBidi() )
+ {
+ bRet = rMulti.GetLen() < nMultiLen || pNextFirst;
}
- else if ( rMulti.IsBidi() )
- {
- bRet = rMulti.GetLen() < nMultiLen || pNextFirst;
- }
// line break has to be performed!
- if( bRet )
- {
- ASSERT( !pNextFirst || pNextFirst->InFldGrp(),
- "BuildMultiPortion: Surprising restportion, field expected" );
- SwMultiPortion *pTmp;
- if( rMulti.IsDouble() )
- pTmp = new SwDoubleLinePortion( ((SwDoubleLinePortion&)rMulti),
- nMultiLen + rInf.GetIdx() );
- else if( rMulti.IsRuby() )
- {
- ASSERT( !pNextSecond || pNextSecond->InFldGrp(),
- "BuildMultiPortion: Surprising restportion, field expected" );
-
- if ( rInf.GetIdx() == rInf.GetLineStart() )
- {
- // the ruby portion has to be split in two portions
- pTmp = new SwRubyPortion( ((SwRubyPortion&)rMulti),
- nMultiLen + rInf.GetIdx() );
-
- if( pNextSecond )
- {
- pTmp->GetRoot().SetNext( new SwLineLayout() );
- pTmp->GetRoot().GetNext()->SetPortion( pNextSecond );
- }
- pTmp->SetFollowFld();
- }
- else
- {
- // we try to keep our ruby portion together
- lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx );
- pTmp = 0;
- }
- }
- else if( rMulti.HasRotation() )
- {
- // we try to keep our rotated portion together
- lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx );
- pTmp = new SwRotatedPortion( nMultiLen + rInf.GetIdx(),
- rMulti.GetDirection() );
- }
- // during a recursion of BuildMultiPortions we may not build
- // a new SwBidiPortion, this would cause a memory leak
- else if( rMulti.IsBidi() && ! pMulti )
- {
- if ( ! rMulti.GetLen() )
- lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx );
-
- // If there is a HolePortion at the end of the bidi portion,
- // it has to be moved behind the bidi portion. Otherwise
- // the visual cursor travelling gets into trouble.
- SwLineLayout& aRoot = rMulti.GetRoot();
- SwLinePortion* pPor = aRoot.GetFirstPortion();
- while ( pPor )
- {
- if ( pPor->GetPortion() && pPor->GetPortion()->IsHolePortion() )
- {
- SwLinePortion* pHolePor = pPor->GetPortion();
- pPor->SetPortion( NULL );
- aRoot.SetLen( aRoot.GetLen() - pHolePor->GetLen() );
- rMulti.SetLen( rMulti.GetLen() - pHolePor->GetLen() );
- rMulti.SetPortion( pHolePor );
- break;
- }
- pPor = pPor->GetPortion();
- }
-
- pTmp = new SwBidiPortion( nMultiLen + rInf.GetIdx(),
- ((SwBidiPortion&)rMulti).GetLevel() );
+ if( bRet )
+ {
+ ASSERT( !pNextFirst || pNextFirst->InFldGrp(),
+ "BuildMultiPortion: Surprising restportion, field expected" );
+ SwMultiPortion *pTmp;
+ if( rMulti.IsDouble() )
+ pTmp = new SwDoubleLinePortion( ((SwDoubleLinePortion&)rMulti),
+ nMultiLen + rInf.GetIdx() );
+ else if( rMulti.IsRuby() )
+ {
+ ASSERT( !pNextSecond || pNextSecond->InFldGrp(),
+ "BuildMultiPortion: Surprising restportion, field expected" );
+
+ if ( rInf.GetIdx() == rInf.GetLineStart() )
+ {
+ // the ruby portion has to be split in two portions
+ pTmp = new SwRubyPortion( ((SwRubyPortion&)rMulti),
+ nMultiLen + rInf.GetIdx() );
+
+ if( pNextSecond )
+ {
+ pTmp->GetRoot().SetNext( new SwLineLayout() );
+ pTmp->GetRoot().GetNext()->SetPortion( pNextSecond );
+ }
+ pTmp->SetFollowFld();
+ }
+ else
+ {
+ // we try to keep our ruby portion together
+ lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx );
+ pTmp = 0;
+ }
}
- else
- pTmp = NULL;
-
- if ( ! rMulti.GetLen() && rInf.GetLast() )
- {
- SeekAndChgBefore( rInf );
- rInf.GetLast()->FormatEOL( rInf );
- }
-
- if( pNextFirst && pTmp )
- {
- pTmp->SetFollowFld();
- pTmp->GetRoot().SetPortion( pNextFirst );
- }
- else
- // A follow field portion is still waiting. If nobody wants it,
- // we delete it.
- delete pNextFirst;
-
- rInf.SetRest( pTmp );
- }
+ else if( rMulti.HasRotation() )
+ {
+ // we try to keep our rotated portion together
+ lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx );
+ pTmp = new SwRotatedPortion( nMultiLen + rInf.GetIdx(),
+ rMulti.GetDirection() );
+ }
+ // during a recursion of BuildMultiPortions we may not build
+ // a new SwBidiPortion, this would cause a memory leak
+ else if( rMulti.IsBidi() && ! pMulti )
+ {
+ if ( ! rMulti.GetLen() )
+ lcl_TruncateMultiPortion( rMulti, rInf, nStartIdx );
+
+ // If there is a HolePortion at the end of the bidi portion,
+ // it has to be moved behind the bidi portion. Otherwise
+ // the visual cursor traveling gets into trouble.
+ SwLineLayout& aRoot = rMulti.GetRoot();
+ SwLinePortion* pPor = aRoot.GetFirstPortion();
+ while ( pPor )
+ {
+ if ( pPor->GetPortion() && pPor->GetPortion()->IsHolePortion() )
+ {
+ SwLinePortion* pHolePor = pPor->GetPortion();
+ pPor->SetPortion( NULL );
+ aRoot.SetLen( aRoot.GetLen() - pHolePor->GetLen() );
+ rMulti.SetLen( rMulti.GetLen() - pHolePor->GetLen() );
+ rMulti.SetPortion( pHolePor );
+ break;
+ }
+ pPor = pPor->GetPortion();
+ }
+
+ pTmp = new SwBidiPortion( nMultiLen + rInf.GetIdx(),
+ ((SwBidiPortion&)rMulti).GetLevel() );
+ }
+ else
+ pTmp = NULL;
+
+ if ( ! rMulti.GetLen() && rInf.GetLast() )
+ {
+ SeekAndChgBefore( rInf );
+ rInf.GetLast()->FormatEOL( rInf );
+ }
+
+ if( pNextFirst && pTmp )
+ {
+ pTmp->SetFollowFld();
+ pTmp->GetRoot().SetPortion( pNextFirst );
+ }
+ else
+ // A follow field portion is still waiting. If nobody wants it,
+ // we delete it.
+ delete pNextFirst;
+
+ rInf.SetRest( pTmp );
+ }
rInf.SetTxt( *pOldTxt );
- rInf.SetPaintOfst( nOldPaintOfst );
- rInf.SetStop( aInf.IsStop() );
- rInf.SetNumDone( sal_True );
- rInf.SetFtnDone( sal_True );
+ rInf.SetPaintOfst( nOldPaintOfst );
+ rInf.SetStop( aInf.IsStop() );
+ rInf.SetNumDone( sal_True );
+ rInf.SetFtnDone( sal_True );
SeekAndChg( rInf );
delete pFirstRest;
delete pSecondRest;
@@ -2188,7 +2187,7 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
* has to be set. Normally this happens during the formatting of the first
* part of the fieldportion.
* But sometimes the formatting starts at the line with the following part,
- * exspecally when the following part is on the next page.
+ * especially when the following part is on the next page.
* In this case the MakeRestPortion-function has to create the following part.
* The first parameter is the line that contains possibly a first part
* of a field. When the function finds such field part, it creates the right
@@ -2198,20 +2197,20 @@ sal_Bool SwTxtFormatter::BuildMultiPortion( SwTxtFormatInfo &rInf,
* --------------------------------------------------*/
SwLinePortion* SwTxtFormatter::MakeRestPortion( const SwLineLayout* pLine,
- xub_StrLen nPosition )
+ xub_StrLen nPosition )
{
- if( !nPosition )
+ if( !nPosition )
return NULL;
- xub_StrLen nMultiPos = nPosition - pLine->GetLen();
+ xub_StrLen nMultiPos = nPosition - pLine->GetLen();
const SwMultiPortion *pTmpMulti = NULL;
- const SwMultiPortion *pHelpMulti = NULL;
+ const SwMultiPortion *pHelpMulti = NULL;
const SwLinePortion* pPor = pLine->GetFirstPortion();
SwFldPortion *pFld = NULL;
while( pPor )
{
if( pPor->GetLen() )
{
- if( !pHelpMulti )
+ if( !pHelpMulti )
{
nMultiPos = nMultiPos + pPor->GetLen();
pTmpMulti = NULL;
@@ -2219,14 +2218,14 @@ SwLinePortion* SwTxtFormatter::MakeRestPortion( const SwLineLayout* pLine,
}
if( pPor->InFldGrp() )
{
- if( !pHelpMulti )
+ if( !pHelpMulti )
pTmpMulti = NULL;
pFld = (SwFldPortion*)pPor;
}
else if( pPor->IsMultiPortion() )
{
- ASSERT( !pHelpMulti || pHelpMulti->IsBidi(),
- "Nested multiportions are forbidden." );
+ ASSERT( !pHelpMulti || pHelpMulti->IsBidi(),
+ "Nested multiportions are forbidden." );
pFld = NULL;
pTmpMulti = (SwMultiPortion*)pPor;
@@ -2238,91 +2237,91 @@ SwLinePortion* SwTxtFormatter::MakeRestPortion( const SwLineLayout* pLine,
// next line
if( !pPor && pTmpMulti )
{
- if( pHelpMulti )
+ if( pHelpMulti )
{ // We're already inside the multiportion, let's take the second
// line, if we are in a double line portion
- if( !pHelpMulti->IsRuby() )
- pPor = pHelpMulti->GetRoot().GetNext();
+ if( !pHelpMulti->IsRuby() )
+ pPor = pHelpMulti->GetRoot().GetNext();
pTmpMulti = NULL;
}
else
{ // Now we enter a multiportion, in a ruby portion we take the
// main line, not the phonetic line, in a doublelineportion we
// starts with the first line.
- pHelpMulti = pTmpMulti;
- nMultiPos = nMultiPos - pHelpMulti->GetLen();
- if( pHelpMulti->IsRuby() && pHelpMulti->OnTop() )
- pPor = pHelpMulti->GetRoot().GetNext();
+ pHelpMulti = pTmpMulti;
+ nMultiPos = nMultiPos - pHelpMulti->GetLen();
+ if( pHelpMulti->IsRuby() && pHelpMulti->OnTop() )
+ pPor = pHelpMulti->GetRoot().GetNext();
else
- pPor = pHelpMulti->GetRoot().GetFirstPortion();
+ pPor = pHelpMulti->GetRoot().GetFirstPortion();
}
}
}
if( pFld && !pFld->HasFollow() )
pFld = NULL;
- SwLinePortion *pRest = NULL;
- if( pFld )
- {
- const SwTxtAttr *pHint = GetAttr( nPosition - 1 );
- if ( pHint
- && ( pHint->Which() == RES_TXTATR_FIELD
- || pHint->Which() == RES_TXTATR_ANNOTATION ) )
- {
- pRest = NewFldPortion( GetInfo(), pHint );
- if( pRest->InFldGrp() )
- ((SwFldPortion*)pRest)->TakeNextOffset( pFld );
- else
- {
- delete pRest;
- pRest = NULL;
- }
- }
- }
- if( !pHelpMulti )
- return pRest;
-
- nPosition = nMultiPos + pHelpMulti->GetLen();
- SwMultiCreator* pCreate = GetInfo().GetMultiCreator( nMultiPos, 0 );
-
- if ( !pCreate )
- {
- ASSERT( !pHelpMulti->GetLen(), "Multiportion without attribut?" );
- if ( nMultiPos )
- --nMultiPos;
- pCreate = GetInfo().GetMultiCreator( --nMultiPos, 0 );
- }
-
- if( pRest || nMultiPos > nPosition || ( pHelpMulti->IsRuby() &&
- ((SwRubyPortion*)pHelpMulti)->GetRubyOffset() < STRING_LEN ) )
+ SwLinePortion *pRest = NULL;
+ if( pFld )
+ {
+ const SwTxtAttr *pHint = GetAttr( nPosition - 1 );
+ if ( pHint
+ && ( pHint->Which() == RES_TXTATR_FIELD
+ || pHint->Which() == RES_TXTATR_ANNOTATION ) )
+ {
+ pRest = NewFldPortion( GetInfo(), pHint );
+ if( pRest->InFldGrp() )
+ ((SwFldPortion*)pRest)->TakeNextOffset( pFld );
+ else
+ {
+ delete pRest;
+ pRest = NULL;
+ }
+ }
+ }
+ if( !pHelpMulti )
+ return pRest;
+
+ nPosition = nMultiPos + pHelpMulti->GetLen();
+ SwMultiCreator* pCreate = GetInfo().GetMultiCreator( nMultiPos, 0 );
+
+ if ( !pCreate )
+ {
+ ASSERT( !pHelpMulti->GetLen(), "Multiportion without attribut?" );
+ if ( nMultiPos )
+ --nMultiPos;
+ pCreate = GetInfo().GetMultiCreator( --nMultiPos, 0 );
+ }
+
+ if( pRest || nMultiPos > nPosition || ( pHelpMulti->IsRuby() &&
+ ((SwRubyPortion*)pHelpMulti)->GetRubyOffset() < STRING_LEN ) )
{
SwMultiPortion* pTmp;
- if( pHelpMulti->IsDouble() )
+ if( pHelpMulti->IsDouble() )
pTmp = new SwDoubleLinePortion( *pCreate, nMultiPos );
- else if( pHelpMulti->IsBidi() )
- pTmp = new SwBidiPortion( nMultiPos, pCreate->nLevel );
- else if( pHelpMulti->IsRuby() )
- {
- sal_Bool bRubyTop;
- sal_Bool* pRubyPos = 0;
-
- if ( GetInfo().SnapToGrid() )
- {
- GETGRID( pFrm->FindPageFrm() )
- if ( pGrid )
- {
- bRubyTop = ! pGrid->GetRubyTextBelow();
- pRubyPos = &bRubyTop;
- }
- }
-
- pTmp = new SwRubyPortion( *pCreate, *GetInfo().GetFont(),
- *pFrm->GetTxtNode()->getIDocumentSettingAccess(),
- nMultiPos, ((SwRubyPortion*)pHelpMulti)->GetRubyOffset(),
- pRubyPos );
- }
- else if( pHelpMulti->HasRotation() )
- pTmp = new SwRotatedPortion( nMultiPos, pHelpMulti->GetDirection() );
+ else if( pHelpMulti->IsBidi() )
+ pTmp = new SwBidiPortion( nMultiPos, pCreate->nLevel );
+ else if( pHelpMulti->IsRuby() )
+ {
+ sal_Bool bRubyTop;
+ sal_Bool* pRubyPos = 0;
+
+ if ( GetInfo().SnapToGrid() )
+ {
+ GETGRID( pFrm->FindPageFrm() )
+ if ( pGrid )
+ {
+ bRubyTop = ! pGrid->GetRubyTextBelow();
+ pRubyPos = &bRubyTop;
+ }
+ }
+
+ pTmp = new SwRubyPortion( *pCreate, *GetInfo().GetFont(),
+ *pFrm->GetTxtNode()->getIDocumentSettingAccess(),
+ nMultiPos, ((SwRubyPortion*)pHelpMulti)->GetRubyOffset(),
+ pRubyPos );
+ }
+ else if( pHelpMulti->HasRotation() )
+ pTmp = new SwRotatedPortion( nMultiPos, pHelpMulti->GetDirection() );
else
{
delete pCreate;
@@ -2354,50 +2353,50 @@ SwLinePortion* SwTxtFormatter::MakeRestPortion( const SwLineLayout* pLine,
* --------------------------------------------------*/
SwTxtCursorSave::SwTxtCursorSave( SwTxtCursor* pTxtCursor,
- SwMultiPortion* pMulti,
- SwTwips nY,
- sal_uInt16& nX,
- xub_StrLen nCurrStart,
- long nSpaceAdd )
+ SwMultiPortion* pMulti,
+ SwTwips nY,
+ sal_uInt16& nX,
+ xub_StrLen nCurrStart,
+ long nSpaceAdd )
{
pTxtCrsr = pTxtCursor;
nStart = pTxtCursor->nStart;
pTxtCursor->nStart = nCurrStart;
pCurr = pTxtCursor->pCurr;
pTxtCursor->pCurr = &pMulti->GetRoot();
- while( pTxtCursor->Y() + pTxtCursor->GetLineHeight() < nY &&
+ while( pTxtCursor->Y() + pTxtCursor->GetLineHeight() < nY &&
pTxtCursor->Next() )
; // nothing
nWidth = pTxtCursor->pCurr->Width();
nOldProp = pTxtCursor->GetPropFont();
- if ( pMulti->IsDouble() || pMulti->IsBidi() )
- {
+ if ( pMulti->IsDouble() || pMulti->IsBidi() )
+ {
bSpaceChg = pMulti->ChgSpaceAdd( pTxtCursor->pCurr, nSpaceAdd );
- sal_uInt16 nSpaceCnt;
- if ( pMulti->IsDouble() )
- {
- pTxtCursor->SetPropFont( 50 );
- nSpaceCnt = ((SwDoubleLinePortion*)pMulti)->GetSpaceCnt();
- }
- else
- {
- const xub_StrLen nOldIdx = pTxtCursor->GetInfo().GetIdx();
- pTxtCursor->GetInfo().SetIdx ( nCurrStart );
- nSpaceCnt = ((SwBidiPortion*)pMulti)->GetSpaceCnt(pTxtCursor->GetInfo());
- pTxtCursor->GetInfo().SetIdx ( nOldIdx );
- }
+ sal_uInt16 nSpaceCnt;
+ if ( pMulti->IsDouble() )
+ {
+ pTxtCursor->SetPropFont( 50 );
+ nSpaceCnt = ((SwDoubleLinePortion*)pMulti)->GetSpaceCnt();
+ }
+ else
+ {
+ const xub_StrLen nOldIdx = pTxtCursor->GetInfo().GetIdx();
+ pTxtCursor->GetInfo().SetIdx ( nCurrStart );
+ nSpaceCnt = ((SwBidiPortion*)pMulti)->GetSpaceCnt(pTxtCursor->GetInfo());
+ pTxtCursor->GetInfo().SetIdx ( nOldIdx );
+ }
if( nSpaceAdd > 0 && !pMulti->HasTabulator() )
- pTxtCursor->pCurr->Width( static_cast<sal_uInt16>(nWidth + nSpaceAdd * nSpaceCnt / SPACING_PRECISION_FACTOR ) );
-
- // For a BidiPortion we have to calculate the offset from the
- // end of the portion
- if ( nX && pMulti->IsBidi() )
- nX = pTxtCursor->pCurr->Width() - nX;
- }
- else
+ pTxtCursor->pCurr->Width( static_cast<sal_uInt16>(nWidth + nSpaceAdd * nSpaceCnt / SPACING_PRECISION_FACTOR ) );
+
+ // For a BidiPortion we have to calculate the offset from the
+ // end of the portion
+ if ( nX && pMulti->IsBidi() )
+ nX = pTxtCursor->pCurr->Width() - nX;
+ }
+ else
bSpaceChg = sal_False;
}
@@ -2411,3 +2410,4 @@ SwTxtCursorSave::~SwTxtCursorSave()
pTxtCrsr->SetPropFont( nOldProp );
}
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/sw/source/ui/wrtsh/wrtsh1.cxx b/main/sw/source/ui/wrtsh/wrtsh1.cxx
index 64cb9df900..8649318cff 100644
--- a/main/sw/source/ui/wrtsh/wrtsh1.cxx
+++ b/main/sw/source/ui/wrtsh/wrtsh1.cxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -72,8 +72,8 @@
#include <pagedesc.hxx>
#include <frmmgr.hxx>
#include <shellio.hxx>
-#include <uinums.hxx> // fuer Anwenden einer
-#include <swundo.hxx> // fuer Undo-Ids
+#include <uinums.hxx> // fuer Anwenden einer
+#include <swundo.hxx> // fuer Undo-Ids
#include <swcli.hxx>
#include <poolfmt.hxx>
#include <wview.hxx>
@@ -112,15 +112,15 @@ using namespace com::sun::star;
#define COMMON_INI_LIST \
fnDrag(&SwWrtShell::BeginDrag),\
- fnSetCrsr(&SwWrtShell::SetCrsr),\
+ fnSetCrsr(&SwWrtShell::SetCrsr),\
fnEndDrag(&SwWrtShell::EndDrag),\
fnKillSel(&SwWrtShell::Ignore),\
- pModeStack(0), \
- ePageMove(MV_NO),\
- pCrsrStack(0), \
- rView(rShell),\
- bDestOnStack(sal_False), \
- fnLeaveSelect(&SwWrtShell::SttLeaveSelect)
+ pModeStack(0), \
+ ePageMove(MV_NO),\
+ pCrsrStack(0),\
+ rView(rShell),\
+ bDestOnStack(sal_False), \
+ fnLeaveSelect(&SwWrtShell::SttLeaveSelect)
#define BITFLD_INI_LIST \
bClearMark = \
@@ -140,10 +140,10 @@ using namespace com::sun::star;
SvxAutoCorrect* lcl_IsAutoCorr()
{
- SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
- if( pACorr && !pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
+ SvxAutoCorrect* pACorr = SvxAutoCorrCfg::Get()->GetAutoCorrect();
+ if( pACorr && !pACorr->IsAutoCorrFlag( CptlSttSntnc | CptlSttWrd |
AddNonBrkSpace | ChgOrdinalNumber |
- ChgToEnEmDash | SetINetAttr | Autocorrect ))
+ ChgToEnEmDash | SetINetAttr | Autocorrect ))
pACorr = 0;
return pACorr;
}
@@ -184,13 +184,13 @@ sal_Bool SwWrtShell::IsEndWrd()
bool SwWrtShell::_CanInsert()
{
- if(!CanInsert())
- {
- Sound::Beep();
- return false;
- }
+ if(!CanInsert())
+ {
+ Sound::Beep();
+ return false;
+ }
- return true;
+ return true;
}
/*------------------------------------------------------------------------
@@ -204,7 +204,7 @@ void SwWrtShell::InsertByWord( const String & rStr)
sal_Bool bDelim = GetAppCharClass().isLetterNumeric( rStr, 0 );
xub_StrLen nPos = 0, nStt = 0;
for( ; nPos < rStr.Len(); nPos++ )
- {
+ {
sal_Bool bTmpDelim = GetAppCharClass().isLetterNumeric( rStr, nPos );
if( bTmpDelim != bDelim )
{
@@ -226,34 +226,34 @@ void SwWrtShell::Insert( const String &rStr )
sal_Bool bStarted = sal_False, bHasSel = HasSelection(),
bCallIns = bIns /*|| bHasSel*/;
- bool bDeleted = false;
+ bool bDeleted = false;
- if( bHasSel || ( !bIns && SelectHiddenRange() ) )
+ if( bHasSel || ( !bIns && SelectHiddenRange() ) )
{
// nur hier klammern, da das normale Insert schon an der
// Editshell geklammert ist
StartAllAction();
- // #111827#
- SwRewriter aRewriter;
+ // #111827#
+ SwRewriter aRewriter;
- aRewriter.AddRule(UNDO_ARG1, GetCrsrDescr());
- aRewriter.AddRule(UNDO_ARG2, String(SW_RES(STR_YIELDS)));
- {
- String aTmpStr;
- aTmpStr += String(SW_RES(STR_START_QUOTE));
- aTmpStr += rStr;
- aTmpStr += String(SW_RES(STR_END_QUOTE));
+ aRewriter.AddRule(UNDO_ARG1, GetCrsrDescr());
+ aRewriter.AddRule(UNDO_ARG2, String(SW_RES(STR_YIELDS)));
+ {
+ String aTmpStr;
+ aTmpStr += String(SW_RES(STR_START_QUOTE));
+ aTmpStr += rStr;
+ aTmpStr += String(SW_RES(STR_END_QUOTE));
- aRewriter.AddRule(UNDO_ARG3, rStr);
- }
+ aRewriter.AddRule(UNDO_ARG3, rStr);
+ }
StartUndo(UNDO_REPLACE, &aRewriter);
bStarted = sal_True;
- bDeleted = DelRight() != 0;
+ bDeleted = DelRight() != 0;
}
- /*
+ /*
JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das
naechste Zeichen.
if( bHasSel && !bIns && 1 < rStr.Len() )
@@ -265,16 +265,16 @@ JP 21.01.98: Ueberschreiben ueberschreibt nur die Selektion, nicht das
}
else
*/
- bCallIns ?
- SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr );
+ bCallIns ?
+ SwEditShell::Insert2( rStr, bDeleted ) : SwEditShell::Overwrite( rStr );
if( bStarted )
{
EndAllAction();
- EndUndo();
+ EndUndo();
}
-// delete pChgFlg;
+// delete pChgFlg;
}
/* Begrenzung auf maximale Hoehe geht nicht, da die maximale Hoehe
@@ -292,8 +292,8 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
StartAllAction();
- SwRewriter aRewriter;
- aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_GRAPHIC));
+ SwRewriter aRewriter;
+ aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_GRAPHIC));
StartUndo(UNDO_INSERT, &aRewriter);
@@ -333,7 +333,7 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
else if ( aSz.Width() != DFLT_WIDTH && aSz.Height() != DFLT_HEIGHT )
bSetGrfSize = sal_False;
- pFrmMgr->SetHeightSizeType(ATT_FIX_SIZE);
+ pFrmMgr->SetHeightSizeType(ATT_FIX_SIZE);
}
@@ -373,7 +373,7 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
if ( bOwnMgr )
delete pFrmMgr;
- EndUndo();
+ EndUndo();
EndAllAction();
}
@@ -385,78 +385,78 @@ void SwWrtShell::Insert( const String &rPath, const String &rFilter,
void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName *pName,
- sal_Bool bActivate, sal_uInt16 nSlotId )
+ sal_Bool bActivate, sal_uInt16 nSlotId )
{
ResetCursorStack();
if( !_CanInsert() )
return;
- if( !xRef.is() )
+ if( !xRef.is() )
{
- // temporary storage
- svt::EmbeddedObjectRef xObj;
- uno::Reference < embed::XStorage > xStor = comphelper::OStorageHelper::GetTemporaryStorage();
+ // temporary storage
+ svt::EmbeddedObjectRef xObj;
+ uno::Reference < embed::XStorage > xStor = comphelper::OStorageHelper::GetTemporaryStorage();
sal_Bool bDoVerb = sal_True;
if ( pName )
{
- comphelper::EmbeddedObjectContainer aCnt( xStor );
- ::rtl::OUString aName;
- // TODO/LATER: get aspect?
- xObj.Assign( aCnt.CreateEmbeddedObject( pName->GetByteSequence(), aName ), embed::Aspects::MSOLE_CONTENT );
+ comphelper::EmbeddedObjectContainer aCnt( xStor );
+ ::rtl::OUString aName;
+ // TODO/LATER: get aspect?
+ xObj.Assign( aCnt.CreateEmbeddedObject( pName->GetByteSequence(), aName ), embed::Aspects::MSOLE_CONTENT );
}
else
{
- SvObjectServerList aServerList;
+ SvObjectServerList aServerList;
switch (nSlotId)
{
case SID_INSERT_OBJECT:
{
- aServerList.FillInsertObjects();
- aServerList.Remove( SwDocShell::Factory().GetClassId() );
- // Intentionally no break!
+ aServerList.FillInsertObjects();
+ aServerList.Remove( SwDocShell::Factory().GetClassId() );
+ // Intentionally no break!
}
- // TODO/LATER: recording! Convert properties to items
- case SID_INSERT_PLUGIN:
- case SID_INSERT_FLOATINGFRAME:
- {
- SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
- const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId);
- rtl::OString aCmd(".uno:");
- aCmd += pSlot->GetUnoName();
- SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- SfxAbstractInsertObjectDialog* pDlg =
- pFact->CreateInsertObjectDialog( GetWin(), rtl::OStringToOUString( aCmd, RTL_TEXTENCODING_UTF8 ), xStor, &aServerList );
- if ( pDlg )
- {
- pDlg->Execute();
- bDoVerb = pDlg->IsCreateNew();
+ // TODO/LATER: recording! Convert properties to items
+ case SID_INSERT_PLUGIN:
+ case SID_INSERT_FLOATINGFRAME:
+ {
+ SfxSlotPool* pSlotPool = SW_MOD()->GetSlotPool();
+ const SfxSlot* pSlot = pSlotPool->GetSlot(nSlotId);
+ rtl::OString aCmd(".uno:");
+ aCmd += pSlot->GetUnoName();
+ SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
+ SfxAbstractInsertObjectDialog* pDlg =
+ pFact->CreateInsertObjectDialog( GetWin(), rtl::OStringToOUString( aCmd, RTL_TEXTENCODING_UTF8 ), xStor, &aServerList );
+ if ( pDlg )
+ {
+ pDlg->Execute();
+ bDoVerb = pDlg->IsCreateNew();
::rtl::OUString aIconMediaType;
uno::Reference< io::XInputStream > xIconMetaFile = pDlg->GetIconIfIconified( &aIconMediaType );
- xObj.Assign( pDlg->GetObject(),
+ xObj.Assign( pDlg->GetObject(),
xIconMetaFile.is() ? embed::Aspects::MSOLE_ICON : embed::Aspects::MSOLE_CONTENT );
if ( xIconMetaFile.is() )
xObj.SetGraphicStream( xIconMetaFile, aIconMediaType );
- DELETEZ( pDlg );
- }
+ DELETEZ( pDlg );
+ }
- break;
- }
+ break;
+ }
default:
break;
}
}
- if ( xObj.is() )
+ if ( xObj.is() )
{
- if( InsertOleObject( xObj ) && bActivate && bDoVerb )
+ if( InsertOleObject( xObj ) && bActivate && bDoVerb )
{
- SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
- if ( !pClient )
+ SfxInPlaceClient* pClient = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
+ if ( !pClient )
{
- pClient = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
+ pClient = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
SetCheckForOLEInCaption( sal_True );
}
@@ -471,15 +471,15 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
RequestObjectResize( aArea, xObj.GetObject() );
}
else
- CalcAndSetScale( xObj );
+ CalcAndSetScale( xObj );
- //#50270# Error brauchen wir nicht handeln, das erledigt das
- //DoVerb in der SfxViewShell
- pClient->DoVerb( SVVERB_SHOW );
+ //#50270# Error brauchen wir nicht handeln, das erledigt das
+ //DoVerb in der SfxViewShell
+ pClient->DoVerb( SVVERB_SHOW );
- // TODO/LATER: set document name - should be done in Client
- //if ( !ERRCODE_TOERROR( nErr ) )
- // xIPObj->SetDocumentName( GetView().GetDocShell()->GetTitle() );
+ // TODO/LATER: set document name - should be done in Client
+ //if ( !ERRCODE_TOERROR( nErr ) )
+ // xIPObj->SetDocumentName( GetView().GetDocShell()->GetTitle() );
}
}
}
@@ -487,7 +487,7 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
{
if( HasSelection() )
DelRight();
- InsertOleObject( xRef );
+ InsertOleObject( xRef );
}
}
@@ -498,21 +498,21 @@ void SwWrtShell::InsertObject( const svt::EmbeddedObjectRef& xRef, SvGlobalName
sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyFrmFmt **pFlyFrmFmt )
{
- ResetCursorStack();
+ ResetCursorStack();
StartAllAction();
StartUndo(UNDO_INSERT);
- //Some differences between StarMath and any other objects:
- //1. Selections should be deleted. For StarMath the Text should be
+ //Some differences between Math and any other objects:
+ //1. Selections should be deleted. For Math the Text should be
// passed to the Object
//2. If the cursor is at the end of an non empty paragraph a paragraph
- // break should be insertet. StarMath objects are character bound and
+ // break should be inserted. Math objects are character bound and
// no break should be inserted.
- //3. If an selektion is passed to a StarMath object, this object should
+ //3. If an selection is passed to a Math object, this object should
// not be activated. sal_False should be returned then.
- sal_Bool bStarMath = sal_True;
- sal_Bool bActivate = sal_True;
+ sal_Bool bStarMath = sal_True;
+ sal_Bool bActivate = sal_True;
// set parent to get correct VisArea(in case of object needing parent printer)
uno::Reference < container::XChild > xChild( xRef.GetObject(), uno::UNO_QUERY );
@@ -536,7 +536,7 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
try
{
xSet->setPropertyValue( ::rtl::OUString::createFromAscii("Formula"), uno::makeAny( ::rtl::OUString( aMathData ) ) );
- bActivate = sal_False;
+ bActivate = sal_False;
}
catch ( uno::Exception& )
{
@@ -558,11 +558,11 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
SwRect aBound;
CalcBoundRect( aBound, aFrmMgr.GetAnchor() );
- //The Size should be suggested by the OLE server
+ // The Size should be suggested by the OLE server
MapMode aMapMode( MAP_TWIP );
Size aSz = xRef.GetSize( &aMapMode );
- //Object size can be limited
+ // Object size can be limited
if ( aSz.Width() > aBound.Width() )
{
//Immer proportional begrenzen.
@@ -570,21 +570,21 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
aSz.Width() = aBound.Width();
}
aFrmMgr.SetSize( aSz );
- SwFlyFrmFmt *pFmt = SwFEShell::InsertObject( xRef, &aFrmMgr.GetAttrSet() );
+ SwFlyFrmFmt *pFmt = SwFEShell::InsertObject( xRef, &aFrmMgr.GetAttrSet() );
- // --> #i972#
- if ( bStarMath && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) )
- AlignFormulaToBaseline( xRef.GetObject() );
- // <--
+ // --> #i972#
+ if ( bStarMath && pDoc->get( IDocumentSettingAccess::MATH_BASELINE_ALIGNMENT ) )
+ AlignFormulaToBaseline( xRef.GetObject() );
+ // <--
- if (pFlyFrmFmt)
- *pFlyFrmFmt = pFmt;
+ if (pFlyFrmFmt)
+ *pFlyFrmFmt = pFmt;
- if ( SotExchange::IsChart( aCLSID ) )
- {
- uno::Reference< embed::XEmbeddedObject > xEmbeddedObj( xRef.GetObject(), uno::UNO_QUERY );
- if ( xEmbeddedObj.is() )
- {
+ if ( SotExchange::IsChart( aCLSID ) )
+ {
+ uno::Reference< embed::XEmbeddedObject > xEmbeddedObj( xRef.GetObject(), uno::UNO_QUERY );
+ if ( xEmbeddedObj.is() )
+ {
bool bDisableDataTableDialog = false;
svt::EmbeddedObjectRef::TryRunningState( xEmbeddedObj );
uno::Reference< beans::XPropertySet > xProps( xEmbeddedObj->getComponent(), uno::UNO_QUERY );
@@ -602,13 +602,13 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
xModifiable->setModified( sal_True );
}
}
- }
- }
+ }
+ }
EndAllAction();
GetView().AutoCaption(OLE_CAP, &aCLSID);
- SwRewriter aRewriter;
+ SwRewriter aRewriter;
if ( bStarMath )
aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_MATH_FORMULA));
@@ -617,9 +617,9 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
else
aRewriter.AddRule(UNDO_ARG1, SW_RES(STR_OLE));
- EndUndo(UNDO_INSERT, &aRewriter);
+ EndUndo(UNDO_INSERT, &aRewriter);
- return bActivate;
+ return bActivate;
}
/*------------------------------------------------------------------------
@@ -632,46 +632,46 @@ sal_Bool SwWrtShell::InsertOleObject( const svt::EmbeddedObjectRef& xRef, SwFlyF
void SwWrtShell::LaunchOLEObj( long nVerb )
{
if ( GetCntType() == CNT_OLE &&
- !GetView().GetViewFrame()->GetFrame().IsInPlace() )
+ !GetView().GetViewFrame()->GetFrame().IsInPlace() )
{
- svt::EmbeddedObjectRef& xRef = GetOLEObject();
- ASSERT( xRef.is(), "OLE not found" );
- SfxInPlaceClient* pCli=0;
+ svt::EmbeddedObjectRef& xRef = GetOLEObject();
+ ASSERT( xRef.is(), "OLE not found" );
+ SfxInPlaceClient* pCli=0;
- pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
- if ( !pCli )
- pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );
+ pCli = GetView().FindIPClient( xRef.GetObject(), &GetView().GetEditWin() );
+ if ( !pCli )
+ pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xRef );
- ((SwOleClient*)pCli)->SetInDoVerb( sal_True );
+ ((SwOleClient*)pCli)->SetInDoVerb( sal_True );
- CalcAndSetScale( xRef );
- pCli->DoVerb( nVerb );
+ CalcAndSetScale( xRef );
+ pCli->DoVerb( nVerb );
- ((SwOleClient*)pCli)->SetInDoVerb( sal_False );
- CalcAndSetScale( xRef );
+ ((SwOleClient*)pCli)->SetInDoVerb( sal_False );
+ CalcAndSetScale( xRef );
}
}
void SwWrtShell::MoveObjectIfActive( svt::EmbeddedObjectRef& xObj, const Point& rOffset )
{
- try
- {
- sal_Int32 nState = xObj->getCurrentState();
- if ( nState == ::com::sun::star::embed::EmbedStates::INPLACE_ACTIVE
- || nState == ::com::sun::star::embed::EmbedStates::UI_ACTIVE )
- {
- SfxInPlaceClient* pCli =
+ try
+ {
+ sal_Int32 nState = xObj->getCurrentState();
+ if ( nState == ::com::sun::star::embed::EmbedStates::INPLACE_ACTIVE
+ || nState == ::com::sun::star::embed::EmbedStates::UI_ACTIVE )
+ {
+ SfxInPlaceClient* pCli =
GetView().FindIPClient( xObj.GetObject(), &(GetView().GetEditWin()) );
- if ( pCli )
- {
+ if ( pCli )
+ {
Rectangle aArea = pCli->GetObjArea();
aArea += rOffset;
pCli->SetObjArea( aArea );
- }
- }
- }
- catch( uno::Exception& )
- {}
+ }
+ }
+ }
+ catch( uno::Exception& )
+ {}
}
@@ -682,23 +682,23 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
{
//Einstellen der Skalierung am Client. Diese ergibt sich aus der Differenz
//zwischen der VisArea des Objektes und der ObjArea.
- ASSERT( xObj.is(), "ObjectRef not valid" );
+ ASSERT( xObj.is(), "ObjectRef not valid" );
- sal_Int64 nAspect = xObj.GetViewAspect();
- if ( nAspect == embed::Aspects::MSOLE_ICON )
- return; // the replacement image is completely controlled by container in this case
+ sal_Int64 nAspect = xObj.GetViewAspect();
+ if ( nAspect == embed::Aspects::MSOLE_ICON )
+ return; // the replacement image is completely controlled by container in this case
- sal_Int64 nMisc = 0;
- sal_Bool bLinkingChart = sal_False;
+ sal_Int64 nMisc = 0;
+ sal_Bool bLinkingChart = sal_False;
- try
- {
- nMisc = xObj->getStatus( nAspect );
+ try
+ {
+ nMisc = xObj->getStatus( nAspect );
- //Das kann ja wohl nur ein nicht aktives Objekt sein. Diese bekommen
- //auf Wunsch die neue Groesse als VisArea gesetzt (StarChart)
- if( embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE & nMisc )
- {
+ //Das kann ja wohl nur ein nicht aktives Objekt sein. Diese bekommen
+ //auf Wunsch die neue Groesse als VisArea gesetzt (Chart)
+ if( embed::EmbedMisc::MS_EMBED_RECOMPOSEONRESIZE & nMisc )
+ {
// TODO/MBA: testing
SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
: GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
@@ -750,21 +750,21 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
uno::Reference< chart2::XChartDocument > xChartDocument( xObj->getComponent(), uno::UNO_QUERY );
bLinkingChart = ( xChartDocument.is() && !xChartDocument->hasInternalDataProvider() );
}
- }
- catch ( uno::Exception& )
- {
+ }
+ catch ( uno::Exception& )
+ {
// TODO/LATER: handle the error
return;
- }
+ }
- SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
- if ( !pCli )
- {
- if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
+ SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin() );
+ if ( !pCli )
+ {
+ if ( (embed::EmbedMisc::EMBED_ACTIVATEIMMEDIATELY & nMisc)
|| bLinkingChart
// TODO/LATER: ResizeOnPrinterChange
//|| SVOBJ_MISCSTATUS_RESIZEONPRINTERCHANGE & xObj->GetMiscStatus()
- // --> OD #i117189# - refine condition for non-resizable objects
+ // --> OD #i117189# - refine condition for non-resizable objects
// non-resizable objects need to be set the size back by this method
|| ( bNoTxtFrmPrtAreaChanged && nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE ) )
{
@@ -772,10 +772,10 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
}
else
return;
- }
+ }
- // TODO/LEAN: getMapUnit can switch object to running state
- // xObj.TryRunningState();
+ // TODO/LEAN: getMapUnit can switch object to running state
+ // xObj.TryRunningState();
awt::Size aSize;
try
@@ -794,7 +794,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
return;
}
- Size _aVisArea( aSize.Width, aSize.Height );
+ Size _aVisArea( aSize.Width, aSize.Height );
Fraction aScaleWidth( 1, 1 );
Fraction aScaleHeight( 1, 1 );
@@ -803,21 +803,21 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
// solange keine vernuenftige Size vom Object kommt, kann nichts
// skaliert werden
- if( _aVisArea.Width() && _aVisArea.Height() )
+ if( _aVisArea.Width() && _aVisArea.Height() )
{
const MapMode aTmp( MAP_TWIP );
- MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
- _aVisArea = OutputDevice::LogicToLogic( _aVisArea, aUnit, aTmp);
+ MapUnit aUnit = VCLUnoHelper::UnoEmbed2VCLMapUnit( xObj->getMapUnit( nAspect ) );
+ _aVisArea = OutputDevice::LogicToLogic( _aVisArea, aUnit, aTmp);
Size aObjArea;
if ( pFlyPrtRect )
aObjArea = pFlyPrtRect->SSize();
else
aObjArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ).SSize();
- // differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea
+ // differ the aObjArea and _aVisArea by 1 Pixel then set new VisArea
long nX, nY;
SwSelPaintRects::Get1PixelInLogic( *this, &nX, &nY );
- if( !( _aVisArea.Width() - nX <= aObjArea.Width() &&
+ if( !( _aVisArea.Width() - nX <= aObjArea.Width() &&
_aVisArea.Width() + nX >= aObjArea.Width() &&
_aVisArea.Height()- nY <= aObjArea.Height()&&
_aVisArea.Height()+ nY >= aObjArea.Height() ))
@@ -838,14 +838,14 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
}
else
{
- SwRect aTmp( Point( LONG_MIN, LONG_MIN ), _aVisArea );
+ SwRect aTmp( Point( LONG_MIN, LONG_MIN ), _aVisArea );
RequestObjectResize( aTmp, xObj );
}
//Der Rest erledigt sich, weil wir eh wiederkommen sollten, evtl.
//sogar rekursiv.
return;
}
- else*/
+ else*/
if ( nMisc & embed::EmbedMisc::EMBED_NEVERRESIZE )
{
@@ -854,14 +854,14 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
}
else
{
- aScaleWidth = Fraction( aObjArea.Width(), _aVisArea.Width() );
- aScaleHeight = Fraction( aObjArea.Height(), _aVisArea.Height());
+ aScaleWidth = Fraction( aObjArea.Width(), _aVisArea.Width() );
+ aScaleHeight = Fraction( aObjArea.Height(), _aVisArea.Height());
}
}
}
//Jetzt ist auch der guenstige Zeitpunkt die ObjArea einzustellen.
- //Die Scalierung muss beruecksichtigt werden.
+ //Die Skalierung muss beruecksichtigt werden.
SwRect aArea;
if ( pFlyPrtRect )
{
@@ -870,25 +870,25 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
}
else
{
- aArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() );
- aArea.Pos() += GetAnyCurRect( RECT_FLY_EMBEDDED, 0, xObj.GetObject() ).Pos();
+ aArea = GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() );
+ aArea.Pos() += GetAnyCurRect( RECT_FLY_EMBEDDED, 0, xObj.GetObject() ).Pos();
}
if ( bUseObjectSize )
{
- // --> this moves non-resizable object so that when adding borders the baseline remains the same
- const SwFlyFrmFmt *pFlyFrmFmt = dynamic_cast< const SwFlyFrmFmt * >( GetFlyFrmFmt() );
- ASSERT( pFlyFrmFmt, "Could not find fly frame." );
- if ( pFlyFrmFmt )
- {
- const Point &rPoint = pFlyFrmFmt->GetLastFlyFrmPrtRectPos();
- SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
- : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
- aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
- }
- // <--
- aArea.Width ( _aVisArea.Width() );
- aArea.Height( _aVisArea.Height() );
+ // --> this moves non-resizable object so that when adding borders the baseline remains the same
+ const SwFlyFrmFmt *pFlyFrmFmt = dynamic_cast< const SwFlyFrmFmt * >( GetFlyFrmFmt() );
+ ASSERT( pFlyFrmFmt, "Could not find fly frame." );
+ if ( pFlyFrmFmt )
+ {
+ const Point &rPoint = pFlyFrmFmt->GetLastFlyFrmPrtRectPos();
+ SwRect aRect( pFlyPrtRect ? *pFlyPrtRect
+ : GetAnyCurRect( RECT_FLY_PRT_EMBEDDED, 0, xObj.GetObject() ));
+ aArea += rPoint - aRect.Pos(); // adjust area by diff of printing area position in order to keep baseline alignment correct.
+ }
+ // <--
+ aArea.Width ( _aVisArea.Width() );
+ aArea.Height( _aVisArea.Height() );
RequestObjectResize( aArea, xObj.GetObject() );
}
else
@@ -897,7 +897,7 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
aArea.Height( Fraction( aArea.Height() ) / pCli->GetScaleHeight());
}
- pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );
+ pCli->SetObjAreaAndScale( aArea.SVRect(), aScaleWidth, aScaleHeight );
}
@@ -905,10 +905,10 @@ void SwWrtShell::CalcAndSetScale( svt::EmbeddedObjectRef& xObj,
void SwWrtShell::ConnectObj( svt::EmbeddedObjectRef& xObj, const SwRect &rPrt,
const SwRect &rFrm )
{
- SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin());
- if ( !pCli )
- pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
- CalcAndSetScale( xObj, &rPrt, &rFrm );
+ SfxInPlaceClient* pCli = GetView().FindIPClient( xObj.GetObject(), &GetView().GetEditWin());
+ if ( !pCli )
+ pCli = new SwOleClient( &GetView(), &GetView().GetEditWin(), xObj );
+ CalcAndSetScale( xObj, &rPrt, &rFrm );
}
/*------------------------------------------------------------------------
@@ -924,7 +924,7 @@ void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum )
if( _CanInsert() )
{
ACT_KONTEXT(this);
- StartUndo(UNDO_UI_INSERT_PAGE_BREAK);
+ StartUndo(UNDO_UI_INSERT_PAGE_BREAK);
if ( !IsCrsrInTbl() )
{
@@ -942,8 +942,8 @@ void SwWrtShell::InsertPageBreak(const String *pPageDesc, sal_uInt16 nPgNum )
SetAttrItem( aDesc );
}
else
- SetAttrItem( SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK) );
- EndUndo(UNDO_UI_INSERT_PAGE_BREAK);
+ SetAttrItem( SvxFmtBreakItem(SVX_BREAK_PAGE_BEFORE, RES_BREAK) );
+ EndUndo(UNDO_UI_INSERT_PAGE_BREAK);
}
}
/*------------------------------------------------------------------------
@@ -962,7 +962,7 @@ void SwWrtShell::InsertLineBreak()
const sal_Unicode cIns = 0x0A;
SvxAutoCorrect* pACorr = lcl_IsAutoCorr();
- if( pACorr )
+ if( pACorr )
AutoCorrect( *pACorr, cIns );
else
SwWrtShell::Insert( String( cIns ) );
@@ -980,7 +980,7 @@ void SwWrtShell::InsertColumnBreak()
ResetCursorStack();
if( _CanInsert() )
{
- StartUndo(UNDO_UI_INSERT_COLUMN_BREAK);
+ StartUndo(UNDO_UI_INSERT_COLUMN_BREAK);
if ( !IsCrsrInTbl() )
{
@@ -988,9 +988,9 @@ void SwWrtShell::InsertColumnBreak()
DelRight();
SwFEShell::SplitNode( sal_False, sal_False );
}
- SetAttrItem(SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK));
+ SetAttrItem(SvxFmtBreakItem(SVX_BREAK_COLUMN_BEFORE, RES_BREAK));
- EndUndo(UNDO_UI_INSERT_COLUMN_BREAK);
+ EndUndo(UNDO_UI_INSERT_COLUMN_BREAK);
}
}
@@ -1006,12 +1006,12 @@ void SwWrtShell::InsertFootnote(const String &rStr, sal_Bool bEndNote, sal_Bool
if( _CanInsert() )
{
if(HasSelection())
- {
- //collapse cursor to the end
- if(!IsCrsrPtAtEnd())
- SwapPam();
- ClearMark();
- }
+ {
+ //collapse cursor to the end
+ if(!IsCrsrPtAtEnd())
+ SwapPam();
+ ClearMark();
+ }
SwFmtFtn aFootNote( bEndNote );
if(rStr.Len())
@@ -1041,7 +1041,7 @@ void SwWrtShell::SplitNode( sal_Bool bAutoFmt, sal_Bool bCheckTableStart )
{
ACT_KONTEXT(this);
- rView.GetEditWin().FlushInBuffer();
+ rView.GetEditWin().FlushInBuffer();
sal_Bool bHasSel = HasSelection();
if( bHasSel )
{
@@ -1075,60 +1075,60 @@ void SwWrtShell::SplitNode( sal_Bool bAutoFmt, sal_Bool bCheckTableStart )
// cursor position in the document.
void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
{
- // determine numbering rule found at current cursor position in the docment.
- const SwNumRule* pCurRule = GetNumRuleAtCurrCrsrPos();
-
- StartUndo(UNDO_NUMORNONUM);
-
- const SwNumRule * pNumRule = pCurRule;
-
- // --> OD 2005-10-25 #b6340308#
- // - activate outline rule respectively turning on outline rule for
- // current text node. But, only for turning on a numbering (<bNum> == sal_True).
- // - overwrite found numbering rule at current cursor position, if
- // no numbering rule can be retrieved from the paragraph style.
- bool bContinueFoundNumRule( false );
- bool bActivateOutlineRule( false );
- int nActivateOutlineLvl( MAXLEVEL ); // only relevant, if <bActivateOutlineRule> == sal_True
- SwTxtFmtColl * pColl = GetCurTxtFmtColl();
- if ( pColl )
- {
- // --> OD 2005-10-25 #b6340308# - retrieve numbering rule at paragraph
- // style, which is found at current cursor position in the document.
- SwNumRule* pCollRule = pDoc->FindNumRulePtr(pColl->GetNumRule().GetValue());
- // --> OD 2005-10-25 #125993# - The outline numbering rule isn't allowed
- // to be derived from a parent paragraph style to a derived one.
- // Thus check, if the found outline numbering rule is directly
- // set at the paragraph style <pColl>. If not, set <pCollRule> to NULL
- if ( pCollRule && pCollRule == GetDoc()->GetOutlineNumRule() )
- {
- const SwNumRule* pDirectCollRule =
- pDoc->FindNumRulePtr(pColl->GetNumRule( sal_False ).GetValue());
- if ( !pDirectCollRule )
- {
- pCollRule = 0;
- }
- }
- // --> OD 2006-11-20 #i71764#
- // Document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE has no influence
- // any more.
-// if ( pCollRule == NULL &&
-// NO_NUMBERING != pColl->GetOutlineLevel() &&
-// GetDoc()->get(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE) )
-// {
-// pCollRule = GetDoc()->GetOutlineNumRule();
-// }
- // <--
-
- // <--
- // --> OD 2005-10-25 #b6340308#
- if ( !pCollRule )
- {
- pNumRule = pCollRule;
- }
- // --> OD 2006-06-12 #b6435904#
- // no activation or continuation of outline numbering in Writer/Web document
- else if ( bNum &&
+ // determine numbering rule found at current cursor position in the document.
+ const SwNumRule* pCurRule = GetNumRuleAtCurrCrsrPos();
+
+ StartUndo(UNDO_NUMORNONUM);
+
+ const SwNumRule * pNumRule = pCurRule;
+
+ // --> OD 2005-10-25 #b6340308#
+ // - activate outline rule respectively turning on outline rule for
+ // current text node. But, only for turning on a numbering (<bNum> == sal_True).
+ // - overwrite found numbering rule at current cursor position, if
+ // no numbering rule can be retrieved from the paragraph style.
+ bool bContinueFoundNumRule( false );
+ bool bActivateOutlineRule( false );
+ int nActivateOutlineLvl( MAXLEVEL ); // only relevant, if <bActivateOutlineRule> == sal_True
+ SwTxtFmtColl * pColl = GetCurTxtFmtColl();
+ if ( pColl )
+ {
+ // --> OD 2005-10-25 #b6340308# - retrieve numbering rule at paragraph
+ // style, which is found at current cursor position in the document.
+ SwNumRule* pCollRule = pDoc->FindNumRulePtr(pColl->GetNumRule().GetValue());
+ // --> OD 2005-10-25 #125993# - The outline numbering rule isn't allowed
+ // to be derived from a parent paragraph style to a derived one.
+ // Thus check, if the found outline numbering rule is directly
+ // set at the paragraph style <pColl>. If not, set <pCollRule> to NULL
+ if ( pCollRule && pCollRule == GetDoc()->GetOutlineNumRule() )
+ {
+ const SwNumRule* pDirectCollRule =
+ pDoc->FindNumRulePtr(pColl->GetNumRule( sal_False ).GetValue());
+ if ( !pDirectCollRule )
+ {
+ pCollRule = 0;
+ }
+ }
+ // --> OD 2006-11-20 #i71764#
+ // Document setting OUTLINE_LEVEL_YIELDS_OUTLINE_RULE has no influence
+ // any more.
+// if ( pCollRule == NULL &&
+// NO_NUMBERING != pColl->GetOutlineLevel() &&
+// GetDoc()->get(IDocumentSettingAccess::OUTLINE_LEVEL_YIELDS_OUTLINE_RULE) )
+// {
+// pCollRule = GetDoc()->GetOutlineNumRule();
+// }
+ // <--
+
+ // <--
+ // --> OD 2005-10-25 #b6340308#
+ if ( !pCollRule )
+ {
+ pNumRule = pCollRule;
+ }
+ // --> OD 2006-06-12 #b6435904#
+ // no activation or continuation of outline numbering in Writer/Web document
+ else if ( bNum &&
!dynamic_cast<SwWebDocShell*>(GetDoc()->GetDocShell()) &&
pCollRule == GetDoc()->GetOutlineNumRule() )
// <--
@@ -1142,7 +1142,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
GetCrsr()->GetPoint()->nNode.GetNode().GetTxtNode();
if ( pTxtNode && !pTxtNode->IsCountedInList() )
{
- // check, if numbering of the outline level of the pararaph
+ // check, if numbering of the outline level of the paragraph
// style is active. If not, activate this outline level.
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();
ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(), //<-end,zhaojianwei
@@ -1191,7 +1191,7 @@ void SwWrtShell::NumOrBulletOn(sal_Bool bNum)
}
else
{
- // check, if numbering of the outline level of the pararaph
+ // check, if numbering of the outline level of the paragraph
// style is active. If not, activate this outline level.
nActivateOutlineLvl = pColl->GetAssignedOutlineStyleLevel();//#outline level,zhaojianwei
ASSERT( pColl->IsAssignedToListLevelOfOutlineStyle(),//#outline level,zhaojianwei
@@ -1688,7 +1688,7 @@ void SwWrtShell::AutoUpdatePara(SwTxtFmtColl* pColl, const SfxItemSet& rStyleSet
SID_ATTR_PARA_MODEL, SID_ATTR_PARA_KEEP,
SID_ATTR_PARA_PAGENUM, SID_ATTR_PARA_PAGENUM,
0 );
- GetCurAttr( aCoreSet );
+ GetCurAttr( aCoreSet );
sal_Bool bReset = sal_False;
SfxItemIter aParaIter( aCoreSet );
const SfxPoolItem* pParaItem = aParaIter.FirstItem();
@@ -1725,7 +1725,7 @@ void SwWrtShell::AutoUpdateFrame( SwFrmFmt* pFmt, const SfxItemSet& rStyleSet )
StartAction();
ResetFlyFrmAttr( 0, &rStyleSet );
- pFmt->SetFmtAttr( rStyleSet );
+ pFmt->SetFmtAttr( rStyleSet );
EndAction();
}
@@ -1762,7 +1762,7 @@ void SwWrtShell::AutoCorrect( SvxAutoCorrect& rACorr, sal_Unicode cChar )
*/
SwWrtShell::SwWrtShell( SwWrtShell& rSh, Window *_pWin, SwView &rShell )
- : SwFEShell( rSh, _pWin ),
+ : SwFEShell( rSh, _pWin ),
COMMON_INI_LIST
{
BITFLD_INI_LIST
@@ -1823,8 +1823,8 @@ sal_Bool SwWrtShell::Pop( sal_Bool bOldCrsr )
bool SwWrtShell::CanInsert()
{
// #123922# The original expression looks sleek, but it is not. Using the mathematical or ('|')
- // instead of the logical one ('||') forces the compiler to evaluate all conditions to allow or-ing
- // them together (yes, he could do better). Using the logical or allows to return on the first
+ // instead of the logical one ('||') forces the compiler to evaluate all conditions to allow or-ing
+ // them together (yes, he could do better). Using the logical or allows to return on the first
// failing statement instead.
//
// return (!(IsSelFrmMode() | IsObjSelected() | (GetView().GetDrawFuncPtr() != NULL) | (GetView().GetPostItMgr()->GetActiveSidebarWin()!= NULL)));
@@ -1900,4 +1900,4 @@ void SwWrtShell::ApplyViewOptions( const SwViewOption &rOpt )
GetView().GetViewFrame()->GetBindings().Invalidate( FN_VIEW_META_CHARS );
}
-
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/vcl/inc/vcl/pdfwriter.hxx b/main/vcl/inc/vcl/pdfwriter.hxx
index 78a18cdb01..aa996ab952 100644
--- a/main/vcl/inc/vcl/pdfwriter.hxx
+++ b/main/vcl/inc/vcl/pdfwriter.hxx
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,19 +7,20 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
+
#ifndef _VCL_PDFWRITER_HXX
#define _VCL_PDFWRITER_HXX
@@ -58,423 +59,423 @@ class Wallpaper;
namespace vcl
{
-
+
class PDFExtOutDevData;
struct PDFNote
{
- String Title; // optional title for the popup containing the note
- String Contents; // contents of the note
+ String Title; // optional title for the popup containing the note
+ String Contents; // contents of the note
};
class VCL_DLLPUBLIC PDFOutputStream
{
- public:
- virtual ~PDFOutputStream();
- virtual void write( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xStream ) = 0;
+ public:
+ virtual ~PDFOutputStream();
+ virtual void write( const com::sun::star::uno::Reference< com::sun::star::io::XOutputStream >& xStream ) = 0;
};
class VCL_DLLPUBLIC PDFWriter
{
- void* pImplementation;
+ void* pImplementation;
public:
- // extended line info
- enum CapType { capButt, capRound, capSquare };
- enum JoinType { joinMiter, joinRound, joinBevel };
- struct ExtLineInfo
- {
- double m_fLineWidth;
- double m_fTransparency;
- CapType m_eCap;
- JoinType m_eJoin;
- double m_fMiterLimit;
- std::vector< double > m_aDashArray;
-
- ExtLineInfo() : m_fLineWidth( 0.0 ),
- m_fTransparency( 0.0 ),
- m_eCap( capButt ),
- m_eJoin( joinMiter ),
- m_fMiterLimit( 10.0 )
- {}
- };
-
- enum Orientation { Portrait, Landscape, Seascape, Inherit };
-
- // in case the below enum is added PDF_1_6 PDF_1_7, please add them just after PDF_1_5
- enum PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_A_1 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
- // for the meaning of DestAreaType please look at PDF Reference Manual
- // version 1.4 section 8.2.1, page 475
- enum DestAreaType { XYZ, Fit, FitHorizontal, FitVertical,
- FitRectangle, FitPageBoundingBox, FitPageBoundingBoxHorizontal,
- FitPageBoundingBoxVertical
- };
-
- // for a definition of structural element types please refer to
- // PDF Reference, 3rd ed. section 9.7.4
- enum StructElement
- {
- // special element to place outside the structure hierarchy
- NonStructElement,
- // Grouping elements
- Document, Part, Article, Section, Division, BlockQuote,
- Caption, TOC, TOCI, Index,
-
- // block level elements
- Paragraph, Heading, H1, H2, H3, H4, H5, H6,
- List, ListItem, LILabel, LIBody,
- Table, TableRow, TableHeader, TableData,
-
- // inline level elements
- Span, Quote, Note, Reference, BibEntry, Code, Link,
-
- // illustration elements
- Figure, Formula, Form
- };
-
- enum StructAttribute
- {
- Placement, WritingMode, SpaceBefore, SpaceAfter, StartIndent, EndIndent,
- TextIndent, TextAlign, Width, Height, BlockAlign, InlineAlign,
- LineHeight, BaselineShift, TextDecorationType, ListNumbering,
- RowSpan, ColSpan,
-
- // link destination is an artificial attribute that sets
- // the link annotation ID of a Link element
- // further note: since structure attributes can only be
- // set during content creation, but links can be
- // created after the fact, it is possible to set
- // an arbitrary id as structure attribute here. In this
- // case the arbitrary id has to be passed again when the
- // actual link annotation is created via SetLinkPropertyID
- LinkAnnotation,
- // Language currently sets a LanguageType (see i18npool/lang.h)
- // which will be internally changed to a corresponding locale
- Language
- };
-
- enum StructAttributeValue
- {
- Invalid,
- NONE,
- // Placement
- Block, Inline, Before, After, Start, End,
- // WritingMode
- LrTb, RlTb, TbRl,
- // TextAlign
- Center, Justify,
- // Width, Height,
- Auto,
- // BlockAlign
- Middle,
- // LineHeight
- Normal,
- // TextDecorationType
- Underline, Overline, LineThrough,
- // ListNumbering
- Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha
- };
-
- enum PageTransition
- {
- Regular,
- SplitHorizontalInward, SplitHorizontalOutward,
- SplitVerticalInward, SplitVerticalOutward,
- BlindsHorizontal, BlindsVertical,
- BoxInward, BoxOutward,
- WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
- Dissolve,
- GlitterLeftToRight, GlitterTopToBottom, GlitterTopLeftToBottomRight
- };
-
- enum WidgetType
- {
- PushButton, RadioButton, CheckBox, Edit, ListBox, ComboBox, Hierarchy
- };
-
- enum WidgetState
- {
- // PushButton, RadioButton, CheckBox; Down means selected for
- // RadioButton and CheckBox
- Up, Down
- };
-
- enum ErrorCode
- {
- // transparent object occurred and was draw opaque because
- // PDF/A does not allow transparency
- Warning_Transparency_Omitted_PDFA,
-
- // transparent object occurred but is only supported since
- // PDF 1.4
- Warning_Transparency_Omitted_PDF13,
-
- // a form action was exported that is not suitable for PDF/A
- // the action was skipped
- Warning_FormAction_Omitted_PDFA,
-
- // transparent objects were converted to a bitmap in order
- // to removetransparencies from the output
- Warning_Transparency_Converted
- };
-
- struct VCL_DLLPUBLIC AnyWidget
- {
- protected:
- WidgetType Type; // primitive RTTI
- public:
- rtl::OUString Name; // a distinct name to identify the control
- rtl::OUString Description;// descriptive text for the contro (e.g. for tool tip)
- rtl::OUString Text; // user text to appear on the control
- sal_uInt16 TextStyle; // style flags
- bool ReadOnly;
- Rectangle Location; // describes the area filled by the control
- bool Border; // true: widget should have a border, false: no border
- Color BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
- bool Background; // true: widget shall draw its background, false: no background
- Color BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
- Font TextFont; // an empty font will be replaced by the
- // appropriate font from the user settings
- Color TextColor; // COL_TRANSPARENT will be replaced by the appropriate color from application settings
- sal_Int32 TabOrder; // lowest number is first in tab order
-
- /* style flags for text are those for OutputDevice::DrawText
- allowed values are:
- TEXT_DRAW_LEFT, TEXT_DRAW_CENTER, TEXT_DRAW_RIGHT, TEXT_DRAW_TOP,
- TEXT_DRAW_VCENTER, TEXT_DRAW_BOTTOM,
- TEXT_DRAW_MULTILINE, TEXT_DRAW_WORDBREAK
-
- if TextStyle is 0, then each control will fill in default values
- */
-
- // note: the Name member comprises the field name of the resulting
- // PDF field names need to be globally unique. Therefore if any
- // Widget with an already used name is created, the name will be
- // made unique by adding an underscore ('_') and an ascending number
- // to the name.
-
- AnyWidget( WidgetType eType ) :
- Type( eType ),
- TextStyle( 0 ),
- ReadOnly( false ),
- Border( false ),
- BorderColor( COL_TRANSPARENT ),
- Background( false ),
- BackgroundColor( COL_TRANSPARENT ),
- TextColor( COL_TRANSPARENT ),
- TabOrder( -1 )
- {}
- virtual ~AnyWidget();
-
- WidgetType getType() const { return Type; }
-
- virtual AnyWidget* Clone() const = 0;
-
- protected:
- // note that this equals the default compiler-generated copy-ctor, but we want to have it
- // protected, to only allow sub classes to access it
- AnyWidget( const AnyWidget& rSource )
- :Type( rSource.Type )
- ,Name( rSource.Name )
- ,Description( rSource.Description )
- ,Text( rSource.Text )
- ,TextStyle( rSource.TextStyle )
- ,ReadOnly( rSource.ReadOnly )
- ,Location( rSource.Location )
- ,Border( rSource.Border )
- ,BorderColor( rSource.BorderColor )
- ,Background( rSource.Background )
- ,BackgroundColor( rSource.BackgroundColor )
- ,TextFont( rSource.TextFont )
- ,TextColor( rSource.TextColor )
- ,TabOrder( rSource.TabOrder )
- {
- }
- AnyWidget& operator=( const AnyWidget& ); // never implemented
- };
-
- struct PushButtonWidget : public AnyWidget
- {
- /* If Dest is set to a valid link destination,
- Then pressing the button will act as a goto
- action within the docuemnt.
-
- Else:
- An empty URL means this button will reset the form.
-
- If URL is not empty and Submit is set, then the URL
- contained will be set as the URL to submit the
- form to. In this case the submit method will be
- either GET if SubmitGet is true or POST if
- SubmitGet is false.
-
- If URL is not empty and Submit is clear, then
- the URL contained will be interpreted as a
- hyperlink to be executed on pushing the button.
-
- There will be no error checking or any kind of
- conversion done to the URL parameter execept this:
- it will be output as 7bit Ascii. The URL
- will appear literally in the PDF file produced
- */
- sal_Int32 Dest;
- rtl::OUString URL;
- bool Submit;
- bool SubmitGet;
-
- PushButtonWidget()
- : AnyWidget( vcl::PDFWriter::PushButton ),
- Dest( -1 ), Submit( false ), SubmitGet( false )
- {}
-
- virtual AnyWidget* Clone() const
- {
- return new PushButtonWidget( *this );
- }
- };
-
- struct CheckBoxWidget : public AnyWidget
- {
- bool Checked;
- bool ButtonIsLeft;
-
- CheckBoxWidget()
- : AnyWidget( vcl::PDFWriter::CheckBox ),
- Checked( false ),
- ButtonIsLeft( true )
- {}
-
- virtual AnyWidget* Clone() const
- {
- return new CheckBoxWidget( *this );
- }
- };
-
- struct RadioButtonWidget : public AnyWidget
- {
- bool Selected;
- sal_Int32 RadioGroup;
- bool ButtonIsLeft;
- rtl::OUString OnValue; // the value of the radio button if it is selected
-
- RadioButtonWidget()
- : AnyWidget( vcl::PDFWriter::RadioButton ),
- Selected( false ),
- RadioGroup( 0 ),
- ButtonIsLeft( true )
- {}
-
- virtual AnyWidget* Clone() const
- {
- return new RadioButtonWidget( *this );
- }
- // radio buttons having the same RadioGroup id comprise one
- // logical radio button group, that is at most one of the RadioButtons
- // in a group can be checked at any time
- //
- // note: a PDF radio button field consists of a named field
- // containing unnamed checkbox child fields. The name of the
- // radio button field is taken from the first RadioButtonWidget created
- // in the group
- };
-
- struct EditWidget : public AnyWidget
- {
- bool MultiLine; // whether multiple lines are allowed
- bool Password; // visible echo off
- bool FileSelect; // field is a file selector
- sal_Int32 MaxLen; // maximum field length in characters, 0 means unlimited
-
- EditWidget()
- : AnyWidget( vcl::PDFWriter::Edit ),
- MultiLine( false ),
- Password( false ),
- FileSelect( false ),
- MaxLen( 0 )
- {}
-
- virtual AnyWidget* Clone() const
- {
- return new EditWidget( *this );
- }
- };
-
- struct ListBoxWidget : public AnyWidget
- {
- bool DropDown;
- bool Sort;
- bool MultiSelect;
- std::vector<rtl::OUString> Entries;
- std::vector<sal_Int32> SelectedEntries;
- // if MultiSelect is false only the first entry of SelectedEntries
- // will be taken into account. the same is implicit for PDF < 1.4
- // since multiselect is a 1.4+ feature
-
- ListBoxWidget()
- : AnyWidget( vcl::PDFWriter::ListBox ),
- DropDown( false ),
- Sort( false ),
- MultiSelect( false )
- {}
-
- virtual AnyWidget* Clone() const
- {
- return new ListBoxWidget( *this );
- }
- };
-
- // note: PDF only supports dropdown comboboxes
- struct ComboBoxWidget : public AnyWidget
- {
- bool Sort;
- std::vector<rtl::OUString> Entries;
- // set the current value in AnyWidget::Text
-
- ComboBoxWidget()
- : AnyWidget( vcl::PDFWriter::ComboBox ),
- Sort( false )
- {}
-
- virtual AnyWidget* Clone() const
- {
- return new ComboBoxWidget( *this );
- }
- };
-
- enum ExportDataFormat { HTML, XML, FDF, PDF };
+ // extended line info
+ enum CapType { capButt, capRound, capSquare };
+ enum JoinType { joinMiter, joinRound, joinBevel };
+ struct ExtLineInfo
+ {
+ double m_fLineWidth;
+ double m_fTransparency;
+ CapType m_eCap;
+ JoinType m_eJoin;
+ double m_fMiterLimit;
+ std::vector< double > m_aDashArray;
+
+ ExtLineInfo() : m_fLineWidth( 0.0 ),
+ m_fTransparency( 0.0 ),
+ m_eCap( capButt ),
+ m_eJoin( joinMiter ),
+ m_fMiterLimit( 10.0 )
+ {}
+ };
+
+ enum Orientation { Portrait, Landscape, Seascape, Inherit };
+
+ // in case the below enum is added PDF_1_6 PDF_1_7, please add them just after PDF_1_5
+ enum PDFVersion { PDF_1_2, PDF_1_3, PDF_1_4, PDF_1_5, PDF_A_1 };//i59651, PDF/A-1b & -1a, only -1b implemented for now
+ // for the meaning of DestAreaType please look at PDF Reference Manual
+ // version 1.4 section 8.2.1, page 475
+ enum DestAreaType { XYZ, Fit, FitHorizontal, FitVertical,
+ FitRectangle, FitPageBoundingBox, FitPageBoundingBoxHorizontal,
+ FitPageBoundingBoxVertical
+ };
+
+ // for a definition of structural element types please refer to
+ // PDF Reference, 3rd ed. section 9.7.4
+ enum StructElement
+ {
+ // special element to place outside the structure hierarchy
+ NonStructElement,
+ // Grouping elements
+ Document, Part, Article, Section, Division, BlockQuote,
+ Caption, TOC, TOCI, Index,
+
+ // block level elements
+ Paragraph, Heading, H1, H2, H3, H4, H5, H6,
+ List, ListItem, LILabel, LIBody,
+ Table, TableRow, TableHeader, TableData,
+
+ // inline level elements
+ Span, Quote, Note, Reference, BibEntry, Code, Link,
+
+ // illustration elements
+ Figure, Formula, Form
+ };
+
+ enum StructAttribute
+ {
+ Placement, WritingMode, SpaceBefore, SpaceAfter, StartIndent, EndIndent,
+ TextIndent, TextAlign, Width, Height, BlockAlign, InlineAlign,
+ LineHeight, BaselineShift, TextDecorationType, ListNumbering,
+ RowSpan, ColSpan,
+
+ // link destination is an artificial attribute that sets
+ // the link annotation ID of a Link element
+ // further note: since structure attributes can only be
+ // set during content creation, but links can be
+ // created after the fact, it is possible to set
+ // an arbitrary id as structure attribute here. In this
+ // case the arbitrary id has to be passed again when the
+ // actual link annotation is created via SetLinkPropertyID
+ LinkAnnotation,
+ // Language currently sets a LanguageType (see i18npool/lang.h)
+ // which will be internally changed to a corresponding locale
+ Language
+ };
+
+ enum StructAttributeValue
+ {
+ Invalid,
+ NONE,
+ // Placement
+ Block, Inline, Before, After, Start, End,
+ // WritingMode
+ LrTb, RlTb, TbRl,
+ // TextAlign
+ Center, Justify,
+ // Width, Height,
+ Auto,
+ // BlockAlign
+ Middle,
+ // LineHeight
+ Normal,
+ // TextDecorationType
+ Underline, Overline, LineThrough,
+ // ListNumbering
+ Disc, Circle, Square, Decimal, UpperRoman, LowerRoman, UpperAlpha, LowerAlpha
+ };
+
+ enum PageTransition
+ {
+ Regular,
+ SplitHorizontalInward, SplitHorizontalOutward,
+ SplitVerticalInward, SplitVerticalOutward,
+ BlindsHorizontal, BlindsVertical,
+ BoxInward, BoxOutward,
+ WipeLeftToRight, WipeBottomToTop, WipeRightToLeft, WipeTopToBottom,
+ Dissolve,
+ GlitterLeftToRight, GlitterTopToBottom, GlitterTopLeftToBottomRight
+ };
+
+ enum WidgetType
+ {
+ PushButton, RadioButton, CheckBox, Edit, ListBox, ComboBox, Hierarchy
+ };
+
+ enum WidgetState
+ {
+ // PushButton, RadioButton, CheckBox; Down means selected for
+ // RadioButton and CheckBox
+ Up, Down
+ };
+
+ enum ErrorCode
+ {
+ // transparent object occurred and was drawn opaque because
+ // PDF/A does not allow transparency
+ Warning_Transparency_Omitted_PDFA,
+
+ // transparent object occurred but is only supported since
+ // PDF 1.4
+ Warning_Transparency_Omitted_PDF13,
+
+ // a form action was exported that is not suitable for PDF/A
+ // the action was skipped
+ Warning_FormAction_Omitted_PDFA,
+
+ // transparent objects were converted to a bitmap in order
+ // to remove transparencies from the output
+ Warning_Transparency_Converted
+ };
+
+ struct VCL_DLLPUBLIC AnyWidget
+ {
+ protected:
+ WidgetType Type; // primitive RTTI
+ public:
+ rtl::OUString Name; // a distinct name to identify the control
+ rtl::OUString Description;// descriptive text for the control (e.g. for tool tip)
+ rtl::OUString Text; // user text to appear on the control
+ sal_uInt16 TextStyle; // style flags
+ bool ReadOnly;
+ Rectangle Location; // describes the area filled by the control
+ bool Border; // true: widget should have a border, false: no border
+ Color BorderColor;// COL_TRANSPARENT and Border=true means get color from application settings
+ bool Background; // true: widget shall draw its background, false: no background
+ Color BackgroundColor; // COL_TRANSPARENT and Background=true means get color from application settings
+ Font TextFont; // an empty font will be replaced by the
+ // appropriate font from the user settings
+ Color TextColor; // COL_TRANSPARENT will be replaced by the appropriate color from application settings
+ sal_Int32 TabOrder; // lowest number is first in tab order
+
+ /* style flags for text are those for OutputDevice::DrawText
+ allowed values are:
+ TEXT_DRAW_LEFT, TEXT_DRAW_CENTER, TEXT_DRAW_RIGHT, TEXT_DRAW_TOP,
+ TEXT_DRAW_VCENTER, TEXT_DRAW_BOTTOM,
+ TEXT_DRAW_MULTILINE, TEXT_DRAW_WORDBREAK
+
+ if TextStyle is 0, then each control will fill in default values
+ */
+
+ // note: the Name member comprises the field name of the resulting
+ // PDF field names need to be globally unique. Therefore if any
+ // Widget with an already used name is created, the name will be
+ // made unique by adding an underscore ('_') and an ascending number
+ // to the name.
+
+ AnyWidget( WidgetType eType ) :
+ Type( eType ),
+ TextStyle( 0 ),
+ ReadOnly( false ),
+ Border( false ),
+ BorderColor( COL_TRANSPARENT ),
+ Background( false ),
+ BackgroundColor( COL_TRANSPARENT ),
+ TextColor( COL_TRANSPARENT ),
+ TabOrder( -1 )
+ {}
+ virtual ~AnyWidget();
+
+ WidgetType getType() const { return Type; }
+
+ virtual AnyWidget* Clone() const = 0;
+
+ protected:
+ // note that this equals the default compiler-generated copy-ctor, but we want to have it
+ // protected, to only allow sub classes to access it
+ AnyWidget( const AnyWidget& rSource )
+ :Type( rSource.Type )
+ ,Name( rSource.Name )
+ ,Description( rSource.Description )
+ ,Text( rSource.Text )
+ ,TextStyle( rSource.TextStyle )
+ ,ReadOnly( rSource.ReadOnly )
+ ,Location( rSource.Location )
+ ,Border( rSource.Border )
+ ,BorderColor( rSource.BorderColor )
+ ,Background( rSource.Background )
+ ,BackgroundColor( rSource.BackgroundColor )
+ ,TextFont( rSource.TextFont )
+ ,TextColor( rSource.TextColor )
+ ,TabOrder( rSource.TabOrder )
+ {
+ }
+ AnyWidget& operator=( const AnyWidget& ); // never implemented
+ };
+
+ struct PushButtonWidget : public AnyWidget
+ {
+ /* If Dest is set to a valid link destination,
+ Then pressing the button will act as a goto
+ action within the document.
+
+ Else:
+ An empty URL means this button will reset the form.
+
+ If URL is not empty and Submit is set, then the URL
+ contained will be set as the URL to submit the
+ form to. In this case the submit method will be
+ either GET if SubmitGet is true or POST if
+ SubmitGet is false.
+
+ If URL is not empty and Submit is clear, then
+ the URL contained will be interpreted as a
+ hyperlink to be executed on pushing the button.
+
+ There will be no error checking or any kind of
+ conversion done to the URL parameter except this:
+ it will be output as 7bit Ascii. The URL
+ will appear literally in the PDF file produced
+ */
+ sal_Int32 Dest;
+ rtl::OUString URL;
+ bool Submit;
+ bool SubmitGet;
+
+ PushButtonWidget()
+ : AnyWidget( vcl::PDFWriter::PushButton ),
+ Dest( -1 ), Submit( false ), SubmitGet( false )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new PushButtonWidget( *this );
+ }
+ };
+
+ struct CheckBoxWidget : public AnyWidget
+ {
+ bool Checked;
+ bool ButtonIsLeft;
+
+ CheckBoxWidget()
+ : AnyWidget( vcl::PDFWriter::CheckBox ),
+ Checked( false ),
+ ButtonIsLeft( true )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new CheckBoxWidget( *this );
+ }
+ };
+
+ struct RadioButtonWidget : public AnyWidget
+ {
+ bool Selected;
+ sal_Int32 RadioGroup;
+ bool ButtonIsLeft;
+ rtl::OUString OnValue; // the value of the radio button if it is selected
+
+ RadioButtonWidget()
+ : AnyWidget( vcl::PDFWriter::RadioButton ),
+ Selected( false ),
+ RadioGroup( 0 ),
+ ButtonIsLeft( true )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new RadioButtonWidget( *this );
+ }
+ // radio buttons having the same RadioGroup id comprise one
+ // logical radio button group, that is at most one of the RadioButtons
+ // in a group can be checked at any time
+ //
+ // note: a PDF radio button field consists of a named field
+ // containing unnamed checkbox child fields. The name of the
+ // radio button field is taken from the first RadioButtonWidget created
+ // in the group
+ };
+
+ struct EditWidget : public AnyWidget
+ {
+ bool MultiLine; // whether multiple lines are allowed
+ bool Password; // visible echo off
+ bool FileSelect; // field is a file selector
+ sal_Int32 MaxLen; // maximum field length in characters, 0 means unlimited
+
+ EditWidget()
+ : AnyWidget( vcl::PDFWriter::Edit ),
+ MultiLine( false ),
+ Password( false ),
+ FileSelect( false ),
+ MaxLen( 0 )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new EditWidget( *this );
+ }
+ };
+
+ struct ListBoxWidget : public AnyWidget
+ {
+ bool DropDown;
+ bool Sort;
+ bool MultiSelect;
+ std::vector<rtl::OUString> Entries;
+ std::vector<sal_Int32> SelectedEntries;
+ // if MultiSelect is false only the first entry of SelectedEntries
+ // will be taken into account. the same is implicit for PDF < 1.4
+ // since multiselect is a 1.4+ feature
+
+ ListBoxWidget()
+ : AnyWidget( vcl::PDFWriter::ListBox ),
+ DropDown( false ),
+ Sort( false ),
+ MultiSelect( false )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new ListBoxWidget( *this );
+ }
+ };
+
+ // note: PDF only supports dropdown comboboxes
+ struct ComboBoxWidget : public AnyWidget
+ {
+ bool Sort;
+ std::vector<rtl::OUString> Entries;
+ // set the current value in AnyWidget::Text
+
+ ComboBoxWidget()
+ : AnyWidget( vcl::PDFWriter::ComboBox ),
+ Sort( false )
+ {}
+
+ virtual AnyWidget* Clone() const
+ {
+ return new ComboBoxWidget( *this );
+ }
+ };
+
+ enum ExportDataFormat { HTML, XML, FDF, PDF };
// see 3.6.1 of PDF 1.4 ref for details, used for 8.1 PDF v 1.4 ref also
// These emuns are treated as integer while reading/writing to configuration
- enum PDFViewerPageMode
- {
- ModeDefault,
- UseOutlines,
- UseThumbs
- };
+ enum PDFViewerPageMode
+ {
+ ModeDefault,
+ UseOutlines,
+ UseThumbs
+ };
// These emuns are treated as integer while reading/writing to configuration
- enum PDFViewerAction
- {
- ActionDefault,
- FitInWindow,
- FitWidth,
- FitVisible,
- ActionZoom
- };
+ enum PDFViewerAction
+ {
+ ActionDefault,
+ FitInWindow,
+ FitWidth,
+ FitVisible,
+ ActionZoom
+ };
// These enums are treated as integer while reading/writing to configuration
- enum PDFPageLayout
- {
- DefaultLayout,
- SinglePage,
- Continuous,
- ContinuousFacing
- };
-
- // These emuns are treated as integer while reading/writing to configuration
- //what default action to generate in a PDF hyperlink to external document/site
- enum PDFLinkDefaultAction
- {
- URIAction,
- URIActionDestination,
- LaunchAction
- };
+ enum PDFPageLayout
+ {
+ DefaultLayout,
+ SinglePage,
+ Continuous,
+ ContinuousFacing
+ };
+
+ // These emuns are treated as integer while reading/writing to configuration
+ //what default action to generate in a PDF hyperlink to external document/site
+ enum PDFLinkDefaultAction
+ {
+ URIAction,
+ URIActionDestination,
+ LaunchAction
+ };
/*
The following structure describes the permissions used in PDF security
@@ -504,10 +505,10 @@ The following structure describes the permissions used in PDF security
std::vector<sal_uInt8> UValue;
std::vector<sal_uInt8> EncryptionKey;
std::vector<sal_uInt8> DocumentIdentifier;
-
+
//permission default set for 128 bit, accessibility only
PDFEncryptionProperties() :
- Security128bit ( true ),
+ Security128bit ( true ),
CanPrintTheDocument ( false ),
CanModifyTheContent ( false ),
CanCopyOrExtract ( false ),
@@ -517,842 +518,842 @@ The following structure describes the permissions used in PDF security
CanAssemble ( false ),
CanPrintFull ( false )
{}
-
-
- bool Encrypt() const
- { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
+
+
+ bool Encrypt() const
+ { return ! OValue.empty() && ! UValue.empty() && ! DocumentIdentifier.empty(); }
};
- struct PDFDocInfo
- {
- String Title; // document title
- String Author; // document author
- String Subject; // subject
- String Keywords; // keywords
- String Creator; // application that created the original document
- String Producer; // OpenOffice
- };
-
- enum ColorMode
- {
- DrawColor, DrawGreyscale
- };
-
- struct PDFWriterContext
- {
- /* must be a valid file: URL usable by osl */
- rtl::OUString URL;
- /* the URL of the document being exported, used for relative links*/
- rtl::OUString BaseURL;
- /*if relative to file system should be formed*/
- bool RelFsys;//i56629, i49415?, i64585?
- /*the action to set the PDF hyperlink to*/
- PDFWriter::PDFLinkDefaultAction DefaultLinkAction;
- //convert the .od? target file type in a link to a .pdf type
- //this is examined before doing anything else
- bool ConvertOOoTargetToPDFTarget;
- //when the file type is .pdf, force the GoToR action
- bool ForcePDFAction;
-
- /* decides the PDF language level to be produced */
- PDFVersion Version;
- /* valid for PDF >= 1.4
- causes the MarkInfo entry in the document catalog to be set
- */
- bool Tagged;
- /* forces the embedding of PDF standard fonts */
- bool EmbedStandardFonts;
- /* determines in which format a form
- will be submitted.
- */
- PDFWriter::ExportDataFormat SubmitFormat;
- bool AllowDuplicateFieldNames;
- bool FieldsUseSystemFonts;
- /* the following data members are used to customize the PDF viewer
- preferences
- */
- /* see 3.6.1 PDF v 1.4 ref*/
- PDFWriter::PDFViewerPageMode PDFDocumentMode;
- PDFWriter::PDFViewerAction PDFDocumentAction;
- // in percent, valid only if PDFDocumentAction == ActionZoom
- sal_Int32 Zoom;
-
- /* see 8.6 PDF v 1.4 ref
- specifies whether to hide the viewer tool
- bars when the document is active.
- */
- bool HideViewerToolbar;
- bool HideViewerMenubar;
- bool HideViewerWindowControls;
- bool FitWindow;
- bool OpenInFullScreenMode;
- bool CenterWindow;
- bool DisplayPDFDocumentTitle;
- PDFPageLayout PageLayout;
- bool FirstPageLeft;
- // initially visible page in viewer (starting with 0 for first page)
- sal_Int32 InitialPage;
- sal_Int32 OpenBookmarkLevels; // -1 means all levels
-
- PDFWriter::PDFEncryptionProperties Encryption;
- PDFWriter::PDFDocInfo DocumentInfo;
-
- com::sun::star::lang::Locale DocumentLocale; // defines the document default language
- sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
- // 0 here specifies a default handling
- PDFWriter::ColorMode ColorMode;
-
- PDFWriterContext() :
- RelFsys( false ), //i56629, i49415?, i64585?
- DefaultLinkAction( PDFWriter::URIAction ),
- ConvertOOoTargetToPDFTarget( false ),
- ForcePDFAction( false ),
- Version( PDFWriter::PDF_1_4 ),
- Tagged( false ),
- EmbedStandardFonts( false ),
- SubmitFormat( PDFWriter::FDF ),
- AllowDuplicateFieldNames( false ),
- FieldsUseSystemFonts( true ),
- PDFDocumentMode( PDFWriter::ModeDefault ),
- PDFDocumentAction( PDFWriter::ActionDefault ),
- Zoom( 100 ),
- HideViewerToolbar( false ),
- HideViewerMenubar( false ),
- HideViewerWindowControls( false ),
- FitWindow( false ),
- OpenInFullScreenMode( false ),
- CenterWindow( false ),
- DisplayPDFDocumentTitle( true ),
- PageLayout( PDFWriter::DefaultLayout ),
- FirstPageLeft( false ),
- InitialPage( 1 ),
- OpenBookmarkLevels( -1 ),
+ struct PDFDocInfo
+ {
+ String Title; // document title
+ String Author; // document author
+ String Subject; // subject
+ String Keywords; // keywords
+ String Creator; // application that created the original document
+ String Producer; // OpenOffice
+ };
+
+ enum ColorMode
+ {
+ DrawColor, DrawGreyscale
+ };
+
+ struct PDFWriterContext
+ {
+ /* must be a valid file: URL usable by osl */
+ rtl::OUString URL;
+ /* the URL of the document being exported, used for relative links*/
+ rtl::OUString BaseURL;
+ /*if relative to file system should be formed*/
+ bool RelFsys;//i56629, i49415?, i64585?
+ /*the action to set the PDF hyperlink to*/
+ PDFWriter::PDFLinkDefaultAction DefaultLinkAction;
+ //convert the .od? target file type in a link to a .pdf type
+ //this is examined before doing anything else
+ bool ConvertOOoTargetToPDFTarget;
+ //when the file type is .pdf, force the GoToR action
+ bool ForcePDFAction;
+
+ /* decides the PDF language level to be produced */
+ PDFVersion Version;
+ /* valid for PDF >= 1.4
+ causes the MarkInfo entry in the document catalog to be set
+ */
+ bool Tagged;
+ /* forces the embedding of PDF standard fonts */
+ bool EmbedStandardFonts;
+ /* determines in which format a form will be submitted. */
+ PDFWriter::ExportDataFormat SubmitFormat;
+ bool AllowDuplicateFieldNames;
+ bool FieldsUseSystemFonts;
+ /* the following data members are used to customize the PDF viewer
+ preferences
+ */
+ /* see 3.6.1 PDF v 1.4 ref */
+ PDFWriter::PDFViewerPageMode PDFDocumentMode;
+ PDFWriter::PDFViewerAction PDFDocumentAction;
+ // in percent, valid only if PDFDocumentAction == ActionZoom
+ sal_Int32 Zoom;
+
+ /* see 8.6 PDF v 1.4 ref
+ specifies whether to hide the viewer tool
+ bars when the document is active.
+ */
+ bool HideViewerToolbar;
+ bool HideViewerMenubar;
+ bool HideViewerWindowControls;
+ bool FitWindow;
+ bool OpenInFullScreenMode;
+ bool CenterWindow;
+ bool DisplayPDFDocumentTitle;
+ PDFPageLayout PageLayout;
+ bool FirstPageLeft;
+ // initially visible page in viewer (starting with 0 for first page)
+ sal_Int32 InitialPage;
+ sal_Int32 OpenBookmarkLevels; // -1 means all levels
+
+ PDFWriter::PDFEncryptionProperties Encryption;
+ PDFWriter::PDFDocInfo DocumentInfo;
+
+ com::sun::star::lang::Locale DocumentLocale; // defines the document default language
+ sal_uInt32 DPIx, DPIy; // how to handle MapMode( MAP_PIXEL )
+ // 0 here specifies a default handling
+ PDFWriter::ColorMode ColorMode;
+
+ PDFWriterContext() :
+ RelFsys( false ), //i56629, i49415?, i64585?
+ DefaultLinkAction( PDFWriter::URIAction ),
+ ConvertOOoTargetToPDFTarget( false ),
+ ForcePDFAction( false ),
+ Version( PDFWriter::PDF_1_4 ),
+ Tagged( false ),
+ EmbedStandardFonts( false ),
+ SubmitFormat( PDFWriter::FDF ),
+ AllowDuplicateFieldNames( false ),
+ FieldsUseSystemFonts( true ),
+ PDFDocumentMode( PDFWriter::ModeDefault ),
+ PDFDocumentAction( PDFWriter::ActionDefault ),
+ Zoom( 100 ),
+ HideViewerToolbar( false ),
+ HideViewerMenubar( false ),
+ HideViewerWindowControls( false ),
+ FitWindow( false ),
+ OpenInFullScreenMode( false ),
+ CenterWindow( false ),
+ DisplayPDFDocumentTitle( true ),
+ PageLayout( PDFWriter::DefaultLayout ),
+ FirstPageLeft( false ),
+ InitialPage( 1 ),
+ OpenBookmarkLevels( -1 ),
Encryption(),
DPIx( 0 ),
DPIy( 0 ),
- ColorMode( PDFWriter::DrawColor )
- {}
- };
-
- PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
- ~PDFWriter();
-
- /** Returns an OutputDevice for formatting
- <p>This Output device is guaranteed to use the same
- font metrics as the resulting PDF file.</p>
-
- @returns
- the reference output device
- */
- OutputDevice* GetReferenceDevice();
-
- /** Creates a new page to fill
- <p>If width and height are not set the page size
- is inherited from the page tree</p>
- <p>other effects:
- resets the graphics state: MapMode, Font
- Colors and other state information MUST
- be set again or are undefined.
- </p>
-
- @returns
- returns the page id of the new page
- */
- sal_Int32 NewPage( sal_Int32 nPageWidth = 0, sal_Int32 nPageHeight = 0, Orientation eOrientation = Inherit );
- /** Play a metafile like an outputdevice would do
- */
- struct PlayMetafileContext
- {
- int m_nMaxImageResolution;
- bool m_bOnlyLosslessCompression;
- int m_nJPEGQuality;
- bool m_bTransparenciesWereRemoved;
-
- PlayMetafileContext()
- : m_nMaxImageResolution( 0 )
- , m_bOnlyLosslessCompression( false )
- , m_nJPEGQuality( 90 )
- , m_bTransparenciesWereRemoved( false )
- {}
-
- };
- void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
-
- /* sets the document locale originally passed with the context to a new value
- * only affects the output if used before calling <code>Emit/code>.
- */
- void SetDocumentLocale( const com::sun::star::lang::Locale& rDocLocale );
-
- /* finishes the file */
- bool Emit();
-
- /*
- * Get a list of errors that occurred during processing
- * this should enable the producer to give feedback about
- * any anomalies that might have occurred
- */
- std::set< ErrorCode > GetErrors();
-
- PDFVersion GetVersion() const;
-
- static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
- InitEncryption( const rtl::OUString& i_rOwnerPassword,
- const rtl::OUString& i_rUserPassword,
- bool b128Bit
- );
-
- /* functions for graphics state */
- /* flag values: see vcl/outdev.hxx */
- void Push( sal_uInt16 nFlags = 0xffff );
- void Pop();
-
- void SetClipRegion();
- void SetClipRegion( const basegfx::B2DPolyPolygon& rRegion );
- void MoveClipRegion( long nHorzMove, long nVertMove );
- void IntersectClipRegion( const Rectangle& rRect );
- void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
-
- void SetAntialiasing( sal_uInt16 nMode = 0 );
-
- void SetLayoutMode( sal_uLong nMode );
- void SetDigitLanguage( LanguageType eLang );
-
- void SetLineColor( const Color& rColor );
- void SetLineColor() { SetLineColor( Color( COL_TRANSPARENT ) ); }
-
- void SetFillColor( const Color& rColor );
- void SetFillColor() { SetFillColor( Color( COL_TRANSPARENT ) ); }
-
- void SetFont( const Font& rNewFont );
- void SetTextColor( const Color& rColor );
- void SetTextFillColor();
- void SetTextFillColor( const Color& rColor );
-
- void SetTextLineColor();
- void SetTextLineColor( const Color& rColor );
- void SetOverlineColor();
- void SetOverlineColor( const Color& rColor );
- void SetTextAlign( ::TextAlign eAlign );
-
- void SetMapMode();
- void SetMapMode( const MapMode& rNewMapMode );
-
-
- /* actual drawing functions */
- void DrawText( const Point& rPos, const String& rText );
-
- void DrawTextLine( const Point& rPos, long nWidth,
- FontStrikeout eStrikeout,
- FontUnderline eUnderline,
- FontUnderline eOverline,
- sal_Bool bUnderlineAbove = sal_False );
- void DrawTextArray( const Point& rStartPt, const XubString& rStr,
- const sal_Int32* pDXAry = NULL,
- xub_StrLen nIndex = 0,
- xub_StrLen nLen = STRING_LEN );
- void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
- const XubString& rStr,
- xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
- void DrawText( const Rectangle& rRect,
- const XubString& rStr, sal_uInt16 nStyle = 0 );
-
- void DrawPixel( const Point& rPt, const Color& rColor );
- void DrawPixel( const Point& rPt )
- { DrawPixel( rPt, Color( COL_TRANSPARENT ) ); }
- void DrawPixel( const Polygon& rPts, const Color* pColors = NULL );
- void DrawPixel( const Polygon& rPts, const Color& rColor )
- { Push(); SetLineColor( rColor ); DrawPixel( rPts ); Pop(); }
-
- void DrawLine( const Point& rStartPt, const Point& rEndPt );
- void DrawLine( const Point& rStartPt, const Point& rEndPt,
- const LineInfo& rLineInfo );
- void DrawPolyLine( const Polygon& rPoly );
- void DrawPolyLine( const Polygon& rPoly,
- const LineInfo& rLineInfo );
- void DrawPolyLine( const Polygon& rPoly, const ExtLineInfo& rInfo );
- void DrawPolygon( const Polygon& rPoly );
- void DrawPolyPolygon( const PolyPolygon& rPolyPoly );
- void DrawRect( const Rectangle& rRect );
- void DrawRect( const Rectangle& rRect,
- sal_uLong nHorzRount, sal_uLong nVertRound );
- void DrawEllipse( const Rectangle& rRect );
- void DrawArc( const Rectangle& rRect,
- const Point& rStartPt, const Point& rEndPt );
- void DrawPie( const Rectangle& rRect,
- const Point& rStartPt, const Point& rEndPt );
- void DrawChord( const Rectangle& rRect,
- const Point& rStartPt, const Point& rEndPt );
-
- void DrawBitmap( const Point& rDestPt,
- const Bitmap& rBitmap );
- void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
- const Bitmap& rBitmap );
- void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
- const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const Bitmap& rBitmap );
-
- void DrawBitmapEx( const Point& rDestPt,
- const BitmapEx& rBitmapEx );
- void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
- const BitmapEx& rBitmapEx );
- void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
- const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const BitmapEx& rBitmapEx );
-
- void DrawMask( const Point& rDestPt,
- const Bitmap& rBitmap, const Color& rMaskColor );
- void DrawMask( const Point& rDestPt, const Size& rDestSize,
- const Bitmap& rBitmap, const Color& rMaskColor );
- void DrawMask( const Point& rDestPt, const Size& rDestSize,
- const Point& rSrcPtPixel, const Size& rSrcSizePixel,
- const Bitmap& rBitmap, const Color& rMaskColor );
-
- void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
- void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
-
- void DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
-
- void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
- void DrawTransparent( const PolyPolygon& rPolyPoly,
- sal_uInt16 nTransparencePercent );
-
- /** Start a transparency group
-
- Drawing operations can be grouped together to acquire a common transparency
- behaviour; after calling <code>BeginTransparencyGroup</code> all drawing
- operations will be grouped together into a transparent object.
-
- The transparency behaviour is set with ond of the <code>EndTransparencyGroup</code>
- calls and can be either a constant transparency factor or a transparent
- soft mask in form of an 8 bit gray scale bitmap.
-
- It is permissible to nest transparency group.
-
- Transparency groups MUST NOT span multiple pages
-
- Transparency is a feature introduced in PDF1.4, so transparency group
- will be ignored if the produced PDF has a lower version. The drawing
- operations will be emitted normally.
- */
- void BeginTransparencyGroup();
-
- /** End a transparency group with constant transparency factor
-
- This ends a transparency group and inserts it on the current page. The
- coordinates of the group result out of the grouped drawing operations.
-
- @param rBoundRect
- The bounding rectangle of the group
-
- @param nTransparencePercent
- The transparency factor
- */
- void EndTransparencyGroup( const Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
-
- /** End a transparency group with an alpha mask
-
- This ends a transparency group and inserts it on the current page. The
- coordinates of the group result out of the grouped drawing operations.
-
- @param rBoundRect
- The bounding rectangle of the group
-
- @param rAlphaMask
- The transparency mask; must be an 8 bit grayscale image
- */
- void EndTransparencyGroup( const Rectangle& rBoundRect, const Bitmap& rAlphaMask );
-
- /** Insert a JPG encoded image (optionally with mask)
-
- @param rJPGData
- a Stream containing the encoded image
-
- @param bIsTrueColor
- true: jpeg is 24 bit true color, false: jpeg is 8 bit greyscale
-
- @param rSrcSizePixel
- size in pixel of the image
-
- @param rTargetArea
- where to put the image
-
- @param rMask
- optional mask; if not empty it must have
- the same pixel size as the image and
- be either 1 bit black&white or 8 bit grey
- */
- void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask );
+ ColorMode( PDFWriter::DrawColor )
+ {}
+ };
- /** Create a new named destination to be used in a link from another PDF document
+ PDFWriter( const PDFWriterContext& rContext, const com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >& );
+ ~PDFWriter();
+
+ /** Returns an OutputDevice for formatting
+ <p>This Output device is guaranteed to use the same
+ font metrics as the resulting PDF file.</p>
+
+ @returns
+ the reference output device
+ */
+ OutputDevice* GetReferenceDevice();
+
+ /** Creates a new page to fill
+ <p>If width and height are not set the page size
+ is inherited from the page tree</p>
+ <p>other effects:
+ resets the graphics state: MapMode, Font
+ Colors and other state information MUST
+ be set again or are undefined.
+ </p>
+
+ @returns
+ returns the page id of the new page
+ */
+ sal_Int32 NewPage( sal_Int32 nPageWidth = 0, sal_Int32 nPageHeight = 0, Orientation eOrientation = Inherit );
+ /** Play a metafile like an outputdevice would do
+ */
+ struct PlayMetafileContext
+ {
+ int m_nMaxImageResolution;
+ bool m_bOnlyLosslessCompression;
+ int m_nJPEGQuality;
+ bool m_bTransparenciesWereRemoved;
+
+ PlayMetafileContext()
+ : m_nMaxImageResolution( 0 )
+ , m_bOnlyLosslessCompression( false )
+ , m_nJPEGQuality( 90 )
+ , m_bTransparenciesWereRemoved( false )
+ {}
- @parm sDestName
- the name (label) of the bookmark, to be used to jump to
+ };
+ void PlayMetafile( const GDIMetaFile&, const PlayMetafileContext&, vcl::PDFExtOutDevData* pDevDat = NULL );
+
+ /* sets the document locale originally passed with the context to a new value
+ * only affects the output if used before calling <code>Emit/code>.
+ */
+ void SetDocumentLocale( const com::sun::star::lang::Locale& rDocLocale );
+
+ /* finishes the file */
+ bool Emit();
+
+ /*
+ * Get a list of errors that occurred during processing
+ * this should enable the producer to give feedback about
+ * any anomalies that might have occurred
+ */
+ std::set< ErrorCode > GetErrors();
+
+ PDFVersion GetVersion() const;
+
+ static com::sun::star::uno::Reference< com::sun::star::beans::XMaterialHolder >
+ InitEncryption( const rtl::OUString& i_rOwnerPassword,
+ const rtl::OUString& i_rUserPassword,
+ bool b128Bit
+ );
+
+ /* functions for graphics state */
+ /* flag values: see vcl/outdev.hxx */
+ void Push( sal_uInt16 nFlags = 0xffff );
+ void Pop();
+
+ void SetClipRegion();
+ void SetClipRegion( const basegfx::B2DPolyPolygon& rRegion );
+ void MoveClipRegion( long nHorzMove, long nVertMove );
+ void IntersectClipRegion( const Rectangle& rRect );
+ void IntersectClipRegion( const basegfx::B2DPolyPolygon& rRegion );
+
+ void SetAntialiasing( sal_uInt16 nMode = 0 );
+
+ void SetLayoutMode( sal_uLong nMode );
+ void SetDigitLanguage( LanguageType eLang );
+
+ void SetLineColor( const Color& rColor );
+ void SetLineColor() { SetLineColor( Color( COL_TRANSPARENT ) ); }
+
+ void SetFillColor( const Color& rColor );
+ void SetFillColor() { SetFillColor( Color( COL_TRANSPARENT ) ); }
+
+ void SetFont( const Font& rNewFont );
+ void SetTextColor( const Color& rColor );
+ void SetTextFillColor();
+ void SetTextFillColor( const Color& rColor );
+
+ void SetTextLineColor();
+ void SetTextLineColor( const Color& rColor );
+ void SetOverlineColor();
+ void SetOverlineColor( const Color& rColor );
+ void SetTextAlign( ::TextAlign eAlign );
+
+ void SetMapMode();
+ void SetMapMode( const MapMode& rNewMapMode );
+
+
+ /* actual drawing functions */
+ void DrawText( const Point& rPos, const String& rText );
+
+ void DrawTextLine( const Point& rPos, long nWidth,
+ FontStrikeout eStrikeout,
+ FontUnderline eUnderline,
+ FontUnderline eOverline,
+ sal_Bool bUnderlineAbove = sal_False );
+ void DrawTextArray( const Point& rStartPt, const XubString& rStr,
+ const sal_Int32* pDXAry = NULL,
+ xub_StrLen nIndex = 0,
+ xub_StrLen nLen = STRING_LEN );
+ void DrawStretchText( const Point& rStartPt, sal_uLong nWidth,
+ const XubString& rStr,
+ xub_StrLen nIndex = 0, xub_StrLen nLen = STRING_LEN );
+ void DrawText( const Rectangle& rRect,
+ const XubString& rStr, sal_uInt16 nStyle = 0 );
+
+ void DrawPixel( const Point& rPt, const Color& rColor );
+ void DrawPixel( const Point& rPt )
+ { DrawPixel( rPt, Color( COL_TRANSPARENT ) ); }
+ void DrawPixel( const Polygon& rPts, const Color* pColors = NULL );
+ void DrawPixel( const Polygon& rPts, const Color& rColor )
+ { Push(); SetLineColor( rColor ); DrawPixel( rPts ); Pop(); }
+
+ void DrawLine( const Point& rStartPt, const Point& rEndPt );
+ void DrawLine( const Point& rStartPt, const Point& rEndPt,
+ const LineInfo& rLineInfo );
+ void DrawPolyLine( const Polygon& rPoly );
+ void DrawPolyLine( const Polygon& rPoly,
+ const LineInfo& rLineInfo );
+ void DrawPolyLine( const Polygon& rPoly, const ExtLineInfo& rInfo );
+ void DrawPolygon( const Polygon& rPoly );
+ void DrawPolyPolygon( const PolyPolygon& rPolyPoly );
+ void DrawRect( const Rectangle& rRect );
+ void DrawRect( const Rectangle& rRect,
+ sal_uLong nHorzRount, sal_uLong nVertRound );
+ void DrawEllipse( const Rectangle& rRect );
+ void DrawArc( const Rectangle& rRect,
+ const Point& rStartPt, const Point& rEndPt );
+ void DrawPie( const Rectangle& rRect,
+ const Point& rStartPt, const Point& rEndPt );
+ void DrawChord( const Rectangle& rRect,
+ const Point& rStartPt, const Point& rEndPt );
+
+ void DrawBitmap( const Point& rDestPt,
+ const Bitmap& rBitmap );
+ void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
+ const Bitmap& rBitmap );
+ void DrawBitmap( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ const Bitmap& rBitmap );
+
+ void DrawBitmapEx( const Point& rDestPt,
+ const BitmapEx& rBitmapEx );
+ void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+ const BitmapEx& rBitmapEx );
+ void DrawBitmapEx( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ const BitmapEx& rBitmapEx );
+
+ void DrawMask( const Point& rDestPt,
+ const Bitmap& rBitmap, const Color& rMaskColor );
+ void DrawMask( const Point& rDestPt, const Size& rDestSize,
+ const Bitmap& rBitmap, const Color& rMaskColor );
+ void DrawMask( const Point& rDestPt, const Size& rDestSize,
+ const Point& rSrcPtPixel, const Size& rSrcSizePixel,
+ const Bitmap& rBitmap, const Color& rMaskColor );
+
+ void DrawGradient( const Rectangle& rRect, const Gradient& rGradient );
+ void DrawGradient( const PolyPolygon& rPolyPoly, const Gradient& rGradient );
+
+ void DrawHatch( const PolyPolygon& rPolyPoly, const Hatch& rHatch );
+
+ void DrawWallpaper( const Rectangle& rRect, const Wallpaper& rWallpaper );
+ void DrawTransparent( const PolyPolygon& rPolyPoly,
+ sal_uInt16 nTransparencePercent );
+
+ /** Start a transparency group
+
+ Drawing operations can be grouped together to acquire a common transparency
+ behavior; after calling <code>BeginTransparencyGroup</code> all drawing
+ operations will be grouped together into a transparent object.
+
+ The transparency behavior is set with ond of the <code>EndTransparencyGroup</code>
+ calls and can be either a constant transparency factor or a transparent
+ soft mask in form of an 8 bit gray scale bitmap.
+
+ It is permissible to nest transparency group.
+
+ Transparency groups MUST NOT span multiple pages
+
+ Transparency is a feature introduced in PDF 1.4, so transparency group
+ will be ignored if the produced PDF has a lower version. The drawing
+ operations will be emitted normally.
+ */
+ void BeginTransparencyGroup();
+
+ /** End a transparency group with constant transparency factor
+
+ This ends a transparency group and inserts it on the current page. The
+ coordinates of the group result out of the grouped drawing operations.
+
+ @param rBoundRect
+ The bounding rectangle of the group
+
+ @param nTransparencePercent
+ The transparency factor
+ */
+ void EndTransparencyGroup( const Rectangle& rBoundRect, sal_uInt16 nTransparencePercent );
+
+ /** End a transparency group with an alpha mask
+
+ This ends a transparency group and inserts it on the current page. The
+ coordinates of the group result out of the grouped drawing operations.
+
+ @param rBoundRect
+ The bounding rectangle of the group
+
+ @param rAlphaMask
+ The transparency mask; must be an 8 bit grayscale image
+ */
+ void EndTransparencyGroup( const Rectangle& rBoundRect, const Bitmap& rAlphaMask );
+
+ /** Insert a JPG encoded image (optionally with mask)
+
+ @param rJPGData
+ a Stream containing the encoded image
+
+ @param bIsTrueColor
+ true: jpeg is 24 bit true color, false: jpeg is 8 bit grayscale
+
+ @param rSrcSizePixel
+ size in pixel of the image
+
+ @param rTargetArea
+ where to put the image
+
+ @param rMask
+ optional mask; if not empty it must have
+ the same pixel size as the image and
+ be either 1 bit black&white or 8 bit gray
+ */
+ void DrawJPGBitmap( SvStream& rJPGData, bool bIsTrueColor, const Size& rSrcSizePixel, const Rectangle& rTargetArea, const Bitmap& rMask );
+
+ /** Create a new named destination to be used in a link from another PDF document
- @param rRect
- target rectangle on page to be displayed if dest is jumped to
+ @parm sDestName
+ the name (label) of the bookmark, to be used to jump to
- @param nPageNr
- number of page the dest is on (as returned by NewPage)
- or -1 in which case the current page is used
-
- @param eType
- what dest type to use
-
- @returns
- the destination id (to be used in SetLinkDest) or
- -1 if page id does not exist
- */
- sal_Int32 CreateNamedDest( const rtl::OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
- /** Create a new destination to be used in a link
-
- @param rRect
- target rectangle on page to be displayed if dest is jumped to
-
- @param nPageNr
- number of page the dest is on (as returned by NewPage)
- or -1 in which case the current page is used
-
- @param eType
- what dest type to use
-
- @returns
- the destination id (to be used in SetLinkDest) or
- -1 if page id does not exist
- */
- sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
- /** Create a new link on a page
-
- @param rRect
- active rectangle of the link (that is the area that has to be
- hit to activate the link)
-
- @param nPageNr
- number of page the link is on (as returned by NewPage)
- or -1 in which case the current page is used
-
- @returns
- the link id (to be used in SetLinkDest, SetLinkURL) or
- -1 if page id does not exist
- */
- sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 );
-
- /** creates a destination which is not intended to be referred to by a link, but by a public destination Id.
-
- Form widgets, for instance, might refer to a destination, without ever actually creating a source link to
- point to this destination. In such cases, a public destination Id will be assigned to the form widget,
- and later on, the concrete destination data for this public Id will be registered using RegisterDestReference.
-
- @param rRect
- target rectangle on page to be displayed if dest is jumped to
-
- @param nPageNr
- number of page the dest is on (as returned by NewPage)
- or -1 in which case the current page is used
-
- @param eType
- what dest type to use
-
- @returns
- the internal destination Id.
- */
- sal_Int32 RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
-
-
- /** Set the destination for a link
- <p>will change a URL type link to a dest link if necessary</p>
-
- @param nLinkId
- the link to be changed
-
- @param nDestId
- the dest the link shall point to
- @returns
- 0 for success
- -1 in case the link id does not exist
- -2 in case the dest id does not exist
- */
- sal_Int32 SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
- /** Set the URL for a link
- <p>will change a dest type link to an URL type link if necessary</p>
- @param nLinkId
- the link to be changed
-
- @param rURL
- the URL the link shall point to.
- The URL will be parsed (and corrected) by the <code>com.sun.star.util.URLTransformer</code>
- service; the result will then appear literally in the PDF file produced
-
- @returns
- 0 for success
- -1 in case the link id does not exist
- */
- sal_Int32 SetLinkURL( sal_Int32 nLinkId, const rtl::OUString& rURL );
- /** Resolve link in logical structure
- <p>
- If a link is created after the corresponding visual appearance was drawn
- it is not possible to set the link id as a property attribute to the
- link structure item that should be created in tagged PDF around the
- visual appearance of a link.
- </p>
- <p>
- For this reason an arbitrary id can be given to
- <code>SetStructureAttributeNumerical</code> at the time the text for
- the link is drawn. To resolve this arbitrary id again when the actual
- link annotation is created use SetLinkPropertyID. When <code>Emit</code>
- finally gets called all <code>LinkAnnotation</code> type structure attributes
- will be replaced with the correct link id.
- </p>
- <p>
- CAUTION: this technique must be used either for all or none of the links
- in a document since the link id space and arbitrary property id space
- could overlap and it would be impossible to resolve whether a <code>Link</code>
- structure attribute value was arbitrary or already a real id.
- </p>
-
- @param nLinkId
- the link to be mapped
-
- @param nPropertyID
- the arbitrary id set in a <code>Link</code> structure element to address
- the link with real id <code>nLinkId</code>
- */
- void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
- /** Create a new outline item
-
- @param nParent
- declares the parent of the new item in the outline hierarchy.
- An invalid value will result in a new toplevel item.
-
- @param rText
- sets the title text of the item
-
- @param nDestId
- declares which Dest (created with CreateDest) the outline item
- will point to
-
- @returns
- the outline item id of the new item
- */
- sal_Int32 CreateOutlineItem( sal_Int32 nParent = 0, const rtl::OUString& rText = rtl::OUString(), sal_Int32 nDestID = -1 );
-
- /** Set an outline item's parent
-
- @param nItem
- specififies which item should be reparented.
-
- @param nNewParent
- specifies which outline item will be the item's new parent.
- Use 0 for reparenting to top level.
-
- @returns
- -1 if the item does not exist
- -2 if the new parent does not exist, item will be reparented to top level.
- */
- sal_Int32 SetOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent );
-
- /** Set an outline item's title text
-
- @param nItem
- specififies which item should get a new text
-
- @param rText
- sets the title text of the item
-
- @returns
- 0 if the item exists and the text was changed
- -1 if the item does not exist
- */
- sal_Int32 SetOutlineItemText( sal_Int32 nItem, const rtl::OUString& rText );
-
- /** Set an outline item's destination
-
- @param nItem
- specififies which item should get a new dest
-
- @param nDestID
- specifies the item's new destination
-
- @returns
- -1 if the item does not exist
- -2 if the new dest does not exist, dest will remain unchanged
- */
- sal_Int32 SetOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID );
-
- /** Create a new note on a page
-
- @param rRect
- active rectangle of the note (that is the area that has to be
- hit to popup the annotation)
-
- @param rNote
- specifies the contents of the note
-
- @param nPageNr
- number of page the note is on (as returned by NewPage)
- or -1 in which case the current page is used
- */
- void CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
-
- /** begin a new logical structure element
-
- <p>
- BeginStructureElement/EndStructureElement calls build the logical structure
- of the PDF - the basis for tagged PDF. Structural elements are implemented
- using marked content tags. Each structural element can contain sub elements
- (e.g. a section can contain a heading and a paragraph). The structure hierarchy
- is build automatically from the Begin/EndStructureElement calls.
-
- A structural element need not be contained on one page; e.g. paragraphs often
- run from one page to the next. In this case the corresponding EndStructureElement
- must be called while drawing the next page.
- </p>
-
- <p>
- BeginStructureElement and EndStructureElement must be called only after
- <member scope="vcl">PDFWriter::NewPage</member> has been called and before
- <member scope="vcl">PDFWriter::Emit</member>gets called. The current page
- number is an implicit context parameter for Begin/EndStructureElement.
- </p>
-
- <p>
- For pagination artifacts that are not part of the logical structure
- of the document (like header, footer or page number) the special
- StructElement <code>NonStructElement</code> exists. To place content
- outside of the struture tree simply call
- <code>BeginStructureElement( NonStructElement )</code> then draw your
- content and then call <code>EndStructureElement()</code>. All children
- of a <code>NonStructElement</code> will not be part of the structure.
- Nonetheless if you add a child structural element to a
- <code>NonStructElement</code> you will still have to call
- <code>EndStructureElement</code> for it. Best think of the structure
- tree as a stack.
- </p>
-
- <p>
- Note: there is always one structural element in existence without having
- called <code>BeginStructureElement</code>; this is the root of the structure
- tree (called StructTreeRoot). The StructTreeRoot has always the id 0.
- </p>
-
- @param eType
- denotes what kind of element to begin (e.g. a heading or paragraph)
-
- @param rAlias
- the specified alias will be used as structure tag. Also an entry in the PDF's
- role map will be created mapping alias to regular structure type.
-
- @returns
- the new structure element's id for use in <code>SetCurrentStructureElement</code>
- */
- sal_Int32 BeginStructureElement( enum StructElement eType, const rtl::OUString& rAlias = rtl::OUString() );
- /** end the current logical structure element
-
- <p>
- Close the current structure element. The current element's
- parent becomes the current structure element again.
- </p>
-
- @see BeginStructureElement
- */
- void EndStructureElement();
- /** set the current structure element
-
- <p>
- For different purposes it may be useful to paint a structure element's
- content discontinously. In that case an already existing structure element
- can be appended to by using <code>SetCurrentStructureElement</code>. The
- refenrenced structure element becomes the current structure element with
- all consequences: all following structure elements are appended as children
- of the current element.
- </p>
-
- @param nElement
- the id of the new current structure element
-
- @returns
- <true/> if the current structure element could be set successfully
- <false/> if the current structure element could not be changed
- (e.g. if the passed element id is invalid)
- */
- bool SetCurrentStructureElement( sal_Int32 nElement );
- /** get the current structure element's id
-
- @returns
- the id of the current structure element or -1 if no structure exists
- (e.g. if no tagged PDF is being produced)
- */
- sal_Int32 GetCurrentStructureElement();
-
- /** set a structure attribute on the current structural element
-
- SetStructureAttribute sets an attribute of the current structural element to a
- new value. A consistency check is performed before actually setting the value;
- if the check fails, the function returns <FALSE/> and the attribute remains
- unchanged.
-
- @param eAttr
- denotes what attribute to change
-
- @param eVal
- the value to set the attribute to
-
- @returns
- <TRUE/> if the value was valid and the change has been performed,
- <FALSE/> if the attribute or value was invalid; attribute remains unchanged
- */
- bool SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal );
- /** set a structure attribute on the current structural element
-
- SetStructureAttributeNumerical sets an attribute of the current structural element
- to a new numerical value. A consistency check is performed before actually setting
- the value; if the check fails, the function returns <FALSE/> and the attribute
- remains unchanged.
-
- @param eAttr
- denotes what attribute to change
-
- @param nValue
- the value to set the attribute to
-
- @returns
- <TRUE/> if the value was valid and the change has been performed,
- <FALSE/> if the attribute or value was invalid; attribute remains unchanged
- */
- bool SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue );
- /** set the bounding box of a structural element
-
- SetStructureBoundingBox sets the BBox attribute to a new value. Since the BBox
- attribute can only be applied to <code>Table</code>, <code>Figure</code>,
- <code>Form</code> and <code>Formula</code> elements, a call of this function
- for other element types will be ignored and the BBox attribute not be set.
-
- @param rRect
- the new bounding box for the structural element
- */
- void SetStructureBoundingBox( const Rectangle& rRect );
-
- /** set the ActualText attribute of a structural element
-
- ActualText contains the Unicode text without layout artifacts that is shown by
- a structural element. For example if a line is ended prematurely with a break in
- a word and continued on the next line (e.g. "happen-<newline>stance") the
- corresponding ActualText would contain the unbroken line (e.g. "happenstance").
-
- @param rText
- contains the complete logical text the structural element displays.
- */
- void SetActualText( const String& rText );
-
- /** set the Alt attribute of a strutural element
-
- Alt is s replacement text describing the contents of a structural element. This
- is mainly used by accessibility applications; e.g. a screen reader would read
- the Alt replacement text for an image to a visually impaired user.
-
- @param rText
- contains the replacement text for the structural element
- */
- void SetAlternateText( const String& rText );
-
- /** Sets the time in seconds a page will appear before the next
- page is shown automatically
-
- @param nSeconds
- time in seconds the current page will be shown; pass 0 for manual advancement
-
- @param nPageNr
- the page number to apply the autoadvance time to; -1 denotes the current page
- */
- void SetAutoAdvanceTime( sal_uInt32 nSeconds, sal_Int32 nPageNr = -1 );
+ @param rRect
+ target rectangle on page to be displayed if dest is jumped to
- /** Sets the transitional effect to be applied when the current page gets shown.
-
- @param eType
- the kind of effect to be used; use Regular to disable transitional effects
- for this page
-
- @param nMilliSec
- the duration of the transitional effect in milliseconds;
- set 0 to disable transitional effects
+ @param nPageNr
+ number of page the dest is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @param eType
+ what dest type to use
+
+ @returns
+ the destination id (to be used in SetLinkDest) or
+ -1 if page id does not exist
+ */
+ sal_Int32 CreateNamedDest( const rtl::OUString& sDestName, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
+ /** Create a new destination to be used in a link
+
+ @param rRect
+ target rectangle on page to be displayed if dest is jumped to
+
+ @param nPageNr
+ number of page the dest is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @param eType
+ what dest type to use
+
+ @returns
+ the destination id (to be used in SetLinkDest) or
+ -1 if page id does not exist
+ */
+ sal_Int32 CreateDest( const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
+ /** Create a new link on a page
+
+ @param rRect
+ active rectangle of the link (that is the area that has to be
+ hit to activate the link)
+
+ @param nPageNr
+ number of page the link is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @returns
+ the link id (to be used in SetLinkDest, SetLinkURL) or
+ -1 if page id does not exist
+ */
+ sal_Int32 CreateLink( const Rectangle& rRect, sal_Int32 nPageNr = -1 );
+
+ /** creates a destination which is not intended to be referred to by a link, but by a public destination Id.
+
+ Form widgets, for instance, might refer to a destination, without ever actually creating a source link to
+ point to this destination. In such cases, a public destination Id will be assigned to the form widget,
+ and later on, the concrete destination data for this public Id will be registered using RegisterDestReference.
+
+ @param rRect
+ target rectangle on page to be displayed if dest is jumped to
+
+ @param nPageNr
+ number of page the dest is on (as returned by NewPage)
+ or -1 in which case the current page is used
+
+ @param eType
+ what dest type to use
+
+ @returns
+ the internal destination Id.
+ */
+ sal_Int32 RegisterDestReference( sal_Int32 nDestId, const Rectangle& rRect, sal_Int32 nPageNr = -1, DestAreaType eType = XYZ );
+
+
+ /** Set the destination for a link
+ <p>will change a URL type link to a dest link if necessary</p>
+
+ @param nLinkId
+ the link to be changed
+
+ @param nDestId
+ the dest the link shall point to
+ @returns
+ 0 for success
+ -1 in case the link id does not exist
+ -2 in case the dest id does not exist
+ */
+ sal_Int32 SetLinkDest( sal_Int32 nLinkId, sal_Int32 nDestId );
+ /** Set the URL for a link
+ <p>will change a dest type link to an URL type link if necessary</p>
+ @param nLinkId
+ the link to be changed
+
+ @param rURL
+ the URL the link shall point to.
+ The URL will be parsed (and corrected) by the <code>com.sun.star.util.URLTransformer</code>
+ service; the result will then appear literally in the PDF file produced
+
+ @returns
+ 0 for success
+ -1 in case the link id does not exist
+ */
+ sal_Int32 SetLinkURL( sal_Int32 nLinkId, const rtl::OUString& rURL );
+ /** Resolve link in logical structure
+ <p>
+ If a link is created after the corresponding visual appearance was drawn
+ it is not possible to set the link id as a property attribute to the
+ link structure item that should be created in tagged PDF around the
+ visual appearance of a link.
+ </p>
+ <p>
+ For this reason an arbitrary id can be given to
+ <code>SetStructureAttributeNumerical</code> at the time the text for
+ the link is drawn. To resolve this arbitrary id again when the actual
+ link annotation is created use SetLinkPropertyID. When <code>Emit</code>
+ finally gets called all <code>LinkAnnotation</code> type structure attributes
+ will be replaced with the correct link id.
+ </p>
+ <p>
+ CAUTION: this technique must be used either for all or none of the links
+ in a document since the link id space and arbitrary property id space
+ could overlap and it would be impossible to resolve whether a <code>Link</code>
+ structure attribute value was arbitrary or already a real id.
+ </p>
+
+ @param nLinkId
+ the link to be mapped
+
+ @param nPropertyID
+ the arbitrary id set in a <code>Link</code> structure element to address
+ the link with real id <code>nLinkId</code>
+ */
+ void SetLinkPropertyID( sal_Int32 nLinkId, sal_Int32 nPropertyID );
+ /** Create a new outline item
+
+ @param nParent
+ declares the parent of the new item in the outline hierarchy.
+ An invalid value will result in a new toplevel item.
+
+ @param rText
+ sets the title text of the item
+
+ @param nDestId
+ declares which Dest (created with CreateDest) the outline item
+ will point to
+
+ @returns
+ the outline item id of the new item
+ */
+ sal_Int32 CreateOutlineItem( sal_Int32 nParent = 0, const rtl::OUString& rText = rtl::OUString(), sal_Int32 nDestID = -1 );
+
+ /** Set an outline item's parent
+
+ @param nItem
+ specififies which item should be reparented.
+
+ @param nNewParent
+ specifies which outline item will be the item's new parent.
+ Use 0 for reparenting to top level.
+
+ @returns
+ -1 if the item does not exist
+ -2 if the new parent does not exist, item will be reparented to top level.
+ */
+ sal_Int32 SetOutlineItemParent( sal_Int32 nItem, sal_Int32 nNewParent );
+
+ /** Set an outline item's title text
+
+ @param nItem
+ specififies which item should get a new text
+
+ @param rText
+ sets the title text of the item
+
+ @returns
+ 0 if the item exists and the text was changed
+ -1 if the item does not exist
+ */
+ sal_Int32 SetOutlineItemText( sal_Int32 nItem, const rtl::OUString& rText );
+
+ /** Set an outline item's destination
+
+ @param nItem
+ specififies which item should get a new dest
+
+ @param nDestID
+ specifies the item's new destination
+
+ @returns
+ -1 if the item does not exist
+ -2 if the new dest does not exist, dest will remain unchanged
+ */
+ sal_Int32 SetOutlineItemDest( sal_Int32 nItem, sal_Int32 nDestID );
+
+ /** Create a new note on a page
+
+ @param rRect
+ active rectangle of the note (that is the area that has to be
+ hit to popup the annotation)
+
+ @param rNote
+ specifies the contents of the note
+
+ @param nPageNr
+ number of page the note is on (as returned by NewPage)
+ or -1 in which case the current page is used
+ */
+ void CreateNote( const Rectangle& rRect, const PDFNote& rNote, sal_Int32 nPageNr = -1 );
+
+ /** begin a new logical structure element
+
+ <p>
+ BeginStructureElement/EndStructureElement calls build the logical structure
+ of the PDF - the basis for tagged PDF. Structural elements are implemented
+ using marked content tags. Each structural element can contain sub elements
+ (e.g. a section can contain a heading and a paragraph). The structure hierarchy
+ is build automatically from the Begin/EndStructureElement calls.
+
+ A structural element need not be contained on one page; e.g. paragraphs often
+ run from one page to the next. In this case the corresponding EndStructureElement
+ must be called while drawing the next page.
+ </p>
+
+ <p>
+ BeginStructureElement and EndStructureElement must be called only after
+ <member scope="vcl">PDFWriter::NewPage</member> has been called and before
+ <member scope="vcl">PDFWriter::Emit</member>gets called. The current page
+ number is an implicit context parameter for Begin/EndStructureElement.
+ </p>
+
+ <p>
+ For pagination artifacts that are not part of the logical structure
+ of the document (like header, footer or page number) the special
+ StructElement <code>NonStructElement</code> exists. To place content
+ outside of the struture tree simply call
+ <code>BeginStructureElement( NonStructElement )</code> then draw your
+ content and then call <code>EndStructureElement()</code>. All children
+ of a <code>NonStructElement</code> will not be part of the structure.
+ Nonetheless if you add a child structural element to a
+ <code>NonStructElement</code> you will still have to call
+ <code>EndStructureElement</code> for it. Best think of the structure
+ tree as a stack.
+ </p>
+
+ <p>
+ Note: there is always one structural element in existence without having
+ called <code>BeginStructureElement</code>; this is the root of the structure
+ tree (called StructTreeRoot). The StructTreeRoot has always the id 0.
+ </p>
+
+ @param eType
+ denotes what kind of element to begin (e.g. a heading or paragraph)
+
+ @param rAlias
+ the specified alias will be used as structure tag. Also an entry in the PDF's
+ role map will be created mapping alias to regular structure type.
+
+ @returns
+ the new structure element's id for use in <code>SetCurrentStructureElement</code>
+ */
+ sal_Int32 BeginStructureElement( enum StructElement eType, const rtl::OUString& rAlias = rtl::OUString() );
+ /** end the current logical structure element
+
+ <p>
+ Close the current structure element. The current element's
+ parent becomes the current structure element again.
+ </p>
+
+ @see BeginStructureElement
+ */
+ void EndStructureElement();
+ /** set the current structure element
+
+ <p>
+ For different purposes it may be useful to paint a structure element's
+ content discontinuously. In that case an already existing structure element
+ can be appended to by using <code>SetCurrentStructureElement</code>. The
+ referenced structure element becomes the current structure element with
+ all consequences: all following structure elements are appended as children
+ of the current element.
+ </p>
+
+ @param nElement
+ the id of the new current structure element
+
+ @returns
+ <true/> if the current structure element could be set successfully
+ <false/> if the current structure element could not be changed
+ (e.g. if the passed element id is invalid)
+ */
+ bool SetCurrentStructureElement( sal_Int32 nElement );
+ /** get the current structure element's id
+
+ @returns
+ the id of the current structure element or -1 if no structure exists
+ (e.g. if no tagged PDF is being produced)
+ */
+ sal_Int32 GetCurrentStructureElement();
+
+ /** set a structure attribute on the current structural element
+
+ SetStructureAttribute sets an attribute of the current structural element to a
+ new value. A consistency check is performed before actually setting the value;
+ if the check fails, the function returns <FALSE/> and the attribute remains
+ unchanged.
+
+ @param eAttr
+ denotes what attribute to change
+
+ @param eVal
+ the value to set the attribute to
+
+ @returns
+ <TRUE/> if the value was valid and the change has been performed,
+ <FALSE/> if the attribute or value was invalid; attribute remains unchanged
+ */
+ bool SetStructureAttribute( enum StructAttribute eAttr, enum StructAttributeValue eVal );
+ /** set a structure attribute on the current structural element
+
+ SetStructureAttributeNumerical sets an attribute of the current structural element
+ to a new numerical value. A consistency check is performed before actually setting
+ the value; if the check fails, the function returns <FALSE/> and the attribute
+ remains unchanged.
+
+ @param eAttr
+ denotes what attribute to change
+
+ @param nValue
+ the value to set the attribute to
+
+ @returns
+ <TRUE/> if the value was valid and the change has been performed,
+ <FALSE/> if the attribute or value was invalid; attribute remains unchanged
+ */
+ bool SetStructureAttributeNumerical( enum StructAttribute eAttr, sal_Int32 nValue );
+ /** set the bounding box of a structural element
+
+ SetStructureBoundingBox sets the BBox attribute to a new value. Since the BBox
+ attribute can only be applied to <code>Table</code>, <code>Figure</code>,
+ <code>Form</code> and <code>Formula</code> elements, a call of this function
+ for other element types will be ignored and the BBox attribute not be set.
+
+ @param rRect
+ the new bounding box for the structural element
+ */
+ void SetStructureBoundingBox( const Rectangle& rRect );
+
+ /** set the ActualText attribute of a structural element
+
+ ActualText contains the Unicode text without layout artifacts that is shown by
+ a structural element. For example if a line is ended prematurely with a break in
+ a word and continued on the next line (e.g. "happen-<newline>stance") the
+ corresponding ActualText would contain the unbroken line (e.g. "happenstance").
+
+ @param rText
+ contains the complete logical text the structural element displays.
+ */
+ void SetActualText( const String& rText );
+
+ /** set the Alt attribute of a strutural element
+
+ Alt is s replacement text describing the contents of a structural element. This
+ is mainly used by accessibility applications; e.g. a screen reader would read
+ the Alt replacement text for an image to a visually impaired user.
+
+ @param rText
+ contains the replacement text for the structural element
+ */
+ void SetAlternateText( const String& rText );
+
+ /** Sets the time in seconds a page will appear before the next
+ page is shown automatically
+
+ @param nSeconds
+ time in seconds the current page will be shown; pass 0 for manual advancement
+
+ @param nPageNr
+ the page number to apply the autoadvance time to; -1 denotes the current page
+ */
+ void SetAutoAdvanceTime( sal_uInt32 nSeconds, sal_Int32 nPageNr = -1 );
- @param nPageNr
- the page number to apply the effect to; -1 denotes the current page
- */
- void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr = -1 );
+ /** Sets the transitional effect to be applied when the current page gets shown.
+
+ @param eType
+ the kind of effect to be used; use Regular to disable transitional effects
+ for this page
+
+ @param nMilliSec
+ the duration of the transitional effect in milliseconds;
+ set 0 to disable transitional effects
- /** create a new form control
+ @param nPageNr
+ the page number to apply the effect to; -1 denotes the current page
+ */
+ void SetPageTransition( PageTransition eType, sal_uInt32 nMilliSec, sal_Int32 nPageNr = -1 );
- This function creates a new form control in the PDF and sets its various
- properties. Do not pass an actual AnyWidget as <code>rControlType</code>
- will be cast to the type described by the type member.
+ /** create a new form control
- @param rControlType
- a descendant of <code>AnyWidget</code> determing the control's properties
+ This function creates a new form control in the PDF and sets its various
+ properties. Do not pass an actual AnyWidget as <code>rControlType</code>
+ will be cast to the type described by the type member.
- @returns
- the new control's id for reference purposes
- */
- sal_Int32 CreateControl( const AnyWidget& rControlType, sal_Int32 nPageNr = -1 );
+ @param rControlType
+ a descendant of <code>AnyWidget</code> determining the control's properties
- /** Inserts an additional stream to the PDF file
+ @returns
+ the new control's id for reference purposes
+ */
+ sal_Int32 CreateControl( const AnyWidget& rControlType, sal_Int32 nPageNr = -1 );
- This function adds an arbitrary stream to the produced PDF file. May be called
- any time before <code>Emit()</code>. The stream will be written during
- <code>Emit</code> by calling the <code>PDFOutputStream</code> Object's <code>write</code>
- method. After the call the <code>PDFOutputStream</code> will be deleted.
+ /** Inserts an additional stream to the PDF file
- All additional streams and their mimetypes will be entered into an array
- in the trailer dictionary.
+ This function adds an arbitrary stream to the produced PDF file. May be called
+ any time before <code>Emit()</code>. The stream will be written during
+ <code>Emit</code> by calling the <code>PDFOutputStream</code> Object's <code>write</code>
+ method. After the call the <code>PDFOutputStream</code> will be deleted.
- @param rMimeType
- the mimetype of the stream
+ All additional streams and their mimetypes will be entered into an array
+ in the trailer dictionary.
- @param rStream
- the interface to the additional stream
+ @param rMimeType
+ the mimetype of the stream
- @param bCompress
- specifies whether the stream should be flate encoded by PDFWriter or not
- */
- void AddStream( const String& rMimeType, PDFOutputStream* pStream, bool bCompress );
+ @param rStream
+ the interface to the additional stream
- /** create a new pattern for filling operations
+ @param bCompress
+ specifies whether the stream should be flate encoded by PDFWriter or not
+ */
+ void AddStream( const String& rMimeType, PDFOutputStream* pStream, bool bCompress );
- This function creates a new pattern to be used for subsequent filling operations.
- A pattern can consist of arbitrary drawing operations; all drawing operations
- between <code>BeingPattern()</code> and <code>EndPattern()</code> calls
- will be recorded and considered as forming up the pattern.
+ /** create a new pattern for filling operations
- @param rCellBounds
- a rectangle defining the "cell" that will be repeated to form the pattern
- */
- void BeginPattern( const Rectangle& );
- /** finish a new pattern for filling operations
+ This function creates a new pattern to be used for subsequent filling operations.
+ A pattern can consist of arbitrary drawing operations; all drawing operations
+ between <code>BeingPattern()</code> and <code>EndPattern()</code> calls
+ will be recorded and considered as forming up the pattern.
- This functions finishes the pattern create begun with <code>BeginPattern()</code>
- and returns a pattern id to be used in subsequent drawing operations.
+ @param rCellBounds
+ a rectangle defining the "cell" that will be repeated to form the pattern
+ */
+ void BeginPattern( const Rectangle& );
+ /** finish a new pattern for filling operations
- @param rMatrix
- a transformation to be imposed on the drawing operations that make up the pattern
+ This functions finishes the pattern create begun with <code>BeginPattern()</code>
+ and returns a pattern id to be used in subsequent drawing operations.
- @returns
- the new pattern's id
- */
- sal_Int32 EndPattern( const SvtGraphicFill::Transform& rTransformation );
- /** draw a polypolygon filled with a pattern
+ @param rMatrix
+ a transformation to be imposed on the drawing operations that make up the pattern
- @param rPolyPoly
- PolyPolygon to filled
+ @returns
+ the new pattern's id
+ */
+ sal_Int32 EndPattern( const SvtGraphicFill::Transform& rTransformation );
+ /** draw a polypolygon filled with a pattern
- @param nPatternId
- the pattern previously obtained in the <code>EndPattern</code> call.
+ @param rPolyPoly
+ PolyPolygon to filled
- @param bEOFill
- true: polypolygon gets filled with EvenOdd method,
- false: polypolygon gets filled with nonzero winding method
- */
- void DrawPolyPolygon( const PolyPolygon& rPolyPoly, sal_Int32 nPatternId, bool bEOFill );
+ @param nPatternId
+ the pattern previously obtained in the <code>EndPattern</code> call.
+
+ @param bEOFill
+ true: polypolygon gets filled with EvenOdd method,
+ false: polypolygon gets filled with nonzero winding method
+ */
+ void DrawPolyPolygon( const PolyPolygon& rPolyPoly, sal_Int32 nPatternId, bool bEOFill );
};
}
#endif // _VCL_PDFWRITER_HXX
+
+/* vim: set noet sw=4 ts=4: */
diff --git a/main/xmerge/java/xmerge/src/main/java/org/openoffice/xmerge/converter/palm/PalmDocument.java b/main/xmerge/java/xmerge/src/main/java/org/openoffice/xmerge/converter/palm/PalmDocument.java
index cd91061fc3..71cb122066 100644
--- a/main/xmerge/java/xmerge/src/main/java/org/openoffice/xmerge/converter/palm/PalmDocument.java
+++ b/main/xmerge/java/xmerge/src/main/java/org/openoffice/xmerge/converter/palm/PalmDocument.java
@@ -1,5 +1,5 @@
/**************************************************************
- *
+ *
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
@@ -7,16 +7,16 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
- *
+ *
*************************************************************/
@@ -33,8 +33,8 @@ import java.io.UnsupportedEncodingException;
import org.openoffice.xmerge.Document;
/**
- * <p> A <code>PalmDocument</code> is palm implementaion of the
- * <code>Docuemnt</code> interface.</p>
+ * <p> A <code>PalmDocument</code> is palm implementation of the
+ * <code>Document</code> interface.</p>
*
* <p>This implementation allows the Palm device format to be
* read via an <code>InputStream</code> and written via an
@@ -43,7 +43,7 @@ import org.openoffice.xmerge.Document;
* @author Martin Maher
*/
-public class PalmDocument
+public class PalmDocument
implements Document {
/**
@@ -84,7 +84,7 @@ public class PalmDocument
* @throws NullPointerException If <code>recs</code> is null.
*/
public PalmDocument(String name, int creatorID, int typeID, int version,
- short attribute, Record[] recs)
+ short attribute, Record[] recs)
throws UnsupportedEncodingException {
pdb = new PalmDB(name, creatorID, typeID, version, attribute, recs);
fileName = pdb.getPDBNameString();
@@ -98,7 +98,7 @@ public class PalmDocument
*
* @throws IOException If any I/O error occurs.
*/
-
+
public void read(InputStream is) throws IOException {
PdbDecoder decoder = new PdbDecoder();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
@@ -111,7 +111,7 @@ public class PalmDocument
pdb = decoder.parse(bytearr);
fileName = pdb.getPDBNameString();
}
-
+
/**
* Writes the <code>PalmDocument</code> to an <code>OutputStream</code>.
@@ -132,7 +132,7 @@ public class PalmDocument
* @return The <code>PalmDB</code>.
*/
public PalmDB getPdb() {
- return pdb;
+ return pdb;
}
@@ -143,21 +143,21 @@ public class PalmDocument
* @param pdb The new <code>PalmDB</code> value.
*/
public void setPdb(PalmDB pdb) {
- this.pdb = pdb;
+ this.pdb = pdb;
String name = pdb.getPDBNameString();
fileName = name;
}
-
+
/**
* Returns the name of the file.
- *
+ *
* @return The name of the file represented in the
* <code>PalmDocument</code>.
*/
public String getFileName() {
- return fileName + ".pdb";
+ return fileName + ".pdb";
}
@@ -170,4 +170,3 @@ public class PalmDocument
return fileName;
}
}
-