[Libreoffice-commits] .: 16 commits - bin/get-bugzilla-attachments-by-mimetype extensions/source filter/source sw/qa sw/source
Michael Stahl
mst at kemper.freedesktop.org
Sun Feb 12 15:28:35 PST 2012
bin/get-bugzilla-attachments-by-mimetype | 153 ++++++++--
extensions/source/plugin/base/xplugin.cxx | 18 -
filter/source/config/fragments/types/MS_Excel_2007_XML.xcu | 2
filter/source/config/fragments/types/MS_Excel_2007_XML_Template.xcu | 2
filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu | 2
filter/source/config/fragments/types/MS_PowerPoint_2007_XML_AutoPlay.xcu | 2
filter/source/config/fragments/types/MS_PowerPoint_2007_XML_Template.xcu | 2
filter/source/config/fragments/types/calc_Lotus.xcu | 2
filter/source/config/fragments/types/calc_OOXML.xcu | 2
filter/source/config/fragments/types/calc_OOXML_Template.xcu | 2
filter/source/config/fragments/types/calc_StarOffice_XML_Calc_Template.xcu | 2
filter/source/config/fragments/types/draw_StarOffice_XML_Draw_Template.xcu | 2
filter/source/config/fragments/types/impress_OOXML_Presentation.xcu | 2
filter/source/config/fragments/types/impress_OOXML_Presentation_AutoPlay.xcu | 2
filter/source/config/fragments/types/impress_OOXML_Presentation_Template.xcu | 2
filter/source/config/fragments/types/impress_StarOffice_XML_Impress_Template.xcu | 2
filter/source/config/fragments/types/writer_DocBook_File.xcu | 2
filter/source/config/fragments/types/writer_MS_Works_Document.xcu | 2
filter/source/config/fragments/types/writer_StarOffice_XML_Writer_Template.xcu | 2
filter/source/config/fragments/types/writer_WordPerfect_Document.xcu | 2
filter/source/config/fragments/types/writer_web_StarOffice_XML_Writer_Web_Template.xcu | 2
filter/source/config/fragments/types/writerweb8_writer_template.xcu | 2
sw/qa/complex/writer/LoadSaveTest.java | 87 +++--
sw/qa/core/filters-test.cxx | 55 +++
sw/source/core/frmedt/tblsel.cxx | 2
sw/source/core/inc/flowfrm.hxx | 28 -
sw/source/core/layout/flowfrm.cxx | 37 ++
sw/source/core/layout/laycache.cxx | 1
sw/source/core/layout/sectfrm.cxx | 11
sw/source/core/layout/ssfrm.cxx | 3
sw/source/core/layout/tabfrm.cxx | 1
sw/source/core/text/frmform.cxx | 5
sw/source/core/text/xmldump.cxx | 12
sw/source/filter/ww8/ww8par.cxx | 3
34 files changed, 325 insertions(+), 131 deletions(-)
New commits:
commit a9f6e5323eaa3078f0a3a00a37cee169ba7dedbc
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 22:16:53 2012 +0100
fdo#41712: sw: remove superfluous flag:
This removes SwFlowFrm::bIsFollow, which is pointless duplication of
m_pPrecede; this fixes lots of assertions (probably some real problem as
well).
diff --git a/sw/source/core/frmedt/tblsel.cxx b/sw/source/core/frmedt/tblsel.cxx
index eb84e67..2a4123e 100644
--- a/sw/source/core/frmedt/tblsel.cxx
+++ b/sw/source/core/frmedt/tblsel.cxx
@@ -2195,7 +2195,7 @@ void _FndBox::SetTableLines( const SwTable &rTable )
inline void UnsetFollow( SwFlowFrm *pTab )
{
- pTab->bIsFollow = sal_False;
+ pTab->m_pPrecede = 0;
}
void _FndBox::DelFrms( SwTable &rTable )
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 32542e8..7104060 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -117,7 +117,6 @@ protected:
SwFlowFrm *m_pFollow;
SwFlowFrm *m_pPrecede;
- sal_Bool bIsFollow :1; //Ist's ein Follow
sal_Bool bLockJoin :1; //Join (und damit deleten) verboten wenn sal_True!
sal_Bool bUndersized:1; // wir sind kleiner als gewuenscht
sal_Bool bFlyLock :1; // Stop positioning of at-character flyframes
@@ -163,8 +162,7 @@ public:
void MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling = 0 );
sal_Bool HasFollow() const { return m_pFollow ? sal_True : sal_False; }
- sal_Bool IsFollow() const { return bIsFollow; }
- inline void _SetIsFollow( sal_Bool bSet ) { bIsFollow = bSet; }
+ sal_Bool IsFollow() const { return 0 != m_pPrecede; }
const SwFlowFrm *GetFollow() const { return m_pFollow; }
SwFlowFrm *GetFollow() { return m_pFollow; }
sal_Bool IsAnFollow( const SwFlowFrm *pFlow ) const;
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 15c678e..b8e425d 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -81,7 +81,6 @@ SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) :
rThis( rFrm ),
m_pFollow( 0 ),
m_pPrecede( 0 ),
- bIsFollow( false ),
bLockJoin( false ),
bUndersized( false ),
bFlyLock( false )
diff --git a/sw/source/core/layout/laycache.cxx b/sw/source/core/layout/laycache.cxx
index b04de85..d5f041d 100644
--- a/sw/source/core/layout/laycache.cxx
+++ b/sw/source/core/layout/laycache.cxx
@@ -924,7 +924,6 @@ sal_Bool SwLayHelper::CheckInsert( sal_uLong nNodeIndex )
{
SwTxtFrm *pNew = new SwTxtFrm( ((SwTxtFrm*)rpFrm)->
GetTxtNode(), rpFrm );
- pNew->_SetIsFollow( sal_True );
pNew->ManipOfst( nOfst );
pNew->SetFollow( ((SwTxtFrm*)rpFrm)->GetFollow() );
((SwTxtFrm*)rpFrm)->SetFollow( pNew );
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 4ff80e1..3f2ea28 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -102,15 +102,11 @@ SwSectionFrm::SwSectionFrm( SwSectionFrm &rSect, sal_Bool bMaster ) :
{
SwSectionFrm* pMaster = rSect.FindMaster();
pMaster->SetFollow( this );
- bIsFollow = sal_True;
}
- else
- rSect.bIsFollow = sal_True;
SetFollow( &rSect );
}
else
{
- bIsFollow = sal_True;
SetFollow( rSect.GetFollow() );
rSect.SetFollow( this );
if( !GetFollow() )
@@ -171,7 +167,6 @@ SwSectionFrm::~SwSectionFrm()
else if( HasFollow() )
{
PROTOCOL( this, PROT_SECTION, ACT_DEL_MASTER, GetFollow() )
- GetFollow()->bIsFollow = sal_False;
}
}
}
@@ -218,10 +213,7 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
// freigeben, deshalb wird die Size des Masters invalidiert.
if( !GetFollow() && !pMaster->IsColLocked() )
pMaster->InvalidateSize();
- bIsFollow = sal_False;
}
- else if( HasFollow() )
- GetFollow()->bIsFollow = sal_False;
SetFollow(0);
if( pUp )
{
@@ -504,7 +496,6 @@ void SwSectionFrm::MergeNext( SwSectionFrm* pNxt )
}
SetFollow( pNxt->GetFollow() );
pNxt->SetFollow( NULL );
- pNxt->bIsFollow = sal_False;
pNxt->Cut();
delete pNxt;
InvalidateSize();
diff --git a/sw/source/core/layout/ssfrm.cxx b/sw/source/core/layout/ssfrm.cxx
index adc552d..d0515ef 100644
--- a/sw/source/core/layout/ssfrm.cxx
+++ b/sw/source/core/layout/ssfrm.cxx
@@ -518,13 +518,10 @@ void SwCntntFrm::DelFrms( const SwCntntNode& rNode )
dynamic_cast<SwTxtFrm*>(pFrm->FindPrevCnt( true )) );
}
}
- if( pFrm->HasFollow() )
- pFrm->GetFollow()->_SetIsFollow( pFrm->IsFollow() );
if( pFrm->IsFollow() )
{
SwCntntFrm* pMaster = (SwTxtFrm*)pFrm->FindMaster();
pMaster->SetFollow( pFrm->GetFollow() );
- pFrm->_SetIsFollow( sal_False );
}
pFrm->SetFollow( 0 );//Damit er nicht auf dumme Gedanken kommt.
//Andernfalls kann es sein, dass ein Follow
diff --git a/sw/source/core/layout/tabfrm.cxx b/sw/source/core/layout/tabfrm.cxx
index ec32c68..95eceb8 100644
--- a/sw/source/core/layout/tabfrm.cxx
+++ b/sw/source/core/layout/tabfrm.cxx
@@ -121,7 +121,6 @@ SwTabFrm::SwTabFrm( SwTabFrm &rTab ) :
SwFlowFrm( (SwFrm&)*this ),
pTable( rTab.GetTable() )
{
- bIsFollow = sal_True;
bComplete = bONECalcLowers = bCalcLowers = bLowersFormatted = bLockBackMove =
bResizeHTMLTable = bHasFollowFlowLine = bIsRebuildLastLine =
bRestrictTableGrowth = bRemoveFollowFlowLinePending = sal_False;
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 0731b10..e417e84 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -697,7 +697,6 @@ SwCntntFrm *SwTxtFrm::SplitFrm( const xub_StrLen nTxtPos )
// Damit meine Daten nicht verschwinden, locke ich mich.
SwTxtFrmLocker aLock( this );
SwTxtFrm *pNew = (SwTxtFrm *)(GetTxtNode()->MakeFrm( this ));
- pNew->bIsFollow = sal_True;
pNew->SetFollow( GetFollow() );
SetFollow( pNew );
commit 657c500e2e9e9ad2e38e9da278b20fb82c109001
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 22:11:37 2012 +0100
fdo#41712: sw: fix crash in layout frame linked lists:
The pPrecede member is not maintained properly when setting the
corresponding pFollow member.
The change in SwTxtFrm::JoinFrm() fixes the crash, the other changes
are perhaps fixes for other crashes...
(regression from cc3d0d182cafef9649e45f4657233ac2221fdd0a)
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 25a7502..32542e8 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -145,6 +145,7 @@ protected:
public:
SwFlowFrm( SwFrm &rFrm );
+ virtual ~SwFlowFrm();
const SwFrm *GetFrm() const { return &rThis; }
SwFrm *GetFrm() { return &rThis; }
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 24f1b51..15c678e 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -87,12 +87,33 @@ SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) :
bFlyLock( false )
{}
+SwFlowFrm::~SwFlowFrm()
+{
+ if (m_pFollow)
+ {
+ m_pFollow->m_pPrecede = 0;
+ }
+ if (m_pPrecede)
+ {
+ m_pPrecede->m_pFollow = 0;
+ }
+}
void SwFlowFrm::SetFollow(SwFlowFrm *const pFollow)
{
+ if (m_pFollow)
+ {
+ assert(this == m_pFollow->m_pPrecede);
+ m_pFollow->m_pPrecede = 0;
+ }
m_pFollow = pFollow;
if (m_pFollow != NULL)
{
+ if (m_pFollow->m_pPrecede) // re-chaining pFollow?
+ {
+ assert(m_pFollow == m_pFollow->m_pPrecede->m_pFollow);
+ m_pFollow->m_pPrecede->m_pFollow = 0;
+ }
m_pFollow->m_pPrecede = this;
}
}
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 581c123..4ff80e1 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -222,7 +222,7 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
}
else if( HasFollow() )
GetFollow()->bIsFollow = sal_False;
- m_pFollow = NULL;
+ SetFollow(0);
if( pUp )
{
Frm().Height( 0 );
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 1b34187..0731b10 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -680,8 +680,8 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
}
}
pFoll->Cut();
+ SetFollow(pNxt);
delete pFoll;
- m_pFollow = pNxt;
return pNxt;
}
commit c0970c2be45ea62d86e24271065311aaa92c0186
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 22:02:55 2012 +0100
fdo#41712: rename members to track down assignments
diff --git a/sw/source/core/inc/flowfrm.hxx b/sw/source/core/inc/flowfrm.hxx
index 65d8e47..25a7502 100644
--- a/sw/source/core/inc/flowfrm.hxx
+++ b/sw/source/core/inc/flowfrm.hxx
@@ -114,8 +114,8 @@ class SwFlowFrm
protected:
- SwFlowFrm *pFollow;
- SwFlowFrm *pPrecede;
+ SwFlowFrm *m_pFollow;
+ SwFlowFrm *m_pPrecede;
sal_Bool bIsFollow :1; //Ist's ein Follow
sal_Bool bLockJoin :1; //Join (und damit deleten) verboten wenn sal_True!
@@ -161,16 +161,16 @@ public:
//neuen Parent Moven.
void MoveSubTree( SwLayoutFrm* pParent, SwFrm* pSibling = 0 );
- sal_Bool HasFollow() const { return pFollow ? sal_True : sal_False; }
+ sal_Bool HasFollow() const { return m_pFollow ? sal_True : sal_False; }
sal_Bool IsFollow() const { return bIsFollow; }
inline void _SetIsFollow( sal_Bool bSet ) { bIsFollow = bSet; }
- const SwFlowFrm *GetFollow() const { return pFollow; }
- SwFlowFrm *GetFollow() { return pFollow; }
+ const SwFlowFrm *GetFollow() const { return m_pFollow; }
+ SwFlowFrm *GetFollow() { return m_pFollow; }
sal_Bool IsAnFollow( const SwFlowFrm *pFlow ) const;
- inline void SetFollow( SwFlowFrm *pNew );
+ void SetFollow(SwFlowFrm *const pFollow);
- const SwFlowFrm *GetPrecede() const { return pPrecede; }
- SwFlowFrm *GetPrecede() { return pPrecede; }
+ const SwFlowFrm *GetPrecede() const { return m_pPrecede; }
+ SwFlowFrm *GetPrecede() { return m_pPrecede; }
sal_Bool IsJoinLocked() const { return bLockJoin; }
@@ -239,13 +239,6 @@ inline sal_Bool SwFlowFrm::IsFwdMoveAllowed()
return rThis.GetIndPrev() != 0;
}
-inline void SwFlowFrm::SetFollow( SwFlowFrm *pNew )
-{
- pFollow = pNew;
- if ( pFollow != NULL )
- pFollow->pPrecede = this;
-}
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/core/layout/flowfrm.cxx b/sw/source/core/layout/flowfrm.cxx
index 31c79b0..24f1b51 100644
--- a/sw/source/core/layout/flowfrm.cxx
+++ b/sw/source/core/layout/flowfrm.cxx
@@ -79,8 +79,8 @@ sal_Bool SwFlowFrm::bMoveBwdJump = sal_False;
SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) :
rThis( rFrm ),
- pFollow( 0 ),
- pPrecede( 0 ),
+ m_pFollow( 0 ),
+ m_pPrecede( 0 ),
bIsFollow( false ),
bLockJoin( false ),
bUndersized( false ),
@@ -88,6 +88,15 @@ SwFlowFrm::SwFlowFrm( SwFrm &rFrm ) :
{}
+void SwFlowFrm::SetFollow(SwFlowFrm *const pFollow)
+{
+ m_pFollow = pFollow;
+ if (m_pFollow != NULL)
+ {
+ m_pFollow->m_pPrecede = this;
+ }
+}
+
/*************************************************************************
|*
|* SwFlowFrm::IsFollowLocked()
@@ -214,7 +223,7 @@ sal_Bool SwFlowFrm::IsKeep( const SwAttrSet& rAttrs, bool bCheckIfLastRowShouldK
{
SwFrm *pNxt;
if( 0 != (pNxt = rThis.FindNextCnt()) &&
- (!pFollow || pNxt != pFollow->GetFrm()))
+ (!m_pFollow || pNxt != m_pFollow->GetFrm()))
{
// #135914#
// The last row of a table only keeps with the next content
diff --git a/sw/source/core/layout/sectfrm.cxx b/sw/source/core/layout/sectfrm.cxx
index 6a0e3d9..581c123 100644
--- a/sw/source/core/layout/sectfrm.cxx
+++ b/sw/source/core/layout/sectfrm.cxx
@@ -222,7 +222,7 @@ void SwSectionFrm::DelEmpty( sal_Bool bRemove )
}
else if( HasFollow() )
GetFollow()->bIsFollow = sal_False;
- pFollow = NULL;
+ m_pFollow = NULL;
if( pUp )
{
Frm().Height( 0 );
diff --git a/sw/source/core/text/frmform.cxx b/sw/source/core/text/frmform.cxx
index 1d7c15e..1b34187 100644
--- a/sw/source/core/text/frmform.cxx
+++ b/sw/source/core/text/frmform.cxx
@@ -681,7 +681,7 @@ SwCntntFrm *SwTxtFrm::JoinFrm()
}
pFoll->Cut();
delete pFoll;
- pFollow = pNxt;
+ m_pFollow = pNxt;
return pNxt;
}
@@ -2065,7 +2065,7 @@ sal_Bool SwTxtFrm::FormatQuick( bool bForceQuickFormat )
return sal_False;
}
- if( pFollow && nStart != ((SwTxtFrm*)pFollow)->GetOfst() )
+ if (m_pFollow && nStart != (static_cast<SwTxtFrm*>(m_pFollow))->GetOfst())
return sal_False; // kann z.B. durch Orphans auftreten (35083,35081)
// Geschafft, wir sind durch ...
diff --git a/sw/source/core/text/xmldump.cxx b/sw/source/core/text/xmldump.cxx
index 83419bd..25e8347 100644
--- a/sw/source/core/text/xmldump.cxx
+++ b/sw/source/core/text/xmldump.cxx
@@ -366,8 +366,8 @@ void SwTxtFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
if ( HasFollow() )
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
- if ( pPrecede != NULL )
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwTxtFrm*)pPrecede );
+ if (m_pPrecede != NULL)
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwTxtFrm*)m_pPrecede );
}
void SwSectionFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
@@ -376,8 +376,8 @@ void SwSectionFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
if ( HasFollow() )
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
- if ( pPrecede != NULL )
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwSectionFrm*)pPrecede );
+ if (m_pPrecede != NULL)
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwSectionFrm*)m_pPrecede );
}
void SwTabFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
@@ -386,8 +386,8 @@ void SwTabFrm::dumpAsXmlAttributes( xmlTextWriterPtr writer )
if ( HasFollow() )
xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "follow" ), "%p", GetFollow() );
- if ( pPrecede != NULL )
- xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwTabFrm*)pPrecede );
+ if (m_pPrecede != NULL)
+ xmlTextWriterWriteFormatAttribute( writer, BAD_CAST( "precede" ), "%p", (SwTabFrm*)m_pPrecede );
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit cd24d2524f2c2da51f982015f1b027003b192808
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:54:42 2012 +0100
extensions: plugin: UNX: don't crash headless
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index b604b21..261b4e6 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -523,7 +523,10 @@ void XPlugin_Impl::loadPlugin()
}
const SystemEnvData* pEnvData = getSysChildSysData();
#if defined( UNX ) && !(defined(QUARTZ))
- XSync( (Display*)pEnvData->pDisplay, False );
+ if (pEnvData->pDisplay) // headless?
+ {
+ XSync( (Display*)pEnvData->pDisplay, False );
+ }
#endif
if( ! getPluginComm() )
{
@@ -568,8 +571,15 @@ void XPlugin_Impl::loadPlugin()
// m_aNPWindow is set up in the MacPluginComm from the view
SetSysPlugDataParentView(*pEnvData);
#elif defined( UNX )
- XSync( (Display*)pEnvData->pDisplay, False );
- m_aNPWindow.window = (void*)pEnvData->aWindow;
+ if (pEnvData->pDisplay) // headless?
+ {
+ XSync( (Display*)pEnvData->pDisplay, False );
+ m_aNPWindow.window = (void*)pEnvData->aWindow;
+ }
+ else
+ {
+ m_aNPWindow.window = NULL;
+ }
m_aNPWindow.ws_info = NULL;
#else
m_aNPWindow.window = (void*)pEnvData->hWnd;
commit 43cb934dda9af45a83748c775f274bbd0fdcd67a
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:54:41 2012 +0100
extensions: plugin: assertion from OUString::copy
diff --git a/extensions/source/plugin/base/xplugin.cxx b/extensions/source/plugin/base/xplugin.cxx
index 263cb4e..b604b21 100644
--- a/extensions/source/plugin/base/xplugin.cxx
+++ b/extensions/source/plugin/base/xplugin.cxx
@@ -907,9 +907,9 @@ PluginDescription XPlugin_Impl::fitDescription( const OUString& rURL )
}
int nPos = rURL.lastIndexOf( (sal_Unicode)'.' );
- OUString aExt = rURL.copy( nPos ).toAsciiLowerCase();
if( nPos != -1 )
{
+ OUString const aExt = rURL.copy( nPos ).toAsciiLowerCase();
for( int i = 0; i < aDescrs.getLength(); i++ )
{
OUString aThisExt = pDescrs[ i ].Extension.toAsciiLowerCase();
commit 17598877cdca489d1e0279cbdb9a46ae55cbae41
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:54:01 2012 +0100
sw: make LoadSaveTest runnable again
diff --git a/sw/qa/complex/writer/LoadSaveTest.java b/sw/qa/complex/writer/LoadSaveTest.java
index a160048..df325ac 100644
--- a/sw/qa/complex/writer/LoadSaveTest.java
+++ b/sw/qa/complex/writer/LoadSaveTest.java
@@ -27,7 +27,6 @@
package complex.writer;
-import complexlib.ComplexTestCase;
import com.sun.star.uno.UnoRuntime;
import com.sun.star.uno.AnyConverter;
import com.sun.star.uno.XComponentContext;
@@ -47,6 +46,15 @@ import com.sun.star.document.XDocumentEventBroadcaster;
import com.sun.star.document.XDocumentEventListener;
import com.sun.star.text.XTextDocument;
+import org.openoffice.test.OfficeConnection;
+
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import static org.junit.Assert.*;
+
import java.util.List;
import java.util.ArrayList;
import java.io.File;
@@ -55,8 +63,20 @@ import java.io.File;
* a small program to load documents from one directory (recursively)
* and store them in another, implemented as a complex test.
*/
-public class LoadSaveTest extends ComplexTestCase
+public class LoadSaveTest
{
+ private static final OfficeConnection connection = new OfficeConnection();
+
+ @BeforeClass public static void setUpConnection() throws Exception {
+ connection.setUp();
+ }
+
+ @AfterClass public static void tearDownConnection()
+ throws InterruptedException, com.sun.star.uno.Exception
+ {
+ connection.tearDown();
+ }
+
private XMultiServiceFactory m_xMSF = null;
private XComponentContext m_xContext = null;
private XDocumentEventBroadcaster m_xGEB = null;
@@ -67,37 +87,24 @@ public class LoadSaveTest extends ComplexTestCase
private String m_SourceDir = "FIXME";
private String m_TargetDir = "/tmp/out";
- public String[] getTestMethodNames() {
- return new String[] { "testLoadStore" };
- }
-
- public void before() throws Exception
+ @Before public void before() throws Exception
{
- m_xMSF = (XMultiServiceFactory) param.getMSF();
- XPropertySet xPropertySet = (XPropertySet)
- UnoRuntime.queryInterface(XPropertySet.class, m_xMSF);
- Object defaultCtx = xPropertySet.getPropertyValue("DefaultContext");
- m_xContext = (XComponentContext)
- UnoRuntime.queryInterface(XComponentContext.class, defaultCtx);
- assure("could not get component context.", m_xContext != null);
+ m_xContext = connection.getComponentContext();
+ assertNotNull("could not get component context.", m_xContext);
+ m_xMSF = UnoRuntime.queryInterface(
+ XMultiServiceFactory.class, m_xContext.getServiceManager());
Object oGEB = m_xMSF.createInstance(
"com.sun.star.frame.GlobalEventBroadcaster");
m_xGEB = (XDocumentEventBroadcaster)
UnoRuntime.queryInterface(XDocumentEventBroadcaster.class, oGEB);
- assure("could not get global event broadcaster.", m_xGEB != null);
+ assertNotNull("could not get global event broadcaster.", m_xGEB);
m_TmpDir = util.utils.getOfficeTemp/*Dir*/(m_xMSF);
- log.println("tempdir: " + m_TmpDir);
- log.println("sourcedir: " + m_SourceDir);
- log.println("targetdir: " + m_TargetDir);
- }
-
- /*
- public void after()
- {
+ System.out.println("tempdir: " + m_TmpDir);
+ System.out.println("sourcedir: " + m_SourceDir);
+ System.out.println("targetdir: " + m_TargetDir);
}
- */
- public void testLoadStore() throws Exception
+ @Test public void testLoadStore() throws Exception
{
Pair<List<String>, List<String>> dirsFiles =
getDirAndFileNames(m_SourceDir);
@@ -119,7 +126,7 @@ public class LoadSaveTest extends ComplexTestCase
try {
m_xGEB.addDocumentEventListener(xListener);
- log.println("Loading document: " + fileName + " ...");
+ System.out.println("Loading document: " + fileName + " ...");
PropertyValue[] loadProps = new PropertyValue[1];
loadProps[0] = new PropertyValue();
@@ -130,7 +137,7 @@ public class LoadSaveTest extends ComplexTestCase
xDoc = util.DesktopTools.loadDoc(m_xMSF, sourceFile, loadProps);
- log.println("... done");
+ System.out.println("... done");
{
// apparently OnLayoutFinished is not sent for every doc???
@@ -141,11 +148,11 @@ public class LoadSaveTest extends ComplexTestCase
time += 100;
}
if (time >= 30000) {
- log.println("timeout: no OnLayoutFinished received!");
+ System.out.println("timeout: no OnLayoutFinished received");
}
}
- log.println("Storing document: " + fileName + " ...");
+ System.out.println("Storing document: " + fileName + " ...");
XStorable xStor = (XStorable) UnoRuntime.queryInterface(
XStorable.class, xDoc);
@@ -154,7 +161,7 @@ public class LoadSaveTest extends ComplexTestCase
xStor.storeToURL(targetFile, new PropertyValue[0]);
- log.println("... done");
+ System.out.println("... done");
} finally {
if (xDoc != null) {
@@ -172,12 +179,12 @@ public class LoadSaveTest extends ComplexTestCase
boolean IsLayoutFinished() { return m_isLayoutFinished; }
public void documentEventOccured(DocumentEvent Event)
{
-// log.println("event: " + Event.EventName);
+// System.out.println("event: " + Event.EventName);
if ("OnLayoutFinished".equals(Event.EventName))
{
// we only have one doc at any time, so no need to check
m_isLayoutFinished = true;
-// log.println("received OnLayoutFinished");
+// System.out.println("received OnLayoutFinished");
}
}
public void disposing(EventObject Event) { }
@@ -187,24 +194,24 @@ public class LoadSaveTest extends ComplexTestCase
{
if (e instanceof WrappedTargetException)
{
- log.println("Cause:");
+ System.out.println("Cause:");
Exception cause = (Exception)
(((WrappedTargetException)e).TargetException);
- log.println(cause.toString());
+ System.out.println(cause.toString());
report2(cause);
} else if (e instanceof WrappedTargetRuntimeException) {
- log.println("Cause:");
+ System.out.println("Cause:");
Exception cause = (Exception)
(((WrappedTargetRuntimeException)e).TargetException);
- log.println(cause.toString());
+ System.out.println(cause.toString());
report2(cause);
}
}
void report(Exception e) {
- log.println("Exception occurred:");
- log.println(e.toString());
- e.printStackTrace((java.io.PrintWriter) log);
+ System.out.println("Exception occurred:");
+ System.out.println(e.toString());
+ e.printStackTrace(System.out);
report2(e);
// failed();
}
@@ -221,7 +228,7 @@ public class LoadSaveTest extends ComplexTestCase
void getDirAndFileNames(File file, String relPath,
List<String> dirs, List<String> files)
{
- assure("does not exist: " + relPath, file.exists());
+ assertTrue("does not exist: " + relPath, file.exists());
if (file.isDirectory()) {
dirs.add(relPath);
File[] subfiles = file.listFiles();
commit dde3ce96de325f36d5eaa860c9e067485aa95d3e
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:53:49 2012 +0100
sw: filters-test.cxx: failed attempt to layout loaded documents
diff --git a/sw/qa/core/filters-test.cxx b/sw/qa/core/filters-test.cxx
index 0af2275..a8682bd 100644
--- a/sw/qa/core/filters-test.cxx
+++ b/sw/qa/core/filters-test.cxx
@@ -30,6 +30,13 @@
#include <unotest/filters-test.hxx>
#include <test/bootstrapfixture.hxx>
+#include <cppuhelper/implbase1.hxx>
+
+#include <com/sun/star/document/XDocumentEventListener.hpp>
+#include <com/sun/star/document/XDocumentEventBroadcaster.hpp>
+
+#include <comphelper/processfactory.hxx>
+
#include <sfx2/app.hxx>
#include <sfx2/docfilt.hxx>
#include <sfx2/docfile.hxx>
@@ -47,6 +54,29 @@ SO2_IMPL_REF(SwDocShell)
using namespace ::com::sun::star;
+
+class EventListener
+ : public ::cppu::WeakImplHelper1<document::XDocumentEventListener>
+{
+public:
+ bool m_bLayoutFinished;
+ explicit EventListener() : m_bLayoutFinished(false) { }
+ virtual void SAL_CALL documentEventOccured(
+ document::DocumentEvent const& rEvent)
+ throw (uno::RuntimeException)
+ {
+// fprintf(stderr, "EVENT: %s\n", ::rtl::OUStringToOString(rEvent.EventName, RTL_TEXTENCODING_UTF8).getStr());
+ if (rEvent.EventName.equalsAscii("OnLayoutFinished"))
+ {
+ m_bLayoutFinished = true;
+ }
+ }
+ virtual void SAL_CALL disposing(lang::EventObject const&)
+ throw (uno::RuntimeException)
+ {
+ }
+};
+
/* Implementation of Filters test */
class SwFiltersTest
@@ -71,6 +101,18 @@ private:
bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL,
const rtl::OUString &rUserData)
{
+ ::rtl::Reference<EventListener> xListener;
+ if (false) // does not work: missing ViewShell, no VCL timers, or both
+ {
+ xListener.set(new EventListener);
+ uno::Reference<document::XDocumentEventBroadcaster> xGEB;
+ xGEB.set(::comphelper::getProcessServiceFactory()->createInstance(
+ ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(
+ "com.sun.star.frame.GlobalEventBroadcaster"))),
+ uno::UNO_QUERY_THROW);
+ xGEB->addDocumentEventListener(
+ uno::Reference<document::XDocumentEventListener>(xListener.get()));
+ }
SfxFilter* pFilter = new SfxFilter(
rFilter,
rtl::OUString(), 0, 0, rtl::OUString(), 0, rtl::OUString(),
@@ -80,6 +122,19 @@ bool SwFiltersTest::load(const rtl::OUString &rFilter, const rtl::OUString &rURL
SfxMedium* pSrcMed = new SfxMedium(rURL, STREAM_STD_READ, true);
pSrcMed->SetFilter(pFilter);
bool bLoaded = xDocShRef->DoLoad(pSrcMed);
+ if (bLoaded && xListener.is())
+ {
+ TimeValue delay = {0, 100000000};
+ int tries(0);
+ while (!xListener->m_bLayoutFinished) {
+ osl_waitThread(& delay);
+ ++tries;
+ if (tries >= 300) {
+ fprintf(stderr, "timed out: no OnLayoutFinished received\n");
+ break;
+ }
+ }
+ }
if (xDocShRef.Is())
xDocShRef->DoClose();
return bLoaded;
commit 85b5a185124589bbd0606432a5536ce12ae2f66c
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:52:31 2012 +0100
filter configuration: add some OOo XML/ODF mimetypes
diff --git a/filter/source/config/fragments/types/calc_StarOffice_XML_Calc_Template.xcu b/filter/source/config/fragments/types/calc_StarOffice_XML_Calc_Template.xcu
index 022e6ac..e300b13 100644
--- a/filter/source/config/fragments/types/calc_StarOffice_XML_Calc_Template.xcu
+++ b/filter/source/config/fragments/types/calc_StarOffice_XML_Calc_Template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>stc</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.sun.xml.calc.template</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>calc_StarOffice_XML_Calc_Template</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/draw_StarOffice_XML_Draw_Template.xcu b/filter/source/config/fragments/types/draw_StarOffice_XML_Draw_Template.xcu
index 6367ec3..a068d61 100644
--- a/filter/source/config/fragments/types/draw_StarOffice_XML_Draw_Template.xcu
+++ b/filter/source/config/fragments/types/draw_StarOffice_XML_Draw_Template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>std</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.sun.xml.draw.template</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>draw_StarOffice_XML_Draw_Template</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/impress_StarOffice_XML_Impress_Template.xcu b/filter/source/config/fragments/types/impress_StarOffice_XML_Impress_Template.xcu
index 764e822..04bfc08 100644
--- a/filter/source/config/fragments/types/impress_StarOffice_XML_Impress_Template.xcu
+++ b/filter/source/config/fragments/types/impress_StarOffice_XML_Impress_Template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.draw.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>sti</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.sun.xml.impress.template</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>impress_StarOffice_XML_Impress_Template</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/writer_StarOffice_XML_Writer_Template.xcu b/filter/source/config/fragments/types/writer_StarOffice_XML_Writer_Template.xcu
index 1ad5271..f786cb0 100644
--- a/filter/source/config/fragments/types/writer_StarOffice_XML_Writer_Template.xcu
+++ b/filter/source/config/fragments/types/writer_StarOffice_XML_Writer_Template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.text.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>stw</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.sun.xml.writer.template</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>writer_StarOffice_XML_Writer_Template</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/writer_web_StarOffice_XML_Writer_Web_Template.xcu b/filter/source/config/fragments/types/writer_web_StarOffice_XML_Writer_Web_Template.xcu
index 97fb23c..7201e93 100644
--- a/filter/source/config/fragments/types/writer_web_StarOffice_XML_Writer_Web_Template.xcu
+++ b/filter/source/config/fragments/types/writer_web_StarOffice_XML_Writer_Web_Template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.text.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>stw</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.sun.xml.writer.web</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>writer_web_StarOffice_XML_Writer_Web_Template</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/writerweb8_writer_template.xcu b/filter/source/config/fragments/types/writerweb8_writer_template.xcu
index dbf9b45..55ea913 100644
--- a/filter/source/config/fragments/types/writerweb8_writer_template.xcu
+++ b/filter/source/config/fragments/types/writerweb8_writer_template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.text.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>oth</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.oasis.opendocument.text-web</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>writerweb8_writer_template</value></prop>
<prop oor:name="UIName">
commit 6b54630499ac580b92a7cd5533493f631ed3cc5b
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:52:30 2012 +0100
filter configuration: add some mimetype
diff --git a/filter/source/config/fragments/types/calc_Lotus.xcu b/filter/source/config/fragments/types/calc_Lotus.xcu
index 5e45813..08deadd 100644
--- a/filter/source/config/fragments/types/calc_Lotus.xcu
+++ b/filter/source/config/fragments/types/calc_Lotus.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.calc.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>wk1 wks 123</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.lotus-1-2-3</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>Lotus</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/writer_DocBook_File.xcu b/filter/source/config/fragments/types/writer_DocBook_File.xcu
index f68a64c..90364b6 100644
--- a/filter/source/config/fragments/types/writer_DocBook_File.xcu
+++ b/filter/source/config/fragments/types/writer_DocBook_File.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.filters.XMLFilterDetect</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xml</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/docbook+xml</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>DocBook File</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/writer_MS_Works_Document.xcu b/filter/source/config/fragments/types/writer_MS_Works_Document.xcu
index 0b074d8..5cdd0f0 100644
--- a/filter/source/config/fragments/types/writer_MS_Works_Document.xcu
+++ b/filter/source/config/fragments/types/writer_MS_Works_Document.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.Writer.MSWorksImportFilter</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>wps</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.ms-works</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>MS_Works</value></prop>
<prop oor:name="UIName">
diff --git a/filter/source/config/fragments/types/writer_WordPerfect_Document.xcu b/filter/source/config/fragments/types/writer_WordPerfect_Document.xcu
index 3798319..8f3811e 100644
--- a/filter/source/config/fragments/types/writer_WordPerfect_Document.xcu
+++ b/filter/source/config/fragments/types/writer_WordPerfect_Document.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.Writer.WordPerfectImportFilter</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>wpd</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.wordperfect</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>WordPerfect</value></prop>
<prop oor:name="UIName">
commit 6bbed75218197ddea1cad6c3baac59bf7b50da9a
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:52:30 2012 +0100
filter configuration: add MSO 2007 XML mimetypes
diff --git a/filter/source/config/fragments/types/MS_Excel_2007_XML.xcu b/filter/source/config/fragments/types/MS_Excel_2007_XML.xcu
index 78adeeb..f15968a 100644
--- a/filter/source/config/fragments/types/MS_Excel_2007_XML.xcu
+++ b/filter/source/config/fragments/types/MS_Excel_2007_XML.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlsx xlsm</value></prop>
- <prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>Calc MS Excel 2007 XML</value></prop>
<prop oor:name="UIName"><value xml:lang="en-US">Microsoft Excel 2007/2010 XML</value></prop>
diff --git a/filter/source/config/fragments/types/MS_Excel_2007_XML_Template.xcu b/filter/source/config/fragments/types/MS_Excel_2007_XML_Template.xcu
index 950fe8a..da95947 100644
--- a/filter/source/config/fragments/types/MS_Excel_2007_XML_Template.xcu
+++ b/filter/source/config/fragments/types/MS_Excel_2007_XML_Template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xltm xltx</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.spreadsheetml.template</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>Calc MS Excel 2007 XML Template</value></prop>
<prop oor:name="UIName"><value xml:lang="en-US">Microsoft Excel 2007/2010 XML Template</value></prop>
diff --git a/filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu b/filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu
index 253047d..9e55357 100644
--- a/filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu
+++ b/filter/source/config/fragments/types/MS_PowerPoint_2007_XML.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>pptx pptm</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.presentationml.presentation</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>Impress MS PowerPoint 2007 XML</value></prop>
<prop oor:name="UIName"><value xml:lang="en-US">Microsoft PowerPoint 2007/2010 XML</value></prop>
diff --git a/filter/source/config/fragments/types/MS_PowerPoint_2007_XML_AutoPlay.xcu b/filter/source/config/fragments/types/MS_PowerPoint_2007_XML_AutoPlay.xcu
index 044347c..c6333de 100644
--- a/filter/source/config/fragments/types/MS_PowerPoint_2007_XML_AutoPlay.xcu
+++ b/filter/source/config/fragments/types/MS_PowerPoint_2007_XML_AutoPlay.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>ppsx</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.presentationml.slideshow</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>Impress MS PowerPoint 2007 XML AutoPlay</value></prop>
<prop oor:name="UIName"><value xml:lang="en-US">Microsoft PowerPoint 2007/2010 XML</value></prop>
diff --git a/filter/source/config/fragments/types/MS_PowerPoint_2007_XML_Template.xcu b/filter/source/config/fragments/types/MS_PowerPoint_2007_XML_Template.xcu
index 8c4daec..6785000 100644
--- a/filter/source/config/fragments/types/MS_PowerPoint_2007_XML_Template.xcu
+++ b/filter/source/config/fragments/types/MS_PowerPoint_2007_XML_Template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>potm potx</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.presentationml.template</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>Impress MS PowerPoint 2007 XML Template</value></prop>
<prop oor:name="UIName"><value xml:lang="en-US">Microsoft PowerPoint 2007/2010 XML Template</value></prop>
diff --git a/filter/source/config/fragments/types/calc_OOXML.xcu b/filter/source/config/fragments/types/calc_OOXML.xcu
index 016d322..f00af8b 100644
--- a/filter/source/config/fragments/types/calc_OOXML.xcu
+++ b/filter/source/config/fragments/types/calc_OOXML.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xlsx xlsm</value></prop>
- <prop oor:name="MediaType"><value>application/vnd.ms-excel</value></prop>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.spreadsheetml.sheet</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>Calc Office Open XML</value></prop>
<prop oor:name="UIName"><value xml:lang="x-default">Office Open XML Spreadsheet</value></prop>
diff --git a/filter/source/config/fragments/types/calc_OOXML_Template.xcu b/filter/source/config/fragments/types/calc_OOXML_Template.xcu
index aaa0755..201d522 100644
--- a/filter/source/config/fragments/types/calc_OOXML_Template.xcu
+++ b/filter/source/config/fragments/types/calc_OOXML_Template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>xltx xltm</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.spreadsheetml.template</value></prop>
<prop oor:name="Preferred"><value>false</value></prop>
<prop oor:name="PreferredFilter"><value>Calc Office Open XML Template</value></prop>
<prop oor:name="UIName"><value xml:lang="x-default">Office Open XML Spreadsheet Template</value></prop>
diff --git a/filter/source/config/fragments/types/impress_OOXML_Presentation.xcu b/filter/source/config/fragments/types/impress_OOXML_Presentation.xcu
index 501f2e4..4db4a66 100644
--- a/filter/source/config/fragments/types/impress_OOXML_Presentation.xcu
+++ b/filter/source/config/fragments/types/impress_OOXML_Presentation.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>pptx pptm</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.presentationml.presentation</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>Impress Office Open XML</value></prop>
<prop oor:name="UIName"><value>Office Open XML Presentation</value></prop>
diff --git a/filter/source/config/fragments/types/impress_OOXML_Presentation_AutoPlay.xcu b/filter/source/config/fragments/types/impress_OOXML_Presentation_AutoPlay.xcu
index d4a8e6a..c9f5a6e 100644
--- a/filter/source/config/fragments/types/impress_OOXML_Presentation_AutoPlay.xcu
+++ b/filter/source/config/fragments/types/impress_OOXML_Presentation_AutoPlay.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>ppsx</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.presentationml.slideshow</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>Impress Office Open XML AutoPlay</value></prop>
<prop oor:name="UIName"><value xml:lang="x-default">Office Open XML Presentation AutoPlay</value></prop>
diff --git a/filter/source/config/fragments/types/impress_OOXML_Presentation_Template.xcu b/filter/source/config/fragments/types/impress_OOXML_Presentation_Template.xcu
index c2ea660..f1af446 100644
--- a/filter/source/config/fragments/types/impress_OOXML_Presentation_Template.xcu
+++ b/filter/source/config/fragments/types/impress_OOXML_Presentation_Template.xcu
@@ -2,7 +2,7 @@
<prop oor:name="DetectService"><value>com.sun.star.comp.oox.FormatDetector</value></prop>
<prop oor:name="URLPattern"/>
<prop oor:name="Extensions"><value>potm potx</value></prop>
- <prop oor:name="MediaType"/>
+ <prop oor:name="MediaType"><value>application/vnd.openxmlformats-officedocument.presentationml.template</value></prop>
<prop oor:name="Preferred"><value>true</value></prop>
<prop oor:name="PreferredFilter"><value>Impress Office Open XML Template</value></prop>
<prop oor:name="UIName"><value>Office Open XML Presentation Template</value></prop>
commit 82259f2e5446fbaaf5921a2cf195faa824629ea3
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:52:24 2012 +0100
get-bugzilla-attachments-by-mimetype: add retry:
Sadly the Apache OO bugzilla is rather unreliable and connections time out
a lot; retry connections to work around that.
diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype
index 3e52ad6..4410498 100755
--- a/bin/get-bugzilla-attachments-by-mimetype
+++ b/bin/get-bugzilla-attachments-by-mimetype
@@ -44,6 +44,17 @@ import xmlrpclib
from xml.dom import minidom
from xml.sax.saxutils import escape
+def urlopen_retry(url):
+ maxretries = 3
+ for i in range(maxretries + 1):
+ try:
+ return urllib.urlopen(url)
+ except IOError as e:
+ print "caught IOError: ", e
+ if maxretries == i:
+ raise
+ print "retrying..."
+
def get_from_bug_url_via_xml(url, mimetype, prefix, suffix):
id = url.rsplit('=', 2)[1]
print "id is", prefix, id, suffix
@@ -51,12 +62,12 @@ def get_from_bug_url_via_xml(url, mimetype, prefix, suffix):
print "assuming", id, "is up to date"
else:
print "parsing", id
- sock = urllib.urlopen(url+"&ctype=xml")
+ sock = urlopen_retry(url+"&ctype=xml")
dom = minidom.parse(sock)
sock.close()
attachmentid=1
for attachment in dom.getElementsByTagName('attachment'):
- print " mimetype is",
+ print " mimetype is",
for node in attachment.childNodes:
if node.nodeName == 'type':
print node.firstChild.nodeValue,
commit 18d1e1968c9bd62b68b447f8a882e37ff3d3dde4
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:50:53 2012 +0100
get-bugzilla-attachments-by-mimetype: don't do images:
What a stupid idea; what the heck do i do now with 5G of
jpegs and pngs on my disk?
diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype
index 67d0eba..3e52ad6 100755
--- a/bin/get-bugzilla-attachments-by-mimetype
+++ b/bin/get-bugzilla-attachments-by-mimetype
@@ -196,6 +196,10 @@ mimetypes = [
('application/x-starwriter', 'sdw'),
('application/vnd.stardivision.writer', 'sdw5'),
('application/vnd.stardivision.writer-global', 'sgl5'),
+]
+
+# disabled for now, this would download gigs of pngs/jpegs...
+image_mimetypes = [
# graphics
('image/svg+xml', 'svg'),
('image/x-MS-bmp', 'bmp'),
commit 4ff7252375b7b85eafbf176ca4e9184cc392d980
Author: Michael Stahl <mstahl at redhat.com>
Date: Sun Feb 12 21:42:44 2012 +0100
get-bugzilla-attachments-by-mimetype: more mimetypes
diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype
index c26ec84..67d0eba 100755
--- a/bin/get-bugzilla-attachments-by-mimetype
+++ b/bin/get-bugzilla-attachments-by-mimetype
@@ -115,11 +115,113 @@ novell = 'https://bugzilla.novell.com/buglist.cgi'
mozilla = 'https://bugzilla.mozilla.org/buglist.cgi'
mimetypes = [
- ('application/msword', 'doc'),
+# ODF
+ ('application/vnd.oasis.opendocument.base', 'odb'),
+ ('application/vnd.oasis.opendocument.database', 'odb'),
+ ('application/vnd.oasis.opendocument.chart', 'odc'),
+ ('application/vnd.oasis.opendocument.chart-template', 'otc'),
+ ('application/vnd.oasis.opendocument.formula', 'odf'),
+ ('application/vnd.oasis.opendocument.formula-template', 'otf'),
+ ('application/vnd.oasis.opendocument.graphics', 'odg'),
+ ('application/vnd.oasis.opendocument.graphics-template', 'otg'),
+ ('application/vnd.oasis.opendocument.graphics-flat-xml', 'fodg'),
+ ('application/vnd.oasis.opendocument.presentation', 'odp'),
+ ('application/vnd.oasis.opendocument.presentation-template', 'otp'),
+ ('application/vnd.oasis.opendocument.presentation-flat-xml', 'fodp'),
+ ('application/vnd.oasis.opendocument.spreadsheet', 'ods'),
+ ('application/vnd.oasis.opendocument.spreadsheet-template', 'ots'),
+ ('application/vnd.oasis.opendocument.spreadsheet-flat-xml', 'fods'),
+ ('application/vnd.oasis.opendocument.text', 'odt'),
+ ('application/vnd.oasis.opendocument.text-flat-xml', 'fodt'),
+ ('application/vnd.oasis.opendocument.text-master', 'odm'),
+ ('application/vnd.oasis.opendocument.text-template', 'ott'),
+ ('application/vnd.oasis.opendocument.text-web', 'oth'),
+# OOo XML
+ ('application/vnd.sun.xml.base', 'odb'),
+ ('application/vnd.sun.xml.calc', 'sxc'),
+ ('application/vnd.sun.xml.calc.template', 'stc'),
+ ('application/vnd.sun.xml.chart', 'sxs'),
+ ('application/vnd.sun.xml.draw', 'sxd'),
+ ('application/vnd.sun.xml.draw.template', 'std'),
+ ('application/vnd.sun.xml.impress', 'sxi'),
+ ('application/vnd.sun.xml.impress.template', 'sti'),
+ ('application/vnd.sun.xml.math', 'sxm'),
+ ('application/vnd.sun.xml.writer', 'sxw'),
+ ('application/vnd.sun.xml.writer.global', 'sxg'),
+ ('application/vnd.sun.xml.writer.template', 'stw'),
+ ('application/vnd.sun.xml.writer.web', 'stw'),
+# MSO
('application/rtf', 'rtf'),
('text/rtf', 'rtf'),
- ('text/spreadsheet', 'slk'),
+ ('application/msword', 'doc'),
('application/vnd.ms-powerpoint', 'ppt'),
+ ('application/vnd.ms-excel', 'xls'),
+ ('application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', 'xlsx'),
+ ('application/vnd.openxmlformats-officedocument.spreadsheetml.template', 'xltx'),
+ ('application/vnd.openxmlformats-officedocument.presentationml.presentation', 'pptx'),
+ ('application/vnd.openxmlformats-officedocument.presentationml.template', 'ppotx'),
+ ('application/vnd.openxmlformats-officedocument.presentationml.slideshow', 'ppsx'),
+ ('application/vnd.openxmlformats-officedocument.wordprocessingml.document', 'docx'),
+ ('application/vnd.openxmlformats-officedocument.wordprocessingml.template', 'dotx'),
+ ('application/vnd.visio', 'vsd'),
+# W3C
+ ('application/xhtml+xml', 'xhtml'),
+ ('application/mathml+xml', 'mml'),
+ ('text/html', 'html'),
+ ('application/docbook+xml', 'docbook'),
+# misc
+ ('text/spreadsheet', 'slk'),
+ ('application/pdf', 'pdf'),
+ ('application/vnd.corel-draw', 'cdr'),
+ ('application/vnd.lotus-wordpro', 'lwp'),
+ ('application/vnd.lotus-1-2-3', 'wks'),
+ ('application/vnd.wordperfect', 'wpd'),
+ ('application/vnd.ms-works', 'wps'),
+ ('application/x-hwp', 'hwp'),
+ ('application/x-aportisdoc', 'pdb'),
+ ('application/x-pocket-word', 'psw'),
+ ('application/x-t602', '602'),
+# binfilter
+ ('application/x-starcalc', 'sdc'),
+ ('application/vnd.stardivision.calc', 'sdc5'),
+ ('application/x-starchart', 'sds'),
+ ('application/vnd.stardivision.chart', 'sds5'),
+ ('application/x-stardraw', 'sdd_d'),
+ ('application/vnd.stardivision.draw', 'sda5'),
+ ('application/x-starimpress', 'sdd_i'),
+ ('application/vnd.stardivision.impress', 'sdd5'),
+ ('application/vnd.stardivision.impress-packed', 'sdp5'),
+ ('application/x-starmath', 'smf'),
+ ('application/vnd.stardivision.math', 'smf5'),
+ ('application/x-starwriter', 'sdw'),
+ ('application/vnd.stardivision.writer', 'sdw5'),
+ ('application/vnd.stardivision.writer-global', 'sgl5'),
+# graphics
+ ('image/svg+xml', 'svg'),
+ ('image/x-MS-bmp', 'bmp'),
+ ('image/x-wpg', 'wpg'),
+ ('image/vnd.dxf', 'dxf'),
+ ('image/x-emf', 'emf'),
+ ('image/x-eps', 'eps'),
+ ('image/x-met', 'met'),
+ ('image/x-portable-bitmap', 'pbm'),
+ ('image/x-photo-cd', 'pcd'),
+ ('image/x-pict', 'pict'),
+ ('image/x-pcx', 'pcx'),
+ ('image/x-portable-graymap', 'pgm'),
+ ('image/x-portable-pixmap', 'ppm'),
+ ('image/vnd.adobe.photoshop', 'psd'),
+ ('image/x-cmu-raster', 'ras'),
+ ('image/x-sgf', 'sgf'),
+ ('image/x-svm', 'svm'),
+ ('image/x-targa', 'tga'),
+ ('image/tiff', 'tiff'),
+ ('image/x-wmf', 'wmf'),
+ ('image/x-xbitmap', 'xbm'),
+ ('image/x-xpixmap', 'xpm'),
+ ('image/gif', 'gif'),
+ ('image/jpeg', 'jpeg'),
+ ('image/png', 'png'),
]
for (mimetype,extension) in mimetypes:
commit 66fa9be298149f9db2051adf693f84ae92d3af6d
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Feb 9 12:55:53 2012 +0100
get-bugzilla-attachments-by-mimetype: deduplicate
diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype
index f6dba15..c26ec84 100755
--- a/bin/get-bugzilla-attachments-by-mimetype
+++ b/bin/get-bugzilla-attachments-by-mimetype
@@ -114,25 +114,24 @@ redhatbug = 'https://bugzilla.redhat.com/show_bug.cgi?id='
novell = 'https://bugzilla.novell.com/buglist.cgi'
mozilla = 'https://bugzilla.mozilla.org/buglist.cgi'
-get_through_rss_query(freedesktop, 'application/msword', "fdo", "doc")
-get_through_rss_query(freedesktop, 'application/rtf', "fdo", "rtf")
-get_through_rss_query(freedesktop, 'text/rtf', "fdo", "rtf")
-get_through_rss_query(freedesktop, 'text/spreadsheet', "fdo", "slk")
-get_through_rss_query(freedesktop, 'application/vnd.ms-powerpoint', "fdo", "ppt")
+mimetypes = [
+ ('application/msword', 'doc'),
+ ('application/rtf', 'rtf'),
+ ('text/rtf', 'rtf'),
+ ('text/spreadsheet', 'slk'),
+ ('application/vnd.ms-powerpoint', 'ppt'),
+]
-get_through_rpc_query(redhatrpc, redhatbug, 'application/msword', "rhbz", "doc")
-get_through_rpc_query(redhatrpc, redhatbug, 'application/rtf', "rhbz", "rtf")
-get_through_rpc_query(redhatrpc, redhatbug, 'text/rtf', "rhbz", "rtf")
-get_through_rpc_query(redhatrpc, redhatbug, 'text/spreadsheet', "rhbz", "slk")
-get_through_rpc_query(redhatrpc, redhatbug, 'application/vnd.ms-powerpoint', "rhbz", "ppt")
+for (mimetype,extension) in mimetypes:
+ get_through_rss_query(freedesktop, mimetype, "fdo", extension)
+
+for (mimetype,extension) in mimetypes:
+ get_through_rpc_query(redhatrpc, redhatbug, mimetype, "rhbz", extension)
#to-do, get attachments some other way, not inline in xml
#get_through_rss_query(novell, 'application/msword', "n", "doc")
-get_through_rss_query(openoffice, 'application/msword', "ooo", "doc")
-get_through_rss_query(openoffice, 'application/rtf', "ooo", "rtf")
-get_through_rss_query(openoffice, 'text/rtf', "ooo", "rtf")
-get_through_rss_query(openoffice, 'text/spreadsheet', "ooo", "slk")
-get_through_rss_query(openoffice, 'application/vnd.ms-powerpoint', "ooo", "ppt")
+for (mimetype,extension) in mimetypes:
+ get_through_rss_query(openoffice, mimetype, "ooo", extension)
# vim:set shiftwidth=4 softtabstop=4 expandtab:
commit 05c254ca0ecdd88c157a27fc6de561efe71db3e6
Author: Michael Stahl <mstahl at redhat.com>
Date: Thu Feb 9 12:21:34 2012 +0100
get-bugzilla-attachments-by-mimetype: fix it
diff --git a/bin/get-bugzilla-attachments-by-mimetype b/bin/get-bugzilla-attachments-by-mimetype
index 420f6a0..f6dba15 100755
--- a/bin/get-bugzilla-attachments-by-mimetype
+++ b/bin/get-bugzilla-attachments-by-mimetype
@@ -1,4 +1,5 @@
#!/usr/bin/env python
+# -*- coding: utf-8 -*-
# Version: MPL 1.1 / GPLv3+ / LGPLv3+
#
# The contents of this file are subject to the Mozilla Public License Version
@@ -87,7 +88,7 @@ def get_through_rpc_query(rpcurl, showurl, mimetype, prefix, suffix):
url = showurl + str(bug['bug_id'])
get_from_bug_url_via_xml(url, mimetype, prefix, suffix)
except xmlrpclib.Fault, err:
- print "A fault occurred"
+ print "A fault occurred"
print "Fault code: %s" % err.faultCode
print err.faultString
commit 6c3e8f9d19a0392a817c1b5692421ed0972a3b7e
Author: Michael Stahl <mstahl at redhat.com>
Date: Wed Feb 8 23:30:21 2012 +0100
sw: ww8: ~SwIndexReg assertion:
Remove pointless SwPosition that triggers the assertion when loading
bugdoc from fdo#39006 from wwExtraneousParas::delete_all_from_doc.
diff --git a/sw/source/filter/ww8/ww8par.cxx b/sw/source/filter/ww8/ww8par.cxx
index 99a2544..5c74e18 100644
--- a/sw/source/filter/ww8/ww8par.cxx
+++ b/sw/source/filter/ww8/ww8par.cxx
@@ -4134,8 +4134,7 @@ void wwExtraneousParas::delete_all_from_doc()
{
SwTxtNode *pTxtNode = *aI;
SwNodeIndex aIdx(*pTxtNode);
- SwPosition aPos(aIdx);
- SwPaM aTest(aPos);
+ SwPaM aTest(aIdx);
m_rDoc.DelFullPara(aTest);
}
m_aTxtNodes.clear();
More information about the Libreoffice-commits
mailing list