[Libreoffice-commits] core.git: Branch 'private/jmux/mailmerge-fixes' - 253 commits - avmedia/Library_avmedia.mk avmedia/Library_avmediaogl.mk avmedia/source basctl/uiconfig basegfx/source basic/source binaryurp/source bin/distro-install-file-lists bridges/Library_cpp_uno.mk chart2/CppunitTest_chart2_export.mk chart2/CppunitTest_chart2_import.mk chart2/inc chart2/qa chart2/source chart2/uiconfig codemaker/source comphelper/source compilerplugins/clang configure.ac connectivity/source cppu/source cui/AllLangResTarget_cui.mk cui/source cui/uiconfig cui/UIConfig_cui.mk dbaccess/source dbaccess/uiconfig desktop/Library_sofficeapp.mk desktop/source download.lst drawinglayer/source editeng/source extensions/source extensions/uiconfig external/boost external/libgltf extras/source filter/source filter/uiconfig forms/source fpicker/uiconfig framework/source helpcontent2 hwpfilter/source i18npool/source idlc/inc idl/source include/basebmp include/basic include/codemaker include/comphelper include/connectiv ity include/editeng include/LibreOfficeKit include/oox include/sal include/sfx2 include/svl include/svx include/tools include/vcl include/xmloff instsetoo_native/inc_openoffice jvmfwk/source libreofficekit/Executable_gtktiledviewer.mk libreofficekit/Library_libreofficekitgtk.mk libreofficekit/Module_libreofficekit.mk libreofficekit/qa libreofficekit/source lotuswordpro/source officecfg/registry oox/inc oox/source postprocess/qa readlicense_oo/license reportdesign/source RepositoryExternal.mk Repository.mk rsc/source sal/osl sal/qa sc/CppunitTest_sc_annotationobj.mk sc/CppunitTest_sc_annotationshapeobj.mk sc/CppunitTest_sc_annotationsobj.mk sc/CppunitTest_sc_cellrangeobj.mk sc/CppunitTest_sc_chart_regression_test.mk sc/CppunitTest_sc_databaserangeobj.mk sc/CppunitTest_sc_datapilotfieldobj.mk sc/CppunitTest_sc_datapilottableobj.mk sc/CppunitTest_sc_editfieldobj_cell.mk sc/CppunitTest_sc_editfieldobj_header.mk sc/CppunitTest_sc_filters_test.mk sc/CppunitTest_sc_html_export_test.mk sc/C ppunitTest_sc_macros_test.mk sc/CppunitTest_sc_modelobj.mk sc/CppunitTest_sc_namedrangeobj.mk sc/CppunitTest_sc_namedrangesobj.mk sc/CppunitTest_sc_opencl_test.mk sc/CppunitTest_sc_outlineobj.mk sc/CppunitTest_sc_rangelst_test.mk sc/CppunitTest_sc_subsequent_export_test.mk sc/CppunitTest_sc_subsequent_filters_test.mk sc/CppunitTest_sc_tableautoformatfield.mk sc/CppunitTest_sc_tablesheetobj.mk sc/CppunitTest_sc_tablesheetsobj.mk sc/CppunitTest_sc_ucalc.mk sc/inc sc/qa scripting/source scripting/workben sc/source sc/uiconfig sc/workben sd/AllLangResTarget_sd.mk sd/inc sd/qa sd/source sd/uiconfig sd/UIConfig_simpress.mk sd/workben sfx2/source sfx2/uiconfig shell/source smoketest/libtest.cxx soltools/cpp soltools/mkdepend sot/source starmath/inc starmath/source starmath/uiconfig stoc/source svl/Library_svl.mk svl/source svtools/source svtools/uiconfig svx/source svx/uiconfig sw/CppunitTest_sw_uiwriter.mk sw/inc sw/qa sw/source sw/uiconfig toolkit/source tools/source ucb/source unotools/ source vcl/generic vcl/headless vcl/inc vcl/osx vcl/source vcl/uiconfig vcl/unx writerfilter/CustomTarget_source.mk writerfilter/source xmloff/source xmlscript/source xmlsecurity/uiconfig
Jan-Marek Glogowski
glogow at fbihome.de
Fri Jun 27 09:37:51 PDT 2014
Rebased ref, commits from common ancestor:
commit a85a0fe8580b822375e675b1fc9e2e74ba827d60
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date: Mon Jun 23 09:27:27 2014 +0200
MM: always copy the internal document
There is really no need to create the first document via UNO
createClone(), which is also slower then the internal copy.
Actually createClone also calls createCopy, but without
initializing the document.
Change-Id: I23437b0f3ad663942a02be575b39883f9a3b8587
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index a817e41..43dcc8d 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -1005,17 +1005,8 @@ bool SwDBManager::MergeMailFiles(SwWrtShell* pSourceShell,
Application::Reschedule();
// The SfxObjectShell will be closed explicitly later but it is more safe to use SfxObjectShellLock here
- SfxObjectShellLock xWorkDocSh;
// copy the source document
- if( 1 == nDocNo && (bAsSingleFile || rMergeDescriptor.bCreateSingleFile) )
- {
- uno::Reference< util::XCloneable > xClone( pSourceDocSh->GetModel(), uno::UNO_QUERY);
- uno::Reference< lang::XUnoTunnel > xWorkDocShell( xClone->createClone(), uno::UNO_QUERY);
- SwXTextDocument* pWorkModel = reinterpret_cast<SwXTextDocument*>(xWorkDocShell->getSomething(SwXTextDocument::getUnoTunnelId()));
- xWorkDocSh = pWorkModel->GetDocShell();
- }
- else
- xWorkDocSh = pSourceDocSh->GetDoc()->CreateCopy( true );
+ SfxObjectShellLock xWorkDocSh = pSourceDocSh->GetDoc()->CreateCopy( true );
{
//create a view frame for the document
@@ -2802,18 +2793,7 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
// copy the source document
// the copy will be closed later, but it is more safe to use SfxObjectShellLock here
- SfxObjectShellLock xWorkDocSh;
- if(nDocNo == 1 )
- {
- uno::Reference< util::XCloneable > xClone( rSourceView.GetDocShell()->GetModel(), uno::UNO_QUERY);
- uno::Reference< lang::XUnoTunnel > xWorkDocShell( xClone->createClone(), uno::UNO_QUERY);
- SwXTextDocument* pWorkModel = reinterpret_cast<SwXTextDocument*>(xWorkDocShell->getSomething(SwXTextDocument::getUnoTunnelId()));
- xWorkDocSh = pWorkModel->GetDocShell();
- }
- else
- {
- xWorkDocSh = rSourceView.GetDocShell()->GetDoc()->CreateCopy(true);
- }
+ SfxObjectShellLock xWorkDocSh = rSourceView.GetDocShell()->GetDoc()->CreateCopy(true);
#ifdef DBG_UTIL
if ( nDocNo <= MAX_DOC_DUMP )
lcl_SaveDoc( xWorkDocSh, "WorkDoc", nDocNo );
commit 91758d497bdeec9855e4ae1869a54ac74f7d46c4
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date: Fri Jun 27 14:58:24 2014 +0200
Some minor MM code cleanups
Just makes the code in SwFEShell::Paste and
SwDBManager::MergeDocuments more readable.
Change-Id: Ifd78d6a44fa78eaf1f4fca63f4bbd3ee43ca129d
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index a09f923..628d9c1 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -680,7 +680,7 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames, bool bIncludeF
// If there are table formulas in the area, then display the table first
// so that the table formula can calculate a new value first
// (individual boxes in the area are retrieved via the layout)
- SwFieldType* pTblFldTyp = GetDoc()->GetSysFldType( RES_TABLEFLD );
+ SwFieldType* pTblFldTyp = GetDoc()->GetSysFldType( RES_TABLEFLD );
SwTableNode *pDestNd, *pSrcNd = aCpyPam.GetNode().GetTableNode();
if( !pSrcNd ) // TabellenNode ?
@@ -1071,19 +1071,12 @@ bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames, bool bIncludeF
for ( sal_uInt16 i = 0; i < pClpDoc->GetSpzFrmFmts()->size(); ++i )
{
- bool bInsWithFmt = true;
const SwFrmFmt& rCpyFmt = *(*pClpDoc->GetSpzFrmFmts())[i];
- if( bInsWithFmt )
- {
- SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() );
- if ( FLY_AT_PAGE == aAnchor.GetAnchorId() )
- {
- aAnchor.SetPageNum( aAnchor.GetPageNum() + nStartPageNumber - 1 );
- }
- else
- continue;
- GetDoc()->CopyLayoutFmt( rCpyFmt, aAnchor, true, true );
- }
+ SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() );
+ if ( FLY_AT_PAGE != aAnchor.GetAnchorId() )
+ continue;
+ aAnchor.SetPageNum( aAnchor.GetPageNum() + nStartPageNumber - 1 );
+ GetDoc()->CopyLayoutFmt( rCpyFmt, aAnchor, true, true );
}
}
}
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index f900cd4..a817e41 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2883,17 +2883,12 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
}
}
if(nDocNo == 1 || bPageStylesWithHeaderFooter)
- {
pTargetView->GetDocShell()->_LoadStyles( *rSourceView.GetDocShell(), true );
- }
if(nDocNo > 1)
- {
pTargetShell->InsertPageBreak( &sModifiedStartingPageDesc, nStartingPageNo );
- }
else
- {
pTargetShell->SetPageStyle(sModifiedStartingPageDesc);
- }
+
sal_uInt16 nPageCountBefore = pTargetShell->GetPageCnt();
OSL_ENSURE(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended");
bool para_added = false;
@@ -2901,9 +2896,9 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
//#i51359# add a second paragraph in case there's only one
{
SwNodeIndex aIdx( pWorkDoc->GetNodes().GetEndOfExtras(), 2 );
- SwPosition aTestPos( aIdx );
- SwCursor aTestCrsr(aTestPos,0,false);
- if(!aTestCrsr.MovePara(fnParaNext, fnParaStart))
+ SwPosition aTestPos( aIdx );
+ SwCursor aTestCrsr( aTestPos, 0, false );
+ if ( !aTestCrsr.MovePara(fnParaNext, fnParaStart) )
{
//append a paragraph
pWorkDoc->AppendTxtNode( aTestPos );
@@ -2955,7 +2950,7 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
lcl_SaveDoc( xTargetDocShell, "MergeDoc" );
#endif
- //add the document info to the config item
+ // add the document info to the config item
SwDocMergeInfo aMergeInfo;
aMergeInfo.nStartPageInTarget = nPageCountBefore;
aMergeInfo.nEndPageInTarget = pTargetShell->GetPageCnt();
@@ -2967,17 +2962,17 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
for( sal_uInt16 i = 0; i < 25; i++)
Application::Reschedule();
- //restore the ole DBManager
+ // restore the old DBManager
pWorkDoc->SetDBManager( pWorkDBManager );
- //now the temporary document should be closed
- SfxObjectShellRef xDocSh(pWorkView->GetDocShell());
- xDocSh->DoClose();
+ // close the temporary document
+ xWorkDocSh->DoClose();
+
nEndRow = pImpl->pMergeData->xResultSet->getRow();
++nDocNo;
} while( !bCancel &&
(bSynchronizedDoc && (nStartRow != nEndRow)? ExistsNextRecord() : ToNextMergeRecord()));
- //deselect all, go out of the frame and go to the beginning of the document
+ // deselect all, go out of the frame and go to the beginning of the document
Point aPt(LONG_MIN, LONG_MIN);
pTargetShell->SelectObj(aPt, SW_LEAVE_FRAME);
if (pTargetShell->IsSelFrmMode())
commit 18e463bba1502ac083b3b54fa1ed46b026d59041
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date: Fri Jun 27 11:46:00 2014 +0200
MM: fix lost or broken paragraph anchored objects
With the extended SwFEShell::Paste version, we can finally paste
full documents without losing the paragraph anchored Flys of the
first paragraph.
Actually one should be able to drop the InsertPageBreak and the
single paragraph delete, but my attempt resulted in problems with
page anchored Flys and somehow reintroduced the problem seen in
fdo#80395 with draw objects.
Change-Id: I370fa89f432ba4dd95c1f02605f33f04dfbaad85
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index c443b26..f900cd4 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -125,6 +125,8 @@
#include <unomid.h>
#include <section.hxx>
#include <rootfrm.hxx>
+#include <fmtpdsc.hxx>
+#include <ndtxt.hxx>
#include <boost/scoped_ptr.hpp>
@@ -2772,6 +2774,7 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
const SwFrmFmt& rMaster = pSourcePageDesc->GetMaster();
bool bPageStylesWithHeaderFooter = rMaster.GetHeader().IsActive() ||
rMaster.GetFooter().IsActive();
+ SwNodes *pTargetNodes = &pTargetShell->GetDoc()->GetNodes();
// copy compatibility options
lcl_CopyCompatibilityOptions( rSourceShell, *pTargetShell);
@@ -2860,6 +2863,7 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
//#i63806# put the styles to the target document
//if the source uses headers or footers each new copy need to copy a new page styles
+ SwPageDesc* pTargetPageDesc = NULL;
if(bPageStylesWithHeaderFooter)
{
//create a new pagestyle
@@ -2868,7 +2872,7 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
SwDoc* pTargetDoc = pTargetShell->GetDoc();
OUString sNewPageDescName = lcl_FindUniqueName(pTargetShell, sStartingPageDesc, nDocNo );
pTargetShell->GetDoc()->MakePageDesc( sNewPageDescName );
- SwPageDesc* pTargetPageDesc = pTargetShell->FindPageDescByName( sNewPageDescName );
+ pTargetPageDesc = pTargetShell->FindPageDescByName( sNewPageDescName );
const SwPageDesc* pWorkPageDesc = rWorkShell.FindPageDescByName( sStartingPageDesc );
if(pWorkPageDesc && pTargetPageDesc)
@@ -2911,7 +2915,29 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
if ( nDocNo <= MAX_DOC_DUMP )
lcl_SaveDoc( xWorkDocSh, "WorkDoc", nDocNo );
#endif
- pTargetShell->Paste( rWorkShell.GetDoc(), true );
+
+ SwNodeIndex fixupIdx( pTargetNodes->GetEndOfContent(), -1 );
+ pTargetShell->Paste( rWorkShell.GetDoc(), true, true );
+
+ if (bPageStylesWithHeaderFooter) {
+ // set the real page desc and update the number offset for the pasted document
+ fixupIdx += 2;
+ SwTxtNode *aTxtNd = fixupIdx.GetNode().GetTxtNode();
+ if ( aTxtNd ) {
+ SfxPoolItem *pNewItem = aTxtNd->GetAttr( RES_PAGEDESC ).Clone();
+ SwFmtPageDesc *aDesc = dynamic_cast< SwFmtPageDesc* >( pNewItem );
+ if ( aDesc ) {
+ aDesc->SetNumOffset( nStartingPageNo );
+ aDesc->RegisterToPageDesc( *pTargetPageDesc );
+ aTxtNd->SetAttr( *aDesc );
+ }
+ delete pNewItem;
+ }
+
+ // delete the leading empty page from InsertPageBreak
+ fixupIdx -= 2;
+ pTargetNodes->Delete( fixupIdx, 2 );
+ }
if ( para_added ) {
// Move cursor to the start or Delete will assert because
@@ -2921,12 +2947,9 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
pTargetNodes->Delete( aTargetIdx, 1 );
}
- //convert fields in page styles (header/footer - has to be done after the first document has been pasted
- if(1 == nDocNo)
- {
- pTargetShell->CalcLayout();
- pTargetShell->ConvertFieldsToText();
- }
+ // #i72820# calculate layout to be able to find the correct page index
+ pTargetShell->CalcLayout();
+
#ifdef DBG_UTIL
if ( nDocNo <= MAX_DOC_DUMP )
lcl_SaveDoc( xTargetDocShell, "MergeDoc" );
@@ -2935,8 +2958,6 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
//add the document info to the config item
SwDocMergeInfo aMergeInfo;
aMergeInfo.nStartPageInTarget = nPageCountBefore;
- //#i72820# calculate layout to be able to find the correct page index
- pTargetShell->CalcLayout();
aMergeInfo.nEndPageInTarget = pTargetShell->GetPageCnt();
aMergeInfo.nDBRow = nStartRow;
rMMConfig.AddMergedDocument( aMergeInfo );
commit 7e21f93e4615aadfa92c36e5b30bcf80bce3cafc
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date: Fri Jun 27 11:28:02 2014 +0200
MM: fix workaround for single paragraph docs
There is already a workaround for pasting a document with a single
paragraph by appending a dummy empty paragraph to the working copy.
This patch removes the dummy paragraph from the target document.
Change-Id: I288d35264bf6f1a5f92c50d6a309e3bdd4ab5836
diff --git a/sw/source/uibase/dbui/dbmgr.cxx b/sw/source/uibase/dbui/dbmgr.cxx
index 3bd6a15..c443b26 100644
--- a/sw/source/uibase/dbui/dbmgr.cxx
+++ b/sw/source/uibase/dbui/dbmgr.cxx
@@ -2892,6 +2892,8 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
}
sal_uInt16 nPageCountBefore = pTargetShell->GetPageCnt();
OSL_ENSURE(!pTargetShell->GetTableFmt(),"target document ends with a table - paragraph should be appended");
+ bool para_added = false;
+
//#i51359# add a second paragraph in case there's only one
{
SwNodeIndex aIdx( pWorkDoc->GetNodes().GetEndOfExtras(), 2 );
@@ -2901,6 +2903,7 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
{
//append a paragraph
pWorkDoc->AppendTxtNode( aTestPos );
+ para_added = true;
}
}
@@ -2909,6 +2912,15 @@ sal_Int32 SwDBManager::MergeDocuments( SwMailMergeConfigItem& rMMConfig,
lcl_SaveDoc( xWorkDocSh, "WorkDoc", nDocNo );
#endif
pTargetShell->Paste( rWorkShell.GetDoc(), true );
+
+ if ( para_added ) {
+ // Move cursor to the start or Delete will assert because
+ // of the cursors SwIndex ref on the deleting node.
+ pTargetShell->SttEndDoc( true );
+ SwNodeIndex aTargetIdx( pTargetNodes->GetEndOfContent(), -1 );
+ pTargetNodes->Delete( aTargetIdx, 1 );
+ }
+
//convert fields in page styles (header/footer - has to be done after the first document has been pasted
if(1 == nDocNo)
{
commit 4e8d89858eabf6ed75fc802600b75e53aaec1318
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date: Fri Jun 27 11:21:47 2014 +0200
Optionally paste the full document
In the mail merge case we want to paste the full document including
the SwTxtNode containing the SwFmtPageDesc node, which is always
the first node of a document.
For normal paste we want to merge the first paragraph into the
paragraph at the cursor position. This currently loses all Flys
anchored at the first paragraph.
Change-Id: I2b1ce279743f559e700b47276012ad56d74a059c
diff --git a/sw/inc/fesh.hxx b/sw/inc/fesh.hxx
index 9c2e89d..2660c5a 100644
--- a/sw/inc/fesh.hxx
+++ b/sw/inc/fesh.hxx
@@ -219,7 +219,7 @@ public:
/// Copy and Paste methods for internal clipboard.
bool Copy( SwDoc* pClpDoc, const OUString* pNewClpTxt = 0 );
- bool Paste( SwDoc* pClpDoc, bool bIncludingPageFrames = false);
+ bool Paste( SwDoc* pClpDoc, bool bIncludingPageFrames = false, bool bIncludeFullDocument = false);
/// Paste some pages into another doc - used in mailmerge.
bool PastePages( SwFEShell& rToFill, sal_uInt16 nStartPage, sal_uInt16 nEndPage);
diff --git a/sw/source/core/frmedt/fecopy.cxx b/sw/source/core/frmedt/fecopy.cxx
index c980082..a09f923 100644
--- a/sw/source/core/frmedt/fecopy.cxx
+++ b/sw/source/core/frmedt/fecopy.cxx
@@ -668,13 +668,13 @@ namespace {
typedef std::pair< PaMPtr, PositionPtr > Insertion;
}
-bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames )
+bool SwFEShell::Paste( SwDoc* pClpDoc, bool bIncludingPageFrames, bool bIncludeFullDocument )
{
SET_CURR_SHELL( this );
OSL_ENSURE( pClpDoc, "no clipboard document" );
const sal_uInt16 nStartPageNumber = GetPhyPageNum();
// then till end of the nodes array
- SwNodeIndex aIdx( pClpDoc->GetNodes().GetEndOfExtras(), 2 );
+ SwNodeIndex aIdx( pClpDoc->GetNodes().GetEndOfExtras(), (bIncludeFullDocument) ? 1 : 2 );
SwPaM aCpyPam( aIdx ); //DocStart
// If there are table formulas in the area, then display the table first
commit 0ba0aec8f0cc5adbcc992698fb30dcc6c1718375
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date: Mon Jun 23 09:16:18 2014 +0200
Replace the whole content for copied documents
If the document is initialized in CreateCopy, it already contains
the initial empty paragraph. So we have to delete the content from
initial document, as we're going to replace the whole content with
the pasted document.
Change-Id: I33faed4de77919fb926d408e19af9c1ec3b0f7d3
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index a3ee43f..463cb83 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -993,10 +993,10 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
// Based on the simplified codepath from SwFEShell::Paste()
// GetEndOfExtras + 1 = StartOfContent
- SwNodeIndex aSourceIdx( GetNodes().GetEndOfExtras(), 2 );
+ SwNodeIndex aSourceIdx( GetNodes().GetEndOfExtras(), 1 );
SwPaM aCpyPam( aSourceIdx ); // DocStart
- SwNodeIndex aTargetIdx( pRet->GetNodes(), 2 );
+ SwNodeIndex aTargetIdx( pRet->GetNodes().GetEndOfContent() );
SwPaM aInsertPam( aTargetIdx );
aCpyPam.SetMark();
@@ -1041,6 +1041,12 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
// End of SwFEShell::Paste() codepath
+ if ( bCallInitNew ) {
+ // delete leading page / initial content from target document
+ SwNodeIndex aDeleteIdx( pRet->GetNodes().GetEndOfExtras(), 2 );
+ pRet->GetNodes().Delete( aDeleteIdx, 1 );
+ }
+
// remove the temporary shell if it is there as it was done before
pRet->SetTmpDocShell( (SfxObjectShell*)NULL );
commit e91b25d4f4766904aee2f028929666a748f1f7bc
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date: Thu Jun 26 20:23:39 2014 +0200
Merge SwDoc::Paste into SwDoc::CreateCopy
Change-Id: I95686eb116e17b4da6662b4fbadcf08a0b92a6f4
diff --git a/sw/inc/doc.hxx b/sw/inc/doc.hxx
index 75eac11..be6e30a 100644
--- a/sw/inc/doc.hxx
+++ b/sw/inc/doc.hxx
@@ -531,7 +531,6 @@ private:
OUString msDocAccTitle;
void InitTOXTypes();
- void Paste( const SwDoc& );
bool DeleteAndJoinImpl(SwPaM&, const bool);
bool DeleteAndJoinWithRedlineImpl(SwPaM&, const bool unused = false);
bool DeleteRangeImpl(SwPaM&, const bool unused = false);
diff --git a/sw/source/core/doc/docnew.cxx b/sw/source/core/doc/docnew.cxx
index b327449..a3ee43f 100644
--- a/sw/source/core/doc/docnew.cxx
+++ b/sw/source/core/doc/docnew.cxx
@@ -990,37 +990,22 @@ SfxObjectShell* SwDoc::CreateCopy(bool bCallInitNew ) const
pRet->ReplaceStyles(*this);
- // copy content
- pRet->Paste( *this );
+ // Based on the simplified codepath from SwFEShell::Paste()
- // remove the temporary shell if it is there as it was done before
- pRet->SetTmpDocShell( (SfxObjectShell*)NULL );
-
- pRet->release();
-
- return pRetShell;
-}
+ // GetEndOfExtras + 1 = StartOfContent
+ SwNodeIndex aSourceIdx( GetNodes().GetEndOfExtras(), 2 );
+ SwPaM aCpyPam( aSourceIdx ); // DocStart
-// copy document content - code from SwFEShell::Paste( SwDoc* )
-void SwDoc::Paste( const SwDoc& rSource )
-{
- // this has to be empty const sal_uInt16 nStartPageNumber = GetPhyPageNum();
- // until the end of the NodesArray
- SwNodeIndex aSourceIdx( rSource.GetNodes().GetEndOfExtras(), 2 );
- SwPaM aCpyPam( aSourceIdx ); //DocStart
- SwNodeIndex aTargetIdx( GetNodes().GetEndOfExtras(), 2 );
- SwPaM aInsertPam( aTargetIdx ); //replaces PCURCRSR from SwFEShell::Paste()
+ SwNodeIndex aTargetIdx( pRet->GetNodes(), 2 );
+ SwPaM aInsertPam( aTargetIdx );
aCpyPam.SetMark();
aCpyPam.Move( fnMoveForward, fnGoDoc );
- this->GetIDocumentUndoRedo().StartUndo( UNDO_INSGLOSSARY, NULL );
- this->LockExpFlds();
+ pRet->LockExpFlds();
{
SwPosition& rInsPos = *aInsertPam.GetPoint();
- //find out if the clipboard document starts with a table
- bool bStartWithTable = 0 != aCpyPam.Start()->nNode.GetNode().FindTableNode();
SwPosition aInsertPosition( rInsPos );
{
@@ -1028,7 +1013,7 @@ void SwDoc::Paste( const SwDoc& rSource )
aIndexBefore--;
- rSource.CopyRange( aCpyPam, rInsPos, true );
+ CopyRange( aCpyPam, rInsPos, true );
// Note: aCpyPam is invalid now
++aIndexBefore;
@@ -1037,38 +1022,31 @@ void SwDoc::Paste( const SwDoc& rSource )
aPaM.GetDoc()->MakeUniqueNumRules(aPaM);
- // No need to update the rsid, as this is an empty doc
+ // No need to update the rsid, as pRet is an empty doc
}
- //TODO: Is this necessary here? SaveTblBoxCntnt( &rInsPos );
- if(/*bIncludingPageFrames && */bStartWithTable)
+ // additionally copy page bound frames
+ for ( sal_uInt16 i = 0; i < GetSpzFrmFmts()->size(); ++i )
{
- //remove the paragraph in front of the table
- SwPaM aPara(aInsertPosition);
- this->DelFullPara(aPara);
- }
- //additionally copy page bound frames
- if( /*bIncludingPageFrames && */rSource.GetSpzFrmFmts()->size() )
- {
- for ( sal_uInt16 i = 0; i < rSource.GetSpzFrmFmts()->size(); ++i )
- {
- const SwFrmFmt& rCpyFmt = *(*rSource.GetSpzFrmFmts())[i];
- SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() );
- if (FLY_AT_PAGE == aAnchor.GetAnchorId())
- {
- aAnchor.SetPageNum( aAnchor.GetPageNum() /*+ nStartPageNumber - */);
- }
- else
- continue;
- this->CopyLayoutFmt( rCpyFmt, aAnchor, true, true );
- }
+ const SwFrmFmt& rCpyFmt = *(*GetSpzFrmFmts())[i];
+ SwFmtAnchor aAnchor( rCpyFmt.GetAnchor() );
+ if (FLY_AT_PAGE != aAnchor.GetAnchorId())
+ continue;
+ pRet->CopyLayoutFmt( rCpyFmt, aAnchor, true, true );
}
}
- this->GetIDocumentUndoRedo().EndUndo( UNDO_INSGLOSSARY, NULL );
+ pRet->UnlockExpFlds();
+ pRet->UpdateFlds( NULL, false );
+
+ // End of SwFEShell::Paste() codepath
- UnlockExpFlds();
- UpdateFlds(NULL, false);
+ // remove the temporary shell if it is there as it was done before
+ pRet->SetTmpDocShell( (SfxObjectShell*)NULL );
+
+ pRet->release();
+
+ return pRetShell;
}
sal_uInt16 SwTxtFmtColls::GetPos(const SwTxtFmtColl* p) const
commit 8d511801a9a1abe0bed1acf16be828145d7a91c6
Author: Jan-Marek Glogowski <glogow at fbihome.de>
Date: Fri Jun 13 14:44:37 2014 +0200
Revert "fdo#66145: do not check IsFirstShared() in SwPageDesc::GetLeftFmt()"
This reverts commit 4df438c9a9d5e698c47c1e85903eb81880a5e6fa.
Change-Id: I8f8d32c07f8706fad6c62fba2a9a373feed6cbed
diff --git a/sw/source/core/layout/pagedesc.cxx b/sw/source/core/layout/pagedesc.cxx
index e7641f2..42c7cc4 100644
--- a/sw/source/core/layout/pagedesc.cxx
+++ b/sw/source/core/layout/pagedesc.cxx
@@ -305,14 +305,14 @@ bool SwPageDesc::IsFollowNextPageOfNode( const SwNode& rNd ) const
SwFrmFmt *SwPageDesc::GetLeftFmt(bool const bFirst)
{
return (nsUseOnPage::PD_LEFT & eUse)
- ? ((bFirst) ? &m_FirstLeft : &aLeft)
+ ? ((bFirst && !IsFirstShared()) ? &m_FirstLeft : &aLeft)
: 0;
}
SwFrmFmt *SwPageDesc::GetRightFmt(bool const bFirst)
{
return (nsUseOnPage::PD_RIGHT & eUse)
- ? ((bFirst) ? &m_FirstMaster : &aMaster)
+ ? ((bFirst && !IsFirstShared()) ? &m_FirstMaster : &aMaster)
: 0;
}
commit 2709ff61d38db36d494b850a53968ca8bb2878a4
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date: Thu Jun 26 10:13:23 2014 +0100
libreofficekitgtk requires ENABLE_GTK.
Change-Id: I2ba47edc457e310548c8a62747a6a152ee5e1314
diff --git a/libreofficekit/Module_libreofficekit.mk b/libreofficekit/Module_libreofficekit.mk
index 55136a4..b349a5d 100644
--- a/libreofficekit/Module_libreofficekit.mk
+++ b/libreofficekit/Module_libreofficekit.mk
@@ -13,11 +13,11 @@ ifeq ($(OS),LINUX)
$(eval $(call gb_Module_add_targets,libreofficekit,\
StaticLibrary_libreofficekit \
- Library_libreofficekitgtk \
))
ifneq ($(ENABLE_GTK),)
$(eval $(call gb_Module_add_targets,libreofficekit,\
+ Library_libreofficekitgtk \
Executable_gtktiledviewer \
))
endif # ($(ENABLE_GTK),)
commit 03d4d4b3f2a5309f3eb6b2bd9073f016e08fd3df
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 27 09:13:00 2014 +0200
loplugin:unreffun
Change-Id: I2afc1cd5ed813f768f06ad0db651fb9e8e81d844
diff --git a/vcl/source/glyphs/graphite_layout.cxx b/vcl/source/glyphs/graphite_layout.cxx
index 5343577..b365eb3 100644
--- a/vcl/source/glyphs/graphite_layout.cxx
+++ b/vcl/source/glyphs/graphite_layout.cxx
@@ -95,16 +95,6 @@ namespace
return !(b > i) && i < e;
}
- template<typename T>
- inline bool is_subrange(const T sb, const T se, const T b, const T e) {
- return !(b > sb || se > e);
- }
-
- template<typename T>
- inline bool is_subrange(const std::pair<T, T> &s, const T b, const T e) {
- return is_subrange(s.first, s.second, b, e);
- }
-
int findSameDirLimit(const sal_Unicode* buffer, int charCount, bool rtl)
{
UErrorCode status = U_ZERO_ERROR;
commit 6bd609d8451c08504c47c86196c508a7022dd4b7
Author: Ravindra Vidhate <ravindra.vidhate at synerzip.com>
Date: Tue Jun 24 17:54:59 2014 +0530
fdo#80097 : tblBorders and tcBorders are not preserved for the table.
When we have multiple tables inside a table, the tblBorders and
tcBorders of the inside tables are not getting preserved.
The issue is m_aTableStyleConf is not clear when the LO starts
writing the properties of the inside table.
Change-Id: I30081b8a5a59614430a2279550ae7eb589cb71ec
Reviewed-on: https://gerrit.libreoffice.org/9893
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
Tested-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/qa/extras/ooxmlexport/data/fdo80097.docx b/sw/qa/extras/ooxmlexport/data/fdo80097.docx
new file mode 100644
index 0000000..3f8ba9f
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/fdo80097.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
index 35986b3..8683d56 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport.cxx
@@ -3615,6 +3615,57 @@ DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsb, "fdo79969_xlsb.docx")
"/word/embeddings/oleObject1.xlsb");
}
+DECLARE_OOXMLEXPORT_TEST(testfdo80097, "fdo80097.docx")
+{
+ //fdo#76635 : Table borders are not getting preserved.
+
+ xmlDocPtr pXmlDocument = parseExport("word/document.xml");
+ if (!pXmlDocument)
+ return;
+
+ //Table Borders
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:top[@w:val = 'single']",1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:top[@w:sz = 4]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:top[@w:space = 0]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:top[@w:color = '00000A']", 1);
+
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:val = 'single']",1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:sz = 4]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:space = 0]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:bottom[@w:color = '00000A']", 1);
+
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:val = 'single']",1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:sz = 4]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:space = 0]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideH[@w:color = '00000A']", 1);
+
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:val = 'single']",1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:sz = 4]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:space = 0]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tblPr/w:tblBorders/w:insideV[@w:color = '00000A']", 1);
+
+ //Table Cell Borders
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:val = 'single']",1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:sz = 4]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:space = 0]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:top[@w:color = '00000A']", 1);
+
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:val = 'single']",1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:sz = 4]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:space = 0]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:bottom[@w:color = '00000A']", 1);
+
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH[@w:val = 'single']",1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH[@w:sz = 4]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH[@w:space = 0]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideH[@w:color = '00000A']", 1);
+
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV[@w:val = 'single']",1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV[@w:sz = 4]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV[@w:space = 0]", 1);
+ assertXPath(pXmlDocument, "/w:document/w:body/w:tbl/w:tr[1]/w:tc[1]/w:tbl/w:tr[1]/w:tc[1]/w:tcPr/w:tcBorders/w:insideV[@w:color = '00000A']", 1);
+}
+
DECLARE_OOXMLEXPORT_TEST(testfdo79969_xlsm, "fdo79969_xlsm.docx")
{
// This UT for DOCX embedded with excel work sheet.
diff --git a/sw/source/filter/ww8/docxattributeoutput.cxx b/sw/source/filter/ww8/docxattributeoutput.cxx
index 06230f4..3b74b5b 100644
--- a/sw/source/filter/ww8/docxattributeoutput.cxx
+++ b/sw/source/filter/ww8/docxattributeoutput.cxx
@@ -2942,6 +2942,11 @@ void DocxAttributeOutput::TableDefinition( ww8::WW8TableNodeInfoInner::Pointer_t
std::map<OUString, com::sun::star::uno::Any> aGrabBag =
sw::util::HasItem<SfxGrabBagItem>( pTblFmt->GetAttrSet(), RES_FRMATR_GRABBAG )->GetGrabBag();
+ // We should clear the TableStyle map. In case of Table inside multiple tables it contains the
+ // table border style of the previous table.
+ if (! m_aTableStyleConf.empty())
+ m_aTableStyleConf.clear();
+
// Extract properties from grab bag
std::map<OUString, com::sun::star::uno::Any>::iterator aGrabBagElement;
for( aGrabBagElement = aGrabBag.begin(); aGrabBagElement != aGrabBag.end(); ++aGrabBagElement )
commit ffd9c70da13aae4d9c806ae5b1c0947a2fcc26b5
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Jun 27 09:05:02 2014 +0200
error: 'xFieldProperites' was not declared in this scope
Change-Id: Id50cc01ca9726a24da38d4952a30cf7343e8bdfc
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 1cf35e2..20fcbfc 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -4053,7 +4053,7 @@ void DomainMapper_Impl::PopFieldContext()
if (!pContext->GetResult().isEmpty())
{
uno::Reference< beans::XPropertySet > xFieldProperties = pContext->GetCustomField();
- if(xFieldProperites.is())
+ if(xFieldProperties.is())
SetNumberFormat( pContext->GetResult(), xFieldProperties, true );
SetFieldResult( pContext->GetResult() );
}
commit e4b7da8da851371bd09f4d0e1721626667e56605
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 27 08:59:59 2014 +0200
Dead declarations
Change-Id: I43e388df118b9e08ab8c05cad31871ef0af35164
diff --git a/jvmfwk/source/fwkbase.hxx b/jvmfwk/source/fwkbase.hxx
index 86fde79..89e7b57 100644
--- a/jvmfwk/source/fwkbase.hxx
+++ b/jvmfwk/source/fwkbase.hxx
@@ -120,8 +120,6 @@ OString getSharedSettingsPath();
*/
OString getVendorSettingsPath();
-OUString buildClassPathFromDirectory(const OUString & relPath);
-
/** Called from writeJavaInfoData. It sets the process identifier. When
java is to be started, then the current id is compared to the one set by
this function. If they are identical then the Java was selected in the
diff --git a/jvmfwk/source/fwkutil.hxx b/jvmfwk/source/fwkutil.hxx
index e786943..8bd3466 100644
--- a/jvmfwk/source/fwkutil.hxx
+++ b/jvmfwk/source/fwkutil.hxx
@@ -122,8 +122,6 @@ FileStatus checkFileURL(const OUString & path);
bool isAccessibilitySupportDesired();
-OUString buildClassPathFromDirectory(const OUString & relPath);
-
OUString retrieveClassPath( OUString const & macro );
}
#endif
commit 9b04093e9ab67428276f27a5819d45675a8b3f9a
Author: Charu Tyagi <charu.tyagi at ericsson.com>
Date: Wed Jun 25 15:51:10 2014 +0530
fdo#74745: (DOCX) Number formatting for custom document properties.
Change-Id: Ifb9ef14180cac84fd111d81b9535266476d5f04f
Reviewed-on: https://gerrit.libreoffice.org/9896
Reviewed-by: Muthu Subramanian K <muthusuba at gmail.com>
Tested-by: Muthu Subramanian K <muthusuba at gmail.com>
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.cxx b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
index 89edfc4..1cf35e2 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.cxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.cxx
@@ -52,7 +52,9 @@
#include <com/sun/star/text/XRedline.hpp>
#include <com/sun/star/text/XTextFieldsSupplier.hpp>
#include <com/sun/star/style/DropCapFormat.hpp>
+#include <com/sun/star/util/NumberFormatter.hpp>
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
+#include <com/sun/star/util/XNumberFormatter.hpp>
#include <com/sun/star/document/XViewDataSupplier.hpp>
#include <com/sun/star/container/XIndexContainer.hpp>
#include <com/sun/star/awt/XControlModel.hpp>
@@ -2215,7 +2217,7 @@ void DomainMapper_Impl::GetCurrentLocale(lang::Locale& rLocale)
format to the XPropertySet
-----------------------------------------------------------------------*/
void DomainMapper_Impl::SetNumberFormat( const OUString& rCommand,
- uno::Reference< beans::XPropertySet >& xPropertySet )
+ uno::Reference< beans::XPropertySet >& xPropertySet, bool bDetectFormat )
{
OUString sFormatString = lcl_ParseFormat( rCommand );
// find \h - hijri/luna calendar todo: what about saka/era calendar?
@@ -2231,8 +2233,18 @@ void DomainMapper_Impl::SetNumberFormat( const OUString& rCommand,
//get the number formatter and convert the string to a format value
try
{
+ sal_Int32 nKey = 0;
uno::Reference< util::XNumberFormatsSupplier > xNumberSupplier( m_xTextDocument, uno::UNO_QUERY_THROW );
- sal_Int32 nKey = xNumberSupplier->getNumberFormats()->addNewConverted( sFormat, aUSLocale, aCurrentLocale );
+ if( bDetectFormat )
+ {
+ uno::Reference< util::XNumberFormatter> xFormatter( ::com::sun::star::util::NumberFormatter::create( m_xComponentContext ), uno::UNO_QUERY_THROW );
+ xFormatter->attachNumberFormatsSupplier( xNumberSupplier );
+ nKey = xFormatter->detectNumberFormat( 0, rCommand );
+ }
+ else
+ {
+ nKey = xNumberSupplier->getNumberFormats()->addNewConverted( sFormat, aUSLocale, aCurrentLocale );
+ }
xPropertySet->setPropertyValue(
PropertyNameSupplier::GetPropertyNameSupplier().GetName(PROP_NUMBER_FORMAT),
uno::makeAny( nKey ));
@@ -2797,8 +2809,11 @@ void DomainMapper_Impl::handleAuthor
uno::Reference< beans::XPropertySet >( xFieldInterface,
uno::UNO_QUERY_THROW);
if( bIsCustomField )
+ {
xFieldProperties->setPropertyValue(
rPropNameSupplier.GetName(PROP_NAME), uno::makeAny(rFirstParam));
+ pContext->SetCustomField( xFieldProperties );
+ }
else
{
if(0 != (aDocProperties[nMap].nFlags & SET_ARABIC))
@@ -4036,7 +4051,12 @@ void DomainMapper_Impl::PopFieldContext()
CloseFieldCommand();
if (!pContext->GetResult().isEmpty())
- SetFieldResult(pContext->GetResult());
+ {
+ uno::Reference< beans::XPropertySet > xFieldProperties = pContext->GetCustomField();
+ if(xFieldProperites.is())
+ SetNumberFormat( pContext->GetResult(), xFieldProperties, true );
+ SetFieldResult( pContext->GetResult() );
+ }
//insert the field, TC or TOC
uno::Reference< text::XTextAppend > xTextAppend;
diff --git a/writerfilter/source/dmapper/DomainMapper_Impl.hxx b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
index 97b2e1e..a09e8b9 100644
--- a/writerfilter/source/dmapper/DomainMapper_Impl.hxx
+++ b/writerfilter/source/dmapper/DomainMapper_Impl.hxx
@@ -128,6 +128,7 @@ class FieldContext
::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField > m_xFormField;
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xTOC;//TOX
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xTC;//TOX entry
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > m_xCustomField;
OUString m_sHyperlinkURL;
FFDataHandler::Pointer_t m_pFFDataHandler;
FormControlHelper::Pointer_t m_pFormControlHelper;
@@ -147,6 +148,8 @@ public:
void SetCommandCompleted() { m_bFieldCommandCompleted = true; }
bool IsCommandCompleted() const { return m_bFieldCommandCompleted; }
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > GetCustomField() const { return m_xCustomField; }
+ void SetCustomField( ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet > xCustomField ) { m_xCustomField = xCustomField; }
::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > GetTextField() const { return m_xTextField;}
void SetTextField(::com::sun::star::uno::Reference< ::com::sun::star::text::XTextField > xTextField) { m_xTextField = xTextField;}
::com::sun::star::uno::Reference< ::com::sun::star::text::XFormField > GetFormField() const { return m_xFormField;}
@@ -401,7 +404,7 @@ private:
void GetCurrentLocale(::com::sun::star::lang::Locale& rLocale);
void SetNumberFormat( const OUString& rCommand,
- ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xPropertySet );
+ ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xPropertySet, bool bDetectFormat = false );
::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >
FindOrCreateFieldMaster( const sal_Char* pFieldMasterService,
const OUString& rFieldMasterName )
commit 9a741fcad458875a806295ddbd41b68d82ce9095
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jun 27 07:51:25 2014 +0200
loplugin:unreffun: also warn about unused function templates
Change-Id: I4a6280f47ca3c4a77b4e42fe05d79ded7fc30ef1
diff --git a/compilerplugins/clang/unreffun.cxx b/compilerplugins/clang/unreffun.cxx
index eece97f..8c726e3 100644
--- a/compilerplugins/clang/unreffun.cxx
+++ b/compilerplugins/clang/unreffun.cxx
@@ -60,12 +60,12 @@ bool UnrefFun::VisitFunctionDecl(FunctionDecl const * decl) {
return true;
}
- //TODO, filtering out anything template for now:
- if (decl->isDependentContext()) {
- return true;
- }
+ //TODO, filtering out any functions relating to (class) templates for now:
CXXRecordDecl const * r = dyn_cast<CXXRecordDecl>(decl->getDeclContext());;
- if (r != nullptr && r->getTemplateSpecializationKind() != TSK_Undeclared) {
+ if (r != nullptr
+ && (r->getTemplateSpecializationKind() != TSK_Undeclared
+ || r->isDependentContext()))
+ {
return true;
}
@@ -81,6 +81,9 @@ bool UnrefFun::VisitFunctionDecl(FunctionDecl const * decl) {
compiler.getSourceManager().getSpellingLoc(
canon->getNameInfo().getLoc()))
|| canon->isMain()
+ || (decl->getTemplatedKind() == FunctionDecl::TK_FunctionTemplate
+ && (decl->getDescribedFunctionTemplate()->spec_begin()
+ != decl->getDescribedFunctionTemplate()->spec_end()))
|| (compiler.getDiagnostics().getDiagnosticLevel(
diag::warn_unused_function, decl->getLocation())
< DiagnosticsEngine::Warning))
@@ -102,13 +105,15 @@ bool UnrefFun::VisitFunctionDecl(FunctionDecl const * decl) {
(canon->isDefined()
#if (__clang_major__ == 3 && __clang_minor__ >= 4) || __clang_major__ > 3
? (canon->isExternallyVisible()
- ? "Unreferenced externally visible function definition"
- : "Unreferenced externally invisible function definition")
+ ? "Unreferenced externally visible function%0 definition"
+ : "Unreferenced externally invisible function%0 definition")
#else
- ? "Unreferenced function definition"
+ ? "Unreferenced function%0 definition"
#endif
- : "Unreferenced function declaration"),
+ : "Unreferenced function%0 declaration"),
decl->getLocation())
+ << (decl->getTemplatedKind() == FunctionDecl::TK_FunctionTemplate
+ ? " template" : "")
<< decl->getSourceRange();
if (canon->isDefined() && !compat::isFirstDecl(*decl)) {
report(
diff --git a/extensions/source/propctrlr/xsddatatypes.cxx b/extensions/source/propctrlr/xsddatatypes.cxx
index 2abf09f..27c6027 100644
--- a/extensions/source/propctrlr/xsddatatypes.cxx
+++ b/extensions/source/propctrlr/xsddatatypes.cxx
@@ -34,24 +34,6 @@ namespace pcr
using namespace ::com::sun::star::xsd;
using namespace ::com::sun::star::beans;
-
- //= helper
-
-
- template< typename INTERFACE, typename ARGUMENT >
- void setSave( INTERFACE* pObject, void ( SAL_CALL INTERFACE::*pSetter )( ARGUMENT ), ARGUMENT _rArg )
- {
- try
- {
- (pObject->*pSetter)( _rArg );
- }
- catch( const Exception& )
- {
- OSL_FAIL( "XSDDataType: setSave: caught an exception!" );
- }
- }
-
-
template< typename INTERFACE, typename ARGUMENT >
ARGUMENT getSave( INTERFACE* pObject, ARGUMENT ( SAL_CALL INTERFACE::*pGetter )( ) )
{
@@ -67,25 +49,6 @@ namespace pcr
return aReturn;
}
- template< typename FACETTYPE >
- FACETTYPE getFacet( const Reference< XPropertySet >& _rxFacets, const OUString& _rFacetName )
- {
- FACETTYPE aReturn;
- try
- {
- OSL_VERIFY( _rxFacets->getPropertyValue( _rFacetName ) >>= aReturn );
- }
- catch( const Exception& )
- {
- OSL_FAIL( "XSDDataType: getFacet: caught an exception!" );
- }
- return aReturn;
- }
-
-
- //= XSDDataType
-
-
XSDDataType::XSDDataType( const Reference< XDataType >& _rxDataType )
:m_xDataType( _rxDataType )
,m_refCount( 0 )
diff --git a/sal/qa/rtl/oustring/rtl_OUString2.cxx b/sal/qa/rtl/oustring/rtl_OUString2.cxx
index 27a06ab..95940f7 100644
--- a/sal/qa/rtl/oustring/rtl_OUString2.cxx
+++ b/sal/qa/rtl/oustring/rtl_OUString2.cxx
@@ -212,77 +212,6 @@ public:
CPPUNIT_TEST_SUITE_END();
}; // class number
-// testing the method toDouble()
-
-template<class T>
-sal_Int16 SAL_CALL checkPrecisionSize()
-{
- // sal_Int16 nSize = sizeof(T);
- volatile T nCalcValue = 1.0;
-
- // (i + 1) is the current precision
- // numerical series
- // 1.1
- // 10.1
- // 100.1
- // ...
- // 1000...0.1
-
- sal_Int16 i = 0;
- for (i=0;i<50;i++)
- {
- nCalcValue *= 10;
- volatile T nValue = nCalcValue + static_cast<T>(0.1);
- volatile T dSub = nValue - nCalcValue;
- // ----- 0.11 ---- 0.1 ---- 0.09 -----
- if (0.11 > dSub && dSub > 0.09)
- {
- // due to the fact, that the value is break down we sub 1 from the precision value
- // but to suppress this, we start at zero, precision is i+1 till here --i;
- break;
- }
- }
-
- sal_Int16 j= 0;
- nCalcValue = 1.0;
-
- // numerical series
- // 1.1
- // 1.01
- // 1.001
- // ...
- // 1.000...001
-
- for (j=0;j<50;j++)
- {
- nCalcValue /= 10;
- volatile T nValue = nCalcValue + static_cast<T>(1.0);
- volatile T dSub = nValue - static_cast<T>(1.0);
- // ---- 0.02 ----- 0.01 ---- 0 --- -0.99 ---- -0.98 ----
- // volatile T dSubAbsolut = fabs(dSub);
- // ---- 0.02 ----- 0.01 ---- 0 (cut)
- if ( dSub == 0)
- break;
- }
- if (i != j)
- {
- // hmmm....
- // imho i +- 1 == j is a good value
- int n = i - j;
- if (n < 0) n = -n;
- if (n <= 1)
- {
- return std::min(i,j);
- }
- else
- {
- printf("warning: presision differs more than 1!\n");
- }
- }
-
- return i;
-}
-
class toInt: public CppUnit::TestFixture {
public:
void test() {
diff --git a/sc/source/core/data/dociter.cxx b/sc/source/core/data/dociter.cxx
index 568e5f5..d6799d2 100644
--- a/sc/source/core/data/dociter.cxx
+++ b/sc/source/core/data/dociter.cxx
@@ -74,22 +74,6 @@ void decBlock(std::pair<_Iter, size_t>& rPos)
rPos.second = rPos.first->size - 1;
}
-template<typename _Iter>
-void incPos(std::pair<_Iter, size_t>& rPos)
-{
- if (rPos.second + 1 < rPos.first->size)
- // Increment within the block.
- ++rPos.second;
- else
- incBlock(rPos);
-}
-
-template<typename _Iter>
-size_t toLogicalPos(const std::pair<_Iter, size_t>& rPos)
-{
- return rPos.first->position + rPos.second;
-}
-
}
void ScAttrArray_IterGetNumberFormat( sal_uLong& nFormat, const ScAttrArray*& rpArr,
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 304767a..2af5383 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3986,21 +3986,6 @@ bool ScCompiler::HandleExternalReference(const FormulaToken& _aToken)
return true;
}
-template< typename T, typename S >
-static S lcl_adjval( S& n, T pos, T max, bool bRel )
-{
- max++;
- if( bRel )
- n = sal::static_int_cast<S>( n + pos );
- if( n < 0 )
- n = sal::static_int_cast<S>( n + max );
- else if( n >= max )
- n = sal::static_int_cast<S>( n - max );
- if( bRel )
- n = sal::static_int_cast<S>( n - pos );
- return n;
-}
-
// reference of named range with relative references
void ScCompiler::SetRelNameReference()
diff --git a/sc/source/core/tool/rangelst.cxx b/sc/source/core/tool/rangelst.cxx
index e2e63fd..6e276bc 100644
--- a/sc/source/core/tool/rangelst.cxx
+++ b/sc/source/core/tool/rangelst.cxx
@@ -581,30 +581,6 @@ bool handleOneRange( const ScRange& rDeleteRange, ScRange* p )
return false;
}
-/**
- * Check if the deleting range cuts the test range in the middle, to
- * separate it into exactly two pieces.
- *
- * Either
- * +--------+ +--+-+--+
- * | | | |x| |
- * +--------+ | |x| |
- * |xxxxxxxx| or | |x| |
- * +--------+ | |x| |
- * | | | |x| |
- * +--------+ +--+-+--+
- * where xxx is the deleted region.
- */
-template<typename X, typename Y>
-bool checkForTwoRangesCase2(
- X nDeleteX1, X nDeleteX2, Y nDeleteY1, Y nDeleteY2, X nX1, X nX2, Y nY1, Y nY2)
-{
- if (nY1 < nDeleteY1 && nDeleteY2 < nY2 && nDeleteX1 <= nX1 && nX2 <= nDeleteX2)
- return true;
-
- return false;
-}
-
bool handleTwoRanges( const ScRange& rDeleteRange, ScRange* p, std::vector<ScRange>& rNewRanges )
{
const ScAddress& rDelStart = rDeleteRange.aStart;
diff --git a/sc/source/core/tool/refupdat.cxx b/sc/source/core/tool/refupdat.cxx
index 7cab899..b8c21d7 100644
--- a/sc/source/core/tool/refupdat.cxx
+++ b/sc/source/core/tool/refupdat.cxx
@@ -129,63 +129,6 @@ static void lcl_MoveItWrap( R& rRef, S nDelta, U nMask )
}
template< typename R, typename S, typename U >
-static bool lcl_MoveRefPart( R& rRef1Val, bool& rRef1Del, bool bDo1,
- R& rRef2Val, bool& rRef2Del, bool bDo2,
- U nStart, U nEnd, S nDelta, U nMask )
-{
- if ( nDelta )
- {
- bool bDel, bCut1, bCut2;
- bDel = bCut1 = bCut2 = false;
- S n;
- if (bDo1 && bDo2)
- {
- if ( nDelta < 0 )
- {
- n = nStart + nDelta;
- if ( n <= rRef1Val && rRef1Val < nStart
- && n <= rRef2Val && rRef2Val < nStart )
- bDel = true;
- }
- else
- {
- n = nEnd + nDelta;
- if ( nEnd < rRef1Val && rRef1Val <= n
- && nEnd < rRef2Val && rRef2Val <= n )
- bDel = true;
- }
- }
- if ( bDel )
- { // move deleted along
- rRef1Val = sal::static_int_cast<R>( rRef1Val + nDelta );
- rRef2Val = sal::static_int_cast<R>( rRef2Val + nDelta );
- }
- else
- {
- if (bDo1)
- {
- if ( rRef1Del )
- rRef1Val = sal::static_int_cast<R>( rRef1Val + nDelta );
- else
- bCut1 = lcl_MoveStart( rRef1Val, nStart, nDelta, nMask );
- }
- if (bDo2)
- {
- if ( rRef2Del )
- rRef2Val = sal::static_int_cast<R>( rRef2Val + nDelta );
- else
- bCut2 = lcl_MoveEnd( rRef2Val, nStart, nDelta, nMask );
- }
- }
- if ( bDel || (bCut1 && bCut2) )
- rRef1Del = rRef2Del = true;
- return bDel || bCut1 || bCut2 || rRef1Del || rRef2Del;
- }
- else
- return false;
-}
-
-template< typename R, typename S, typename U >
bool IsExpand( R n1, R n2, U nStart, S nD )
{ //! vor normalem Move...
return
diff --git a/sc/source/filter/oox/condformatbuffer.cxx b/sc/source/filter/oox/condformatbuffer.cxx
index 7dd7847..5cd7360 100644
--- a/sc/source/filter/oox/condformatbuffer.cxx
+++ b/sc/source/filter/oox/condformatbuffer.cxx
@@ -116,14 +116,6 @@ const sal_uInt16 BIFF12_CFRULE_ABOVEAVERAGE = 0x0004;
const sal_uInt16 BIFF12_CFRULE_BOTTOM = 0x0008;
const sal_uInt16 BIFF12_CFRULE_PERCENT = 0x0010;
-template< typename Type >
-void lclAppendProperty( ::std::vector< PropertyValue >& orProps, const OUString& rPropName, const Type& rValue )
-{
- orProps.push_back( PropertyValue() );
- orProps.back().Name = rPropName;
- orProps.back().Value <<= rValue;
-}
-
void SetCfvoData( ColorScaleRuleModelEntry* pEntry, const AttributeList& rAttribs )
{
OUString aType = rAttribs.getString( XML_type, OUString() );
diff --git a/toolkit/source/controls/unocontrolmodel.cxx b/toolkit/source/controls/unocontrolmodel.cxx
index 31c76bd..d7f8f5d 100644
--- a/toolkit/source/controls/unocontrolmodel.cxx
+++ b/toolkit/source/controls/unocontrolmodel.cxx
@@ -1040,19 +1040,6 @@ sal_Bool UnoControlModel::supportsService( const OUString& rServiceName ) throw(
return Sequence< OUString >( &sName, 1 );
}
-
-template <class TYPE>
-bool convertType(Any& _rConvertedValue, const Any& _rNewValueTest, const TYPE* /* _pTypeDisambiguation */)
-{
- TYPE tValue;
- if (_rNewValueTest >>= tValue)
- {
- _rConvertedValue <<= tValue;
- return true;
- }
-}
-
-
sal_Bool UnoControlModel::convertFastPropertyValue( Any & rConvertedValue, Any & rOldValue, sal_Int32 nPropId, const Any& rValue ) throw (IllegalArgumentException)
{
::osl::Guard< ::osl::Mutex > aGuard( GetMutex() );
commit 3c6e378fd81b2bfd8a35e12557a90fa40428920e
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Jun 26 23:25:21 2014 -0400
Make these non inline.
Don't do this please...
Change-Id: Id90490622bca10beabf7a1c92e51e55bc72a1db8
diff --git a/sc/inc/refhint.hxx b/sc/inc/refhint.hxx
index f8a6df7..1f92731 100644
--- a/sc/inc/refhint.hxx
+++ b/sc/inc/refhint.hxx
@@ -31,7 +31,7 @@ protected:
public:
virtual ~RefHint() = 0;
- Type getType() const { return meType; }
+ Type getType() const;
};
class RefMovedHint : public RefHint
@@ -47,12 +47,12 @@ public:
/**
* Get the source range from which the references have moved.
*/
- const ScRange& getRange() const { return maRange;}
+ const ScRange& getRange() const;
/**
* Get the movement vector.
*/
- const ScAddress& getDelta() const { return maMoveDelta;}
+ const ScAddress& getDelta() const;
};
class RefColReorderHint : public RefHint
@@ -66,11 +66,11 @@ public:
RefColReorderHint( const sc::ColReorderMapType& rColMap, SCTAB nTab, SCROW nRow1, SCROW nRow2 );
virtual ~RefColReorderHint();
- const sc::ColReorderMapType& getColMap() const { return mrColMap;}
+ const sc::ColReorderMapType& getColMap() const;
- SCTAB getTab() const { return mnTab;}
- SCROW getStartRow() const { return mnRow1;}
- SCROW getEndRow() const { return mnRow2;}
+ SCTAB getTab() const;
+ SCROW getStartRow() const;
+ SCROW getEndRow() const;
};
}
diff --git a/sc/source/core/tool/refhint.cxx b/sc/source/core/tool/refhint.cxx
index 25dc699..80aef93 100644
--- a/sc/source/core/tool/refhint.cxx
+++ b/sc/source/core/tool/refhint.cxx
@@ -14,16 +14,51 @@ namespace sc {
RefHint::RefHint( Type eType ) : SfxSimpleHint(SC_HINT_REFERENCE), meType(eType) {}
RefHint::~RefHint() {}
+RefHint::Type RefHint::getType() const
+{
+ return meType;
+}
+
RefMovedHint::RefMovedHint( const ScRange& rRange, const ScAddress& rMove ) :
RefHint(Moved), maRange(rRange), maMoveDelta(rMove) {}
RefMovedHint::~RefMovedHint() {}
+const ScRange& RefMovedHint::getRange() const
+{
+ return maRange;
+}
+
+const ScAddress& RefMovedHint::getDelta() const
+{
+ return maMoveDelta;
+}
+
RefColReorderHint::RefColReorderHint( const sc::ColReorderMapType& rColMap, SCTAB nTab, SCROW nRow1, SCROW nRow2 ) :
RefHint(ColumnReordered), mrColMap(rColMap), mnTab(nTab), mnRow1(nRow1), mnRow2(nRow2) {}
RefColReorderHint::~RefColReorderHint() {}
+const sc::ColReorderMapType& RefColReorderHint::getColMap() const
+{
+ return mrColMap;
+}
+
+SCTAB RefColReorderHint::getTab() const
+{
+ return mnTab;
+}
+
+SCROW RefColReorderHint::getStartRow() const
+{
+ return mnRow1;
+}
+
+SCROW RefColReorderHint::getEndRow() const
+{
+ return mnRow2;
+}
+
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit ecde8155fefcdacb08177a10a4eddc24f6675b0b
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Jun 26 14:51:47 2014 -0400
fdo#79151: No need to offset column index by category labels.
In fact, doing so would lead to a corrupt internal data table. The
internal data stores category labels separately from the column data, so
there is no reason why we need to offset for category labels here.
Change-Id: I29dd99e53837cba7a1e28d2a1ef39a5384378805
diff --git a/chart2/source/controller/dialogs/DataBrowserModel.cxx b/chart2/source/controller/dialogs/DataBrowserModel.cxx
index e2bff5b..16ac3a2 100644
--- a/chart2/source/controller/dialogs/DataBrowserModel.cxx
+++ b/chart2/source/controller/dialogs/DataBrowserModel.cxx
@@ -343,10 +343,6 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
if (!xChartType.is())
return;
- sal_Int32 nOffset = 0;
- if( xDiagram.is() && lcl_ShowCategories( xDiagram ))
- nOffset = getCategoryColumnCount();
-
// Get shared sequences of current series. Normally multiple data series
// only share "values-x" sequences. (TODO: simplify this logic).
Reference< chart2::XDataSeriesContainer > xSeriesCnt( xChartType, uno::UNO_QUERY );
@@ -367,7 +363,6 @@ void DataBrowserModel::insertDataSeries( sal_Int32 nAfterColumnIndex )
Sequence<Reference<chart2::data::XLabeledDataSequence> > aLSequences = xSource->getDataSequences();
sal_Int32 nSeqIdx = 0;
sal_Int32 nSeqSize = aLSequences.getLength();
- nStartCol -= (nOffset - 1); // ???
for (sal_Int32 nIndex = nStartCol; nSeqIdx < nSeqSize; ++nSeqIdx)
{
lcl_tSharedSeqVec::const_iterator aSharedIt(
commit 822d0e9db610ce3cbee2cf8d3154ee41218ea562
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Jun 26 22:31:20 2014 -0400
Use new GridPrinter instance for each table.
resize() sometimes leads to a crash. Need to debug later.
Change-Id: Ia3809eb4f171369a58b84d5b44001692be1453a1
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index 72ce315..5265602 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -513,19 +513,37 @@ void InternalData::setComplexColumnLabels( const vector< vector< uno::Any > >& r
void InternalData::dump() const
{
// Header
- svl::GridPrinter aPrinter(1, m_nColumnCount, true);
- for (sal_Int32 nCol = 0; nCol < m_nColumnCount; ++nCol)
+ if (!m_aColumnLabels.empty())
{
- if (m_aColumnLabels[nCol].empty())
- continue;
+ svl::GridPrinter aPrinter(1, m_aColumnLabels.size(), true);
+ for (size_t nCol = 0; nCol < m_aColumnLabels.size(); ++nCol)
+ {
+ if (m_aColumnLabels[nCol].empty())
+ continue;
+
+ OUString aStr;
+ if (m_aColumnLabels[nCol][0] >>= aStr)
+ aPrinter.set(0, nCol, aStr);
+ }
+ aPrinter.print("Header");
+ }
- OUString aStr;
- if (m_aColumnLabels[nCol][0] >>= aStr)
- aPrinter.set(0, nCol, aStr);
+ if (!m_aRowLabels.empty())
+ {
+ svl::GridPrinter aPrinter(m_aRowLabels.size(), m_aRowLabels[0].size());
+ for (size_t nRow = 0; nRow < m_aRowLabels.size(); ++nRow)
+ {
+ for (size_t nCol = 0; nCol < m_aRowLabels[nRow].size(); ++nCol)
+ {
+ OUString aStr;
+ if (m_aRowLabels[nRow].at(nCol) >>= aStr)
+ aPrinter.set(nRow, nCol, aStr);
+ }
+ }
+ aPrinter.print("Row labels");
}
- aPrinter.print("Header");
- aPrinter.resize(m_nRowCount, m_nColumnCount);
+ svl::GridPrinter aPrinter(m_nRowCount, m_nColumnCount);
for (sal_Int32 nRow = 0; nRow < m_nRowCount; ++nRow)
{
commit c6da1842956ceced501858d582f7dcaded0a324a
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Jun 26 19:35:48 2014 -0400
Track all uses of ErrorBarX and ErrorBarY UNO property names.
Change-Id: I994424c98d977c3a8f9138cccc17348de813a9d7
diff --git a/chart2/CppunitTest_chart2_export.mk b/chart2/CppunitTest_chart2_export.mk
index c6bf682..3b941a9 100644
--- a/chart2/CppunitTest_chart2_export.mk
+++ b/chart2/CppunitTest_chart2_export.mk
@@ -60,6 +60,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_export, \
))
$(eval $(call gb_CppunitTest_set_include,chart2_export,\
+ -I$(SRCDIR)/chart2/inc \
$$(INCLUDE) \
))
diff --git a/chart2/CppunitTest_chart2_import.mk b/chart2/CppunitTest_chart2_import.mk
index 55ac39d..f925e58 100644
--- a/chart2/CppunitTest_chart2_import.mk
+++ b/chart2/CppunitTest_chart2_import.mk
@@ -59,6 +59,7 @@ $(eval $(call gb_CppunitTest_use_libraries,chart2_import, \
))
$(eval $(call gb_CppunitTest_set_include,chart2_import,\
+ -I$(SRCDIR)/chart2/inc \
$$(INCLUDE) \
))
diff --git a/chart2/inc/unonames.hxx b/chart2/inc/unonames.hxx
index 2b5f601..4975ed4 100644
--- a/chart2/inc/unonames.hxx
+++ b/chart2/inc/unonames.hxx
@@ -19,6 +19,8 @@
#define CHART_UNONAME_CURVE_RESOLUTION "CurveResolution"
#define CHART_UNONAME_NUMFMT "NumberFormat"
#define CHART_UNONAME_LINK_TO_SRC_NUMFMT "LinkNumberFormatToSource"
+#define CHART_UNONAME_ERRORBAR_X "ErrorBarX"
+#define CHART_UNONAME_ERRORBAR_Y "ErrorBarY"
#endif
diff --git a/chart2/qa/extras/chart2export.cxx b/chart2/qa/extras/chart2export.cxx
index 80aab30..7ef8dc7 100644
--- a/chart2/qa/extras/chart2export.cxx
+++ b/chart2/qa/extras/chart2export.cxx
@@ -436,7 +436,7 @@ void Chart2ExportTest::testErrorBarXLSX()
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
- xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+ xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
testErrorBar(xErrorBarYProps);
}
@@ -453,7 +453,7 @@ void Chart2ExportTest::testErrorBarXLSX()
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
- xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+ xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
testErrorBar(xErrorBarYProps);
}
}
@@ -832,7 +832,7 @@ void Chart2ExportTest::testErrorBarDataRangeODS()
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
- xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+ xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
uno::Any aAny = xErrorBarYProps->getPropertyValue("ErrorBarRangePositive");
CPPUNIT_ASSERT(aAny.hasValue());
OUString aPosRange;
diff --git a/chart2/qa/extras/chart2import.cxx b/chart2/qa/extras/chart2import.cxx
index d5a42a1..1f31cad 100644
--- a/chart2/qa/extras/chart2import.cxx
+++ b/chart2/qa/extras/chart2import.cxx
@@ -89,7 +89,7 @@ void Chart2ImportTest::Fdo60083()
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
- xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+ xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
CPPUNIT_ASSERT(xErrorBarYProps.is());
{
sal_Int32 nErrorBarStyle;
@@ -121,7 +121,7 @@ void Chart2ImportTest::Fdo60083()
// test that x error bars are not imported
Reference< beans::XPropertySet > xErrorBarXProps;
- xPropSet->getPropertyValue("ErrorBarX") >>= xErrorBarXProps;
+ xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarXProps;
CPPUNIT_ASSERT(!xErrorBarXProps.is());
}
@@ -139,7 +139,7 @@ void Chart2ImportTest::testErrorBarRange()
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
- xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+ xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
CPPUNIT_ASSERT(xErrorBarYProps.is());
sal_Int32 nErrorBarStyle;
@@ -169,7 +169,7 @@ void Chart2ImportTest::testErrorBarFormatting()
// test that y error bars are there
Reference< beans::XPropertySet > xErrorBarYProps;
- xPropSet->getPropertyValue("ErrorBarY") >>= xErrorBarYProps;
+ xPropSet->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarYProps;
CPPUNIT_ASSERT(xErrorBarYProps.is());
util::Color aColor(0);
diff --git a/chart2/qa/extras/charttest.hxx b/chart2/qa/extras/charttest.hxx
index e0969f4..97284542 100644
--- a/chart2/qa/extras/charttest.hxx
+++ b/chart2/qa/extras/charttest.hxx
@@ -49,6 +49,8 @@
#include <com/sun/star/util/XNumberFormatsSupplier.hpp>
#include <com/sun/star/util/NumberFormat.hpp>
+#include <unonames.hxx>
+
#include <iostream>
#include <libxml/xmlwriter.h>
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index c7d808c..8dd0f80 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
@@ -25,6 +25,7 @@
#include "DiagramHelper.hxx"
#include "ErrorBar.hxx"
#include "StatisticsHelper.hxx"
+#include <unonames.hxx>
#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <com/sun/star/chart/ChartErrorCategory.hpp>
@@ -184,7 +185,7 @@ protected:
if(!xSeriesPropertySet.is())
return 0;
uno::Reference< beans::XPropertySet > xErrorBarProperties;
- xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties;
+ xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties;
if( !xErrorBarProperties.is() )
{
// todo: use a valid context
@@ -193,7 +194,7 @@ protected:
xErrorBarProperties->setPropertyValue( "ShowPositiveError" , uno::makeAny(false) );
xErrorBarProperties->setPropertyValue( "ShowNegativeError" , uno::makeAny(false) );
xErrorBarProperties->setPropertyValue( "ErrorBarStyle" , uno::makeAny(::com::sun::star::chart::ErrorBarStyle::NONE) );
- xSeriesPropertySet->setPropertyValue( "ErrorBarY" , uno::makeAny( xErrorBarProperties ) );
+ xSeriesPropertySet->setPropertyValue( CHART_UNONAME_ERRORBAR_Y , uno::makeAny( xErrorBarProperties ) );
}
return xErrorBarProperties;
}
@@ -231,7 +232,7 @@ double WrappedConstantErrorLowProperty::getValueFromSeries( const Reference< bea
double aRet = 0.0;
m_aDefaultValue >>= aRet;
uno::Reference< beans::XPropertySet > xErrorBarProperties;
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
if( ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE == lcl_getErrorBarStyle( xErrorBarProperties ) )
xErrorBarProperties->getPropertyValue( "NegativeError" ) >>= aRet;
@@ -285,7 +286,7 @@ double WrappedConstantErrorHighProperty::getValueFromSeries( const Reference< be
double aRet = 0.0;
m_aDefaultValue >>= aRet;
uno::Reference< beans::XPropertySet > xErrorBarProperties;
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
if( ::com::sun::star::chart::ErrorBarStyle::ABSOLUTE == lcl_getErrorBarStyle( xErrorBarProperties ) )
xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet;
@@ -380,7 +381,7 @@ WrappedErrorCategoryProperty::~WrappedErrorCategoryProperty()
::com::sun::star::chart::ChartErrorCategory aRet = ::com::sun::star::chart::ChartErrorCategory_NONE;
m_aDefaultValue >>= aRet;
uno::Reference< beans::XPropertySet > xErrorBarProperties;
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
sal_Int32 nStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
xErrorBarProperties->getPropertyValue( "ErrorBarStyle" ) >>= nStyle;
@@ -481,7 +482,7 @@ double WrappedPercentageErrorProperty::getValueFromSeries( const Reference< bean
double aRet = 0.0;
m_aDefaultValue >>= aRet;
uno::Reference< beans::XPropertySet > xErrorBarProperties;
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
if( ::com::sun::star::chart::ErrorBarStyle::RELATIVE == lcl_getErrorBarStyle( xErrorBarProperties ) )
xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet;
@@ -535,7 +536,7 @@ double WrappedErrorMarginProperty::getValueFromSeries( const Reference< beans::X
double aRet = 0.0;
m_aDefaultValue >>= aRet;
uno::Reference< beans::XPropertySet > xErrorBarProperties;
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
if( ::com::sun::star::chart::ErrorBarStyle::ERROR_MARGIN == lcl_getErrorBarStyle( xErrorBarProperties ) )
xErrorBarProperties->getPropertyValue( "PositiveError" ) >>= aRet;
@@ -586,7 +587,7 @@ WrappedErrorIndicatorProperty::~WrappedErrorIndicatorProperty()
::com::sun::star::chart::ChartErrorIndicatorType aRet = ::com::sun::star::chart::ChartErrorIndicatorType_NONE;
m_aDefaultValue >>= aRet;
uno::Reference< beans::XPropertySet > xErrorBarProperties;
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
bool bPositive = false;
bool bNegative = false;
@@ -659,7 +660,7 @@ sal_Int32 WrappedErrorBarStyleProperty::getValueFromSeries( const Reference< bea
sal_Int32 nRet = ::com::sun::star::chart::ErrorBarStyle::NONE;
m_aDefaultValue >>= nRet;
uno::Reference< beans::XPropertySet > xErrorBarProperties;
- if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
+ if( xSeriesPropertySet.is() && ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarProperties ) && xErrorBarProperties.is())
{
xErrorBarProperties->getPropertyValue( "ErrorBarStyle" ) >>= nRet;
}
@@ -709,7 +710,7 @@ OUString WrappedErrorBarRangePositiveProperty::getValueFromSeries( const Referen
m_aDefaultValue >>= aRet;
uno::Reference< chart2::data::XDataSource > xErrorBarDataSource;
if( xSeriesPropertySet.is() &&
- ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarDataSource ) &&
+ ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarDataSource ) &&
xErrorBarDataSource.is())
{
uno::Reference< chart2::data::XDataSequence > xSeq(
@@ -776,7 +777,7 @@ OUString WrappedErrorBarRangeNegativeProperty::getValueFromSeries( const Referen
m_aDefaultValue >>= aRet;
uno::Reference< chart2::data::XDataSource > xErrorBarDataSource;
if( xSeriesPropertySet.is() &&
- ( xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xErrorBarDataSource ) &&
+ ( xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xErrorBarDataSource ) &&
xErrorBarDataSource.is())
{
uno::Reference< chart2::data::XDataSequence > xSeq(
@@ -920,7 +921,7 @@ Reference< beans::XPropertySet > WrappedStatisticPropertySetProperty::getValueFr
break;
case PROPERTY_SET_TYPE_ERROR_BAR:
if( xSeriesPropertySet.is())
- xSeriesPropertySet->getPropertyValue( "ErrorBarY" ) >>= xResult;
+ xSeriesPropertySet->getPropertyValue( CHART_UNONAME_ERRORBAR_Y ) >>= xResult;
break;
case PROPERTY_SET_TYPE_MEAN_VALUE:
if( xRegCnt.is() )
diff --git a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
index e5a9f35..1f24e8b 100644
--- a/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
+++ b/chart2/source/controller/itemsetwrapper/StatisticsItemConverter.cxx
@@ -29,6 +29,7 @@
#include "StatisticsHelper.hxx"
#include "GraphicPropertyItemConverter.hxx"
+#include <unonames.hxx>
#include <svl/stritem.hxx>
#include <svx/chrtitem.hxx>
@@ -57,7 +58,7 @@ uno::Reference< beans::XPropertySet > lcl_GetErrorBar(
if( xProp.is())
try
{
- ( xProp->getPropertyValue( bYError ? OUString( "ErrorBarY" ) : OUString("ErrorBarX") ) >>= xResult );
+ ( xProp->getPropertyValue( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X) ) >>= xResult );
}
catch( const uno::Exception & ex )
{
@@ -368,7 +369,7 @@ bool StatisticsItemConverter::ApplySpecialItem(
if( !xErrorBarProp.is() )
{
xErrorBarProp = lcl_GetDefaultErrorBar();
- GetPropertySet()->setPropertyValue( bYError ? OUString( "ErrorBarY" ) : OUString("ErrorBarX"),
+ GetPropertySet()->setPropertyValue( bYError ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X),
uno::makeAny( xErrorBarProp ));
}
diff --git a/chart2/source/controller/main/ObjectHierarchy.cxx b/chart2/source/controller/main/ObjectHierarchy.cxx
index 26caf6e..9498d37 100644
--- a/chart2/source/controller/main/ObjectHierarchy.cxx
+++ b/chart2/source/controller/main/ObjectHierarchy.cxx
@@ -30,6 +30,7 @@
#include "DataSeriesHelper.hxx"
#include "LegendHelper.hxx"
#include "chartview/DrawModelWrapper.hxx"
+#include <unonames.hxx>
#include <map>
#include <algorithm>
@@ -468,7 +469,7 @@ void ImplObjectHierarchy::createDataSeriesTree(
Reference< beans::XPropertySet > xSeriesProp( xSeries, uno::UNO_QUERY );
Reference< beans::XPropertySet > xErrorBarProp;
if( xSeriesProp.is() &&
- (xSeriesProp->getPropertyValue( "ErrorBarY") >>= xErrorBarProp) &&
+ (xSeriesProp->getPropertyValue( CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp) &&
xErrorBarProp.is())
{
sal_Int32 nStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
@@ -482,7 +483,7 @@ void ImplObjectHierarchy::createDataSeriesTree(
}
if( xSeriesProp.is() &&
- (xSeriesProp->getPropertyValue( "ErrorBarX") >>= xErrorBarProp) &&
+ (xSeriesProp->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp) &&
xErrorBarProp.is())
{
sal_Int32 nStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
diff --git a/chart2/source/model/main/DataPointProperties.cxx b/chart2/source/model/main/DataPointProperties.cxx
index e145d42..c2cb375 100644
--- a/chart2/source/model/main/DataPointProperties.cxx
+++ b/chart2/source/model/main/DataPointProperties.cxx
@@ -322,14 +322,14 @@ void DataPointProperties::AddPropertiesToVector(
// statistics
rOutProperties.push_back(
- Property( "ErrorBarX",
+ Property( CHART_UNONAME_ERRORBAR_X,
PROP_DATAPOINT_ERROR_BAR_X,
// XPropertySet supporting service ErrorBar
cppu::UnoType<beans::XPropertySet>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
rOutProperties.push_back(
- Property( "ErrorBarY",
+ Property( CHART_UNONAME_ERRORBAR_Y,
PROP_DATAPOINT_ERROR_BAR_Y,
// XPropertySet supporting service ErrorBar
cppu::UnoType<beans::XPropertySet>::get(),
diff --git a/chart2/source/tools/DataSourceHelper.cxx b/chart2/source/tools/DataSourceHelper.cxx
index aad3aae..bb30a26 100644
--- a/chart2/source/tools/DataSourceHelper.cxx
+++ b/chart2/source/tools/DataSourceHelper.cxx
@@ -28,6 +28,7 @@
#include "PropertyHelper.hxx"
#include "CachedDataSequence.hxx"
#include "LabeledDataSequence.hxx"
+#include <unonames.hxx>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/data/XDataSource.hpp>
@@ -81,7 +82,7 @@ void lcl_addErrorBarRanges(
try
{
uno::Reference< beans::XPropertySet > xErrorBarProp;
- if( ( xSeriesProp->getPropertyValue( "ErrorBarY") >>= xErrorBarProp ) &&
+ if( ( xSeriesProp->getPropertyValue( CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp ) &&
xErrorBarProp.is())
{
sal_Int32 eStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
@@ -94,7 +95,7 @@ void lcl_addErrorBarRanges(
}
}
- if( ( xSeriesProp->getPropertyValue("ErrorBarX") >>= xErrorBarProp ) && xErrorBarProp.is())
+ if( ( xSeriesProp->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp ) && xErrorBarProp.is())
{
sal_Int32 eStyle = ::com::sun::star::chart::ErrorBarStyle::NONE;
if( ( xErrorBarProp->getPropertyValue("ErrorBarStyle") >>= eStyle ) &&
diff --git a/chart2/source/tools/ObjectIdentifier.cxx b/chart2/source/tools/ObjectIdentifier.cxx
index 0ab0874..b0aee8b 100644
--- a/chart2/source/tools/ObjectIdentifier.cxx
+++ b/chart2/source/tools/ObjectIdentifier.cxx
@@ -25,6 +25,8 @@
#include "servicenames_charttypes.hxx"
#include "DiagramHelper.hxx"
#include "AxisIndexDefines.hxx"
+#include <unonames.hxx>
+
#include <com/sun/star/chart2/XCoordinateSystemContainer.hpp>
#include <com/sun/star/chart2/XChartDocument.hpp>
#include <com/sun/star/chart2/XChartTypeContainer.hpp>
@@ -1363,9 +1365,9 @@ Reference< beans::XPropertySet > ObjectIdentifier::getObjectPropertySet(
OUString errorBar;
if ( eObjectType == OBJECTTYPE_DATA_ERRORS_X)
- errorBar = "ErrorBarX";
+ errorBar = CHART_UNONAME_ERRORBAR_X;
else if (eObjectType == OBJECTTYPE_DATA_ERRORS_Y)
- errorBar = "ErrorBarY";
+ errorBar = CHART_UNONAME_ERRORBAR_Y;
else
errorBar = "ErrorBarZ";
diff --git a/chart2/source/tools/StatisticsHelper.cxx b/chart2/source/tools/StatisticsHelper.cxx
index 724e01c..cbabbf1 100644
--- a/chart2/source/tools/StatisticsHelper.cxx
+++ b/chart2/source/tools/StatisticsHelper.cxx
@@ -21,6 +21,7 @@
#include "DataSeriesHelper.hxx"
#include "ErrorBar.hxx"
#include "macros.hxx"
+#include <unonames.hxx>
#include <rtl/math.hxx>
#include <rtl/ustrbuf.hxx>
@@ -307,7 +308,7 @@ Reference< beans::XPropertySet > StatisticsHelper::addErrorBars(
return xErrorBar;
const OUString aPropName(
- (bYError) ? OUString("ErrorBarY") : OUString("ErrorBarX"));
+ (bYError) ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
if( !( xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar ) ||
!xErrorBar.is())
{
@@ -332,7 +333,7 @@ Reference< beans::XPropertySet > StatisticsHelper::getErrorBars(
Reference< beans::XPropertySet > xSeriesProp( xDataSeries, uno::UNO_QUERY );
Reference< beans::XPropertySet > xErrorBar;
const OUString aPropName(
- (bYError) ? OUString("ErrorBarY") : OUString("ErrorBarX"));
+ (bYError) ? OUString(CHART_UNONAME_ERRORBAR_Y) : OUString(CHART_UNONAME_ERRORBAR_X));
if ( xSeriesProp.is())
xSeriesProp->getPropertyValue( aPropName ) >>= xErrorBar;
diff --git a/chart2/source/view/main/VDataSeries.cxx b/chart2/source/view/main/VDataSeries.cxx
index e799f22..73f8956 100644
--- a/chart2/source/view/main/VDataSeries.cxx
+++ b/chart2/source/view/main/VDataSeries.cxx
@@ -831,7 +831,7 @@ uno::Reference< beans::XPropertySet > VDataSeries::getXErrorBarProperties( sal_I
uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( index ));
if( xPointProp.is() )
- xPointProp->getPropertyValue("ErrorBarX") >>= xErrorBarProp;
+ xPointProp->getPropertyValue(CHART_UNONAME_ERRORBAR_X) >>= xErrorBarProp;
return xErrorBarProp;
}
@@ -841,7 +841,7 @@ uno::Reference< beans::XPropertySet > VDataSeries::getYErrorBarProperties( sal_I
uno::Reference< beans::XPropertySet > xPointProp( this->getPropertiesOfPoint( index ));
if( xPointProp.is() )
- xPointProp->getPropertyValue("ErrorBarY") >>= xErrorBarProp;
+ xPointProp->getPropertyValue(CHART_UNONAME_ERRORBAR_Y) >>= xErrorBarProp;
return xErrorBarProp;
}
commit 95272e7e5b7e38753ab07dbd6503b7cfa2974842
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Jun 26 18:57:09 2014 -0400
Prevent a crash while dumping internal data content.
Change-Id: I0938b955b460d8c91607e6df0b9d9e1a4a971013
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index ac796a9..72ce315 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -516,6 +516,9 @@ void InternalData::dump() const
svl::GridPrinter aPrinter(1, m_nColumnCount, true);
for (sal_Int32 nCol = 0; nCol < m_nColumnCount; ++nCol)
{
+ if (m_aColumnLabels[nCol].empty())
+ continue;
+
OUString aStr;
if (m_aColumnLabels[nCol][0] >>= aStr)
aPrinter.set(0, nCol, aStr);
commit 4cda79cec3fe54b6859ec8ca550f4453ace7fcb2
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jun 26 22:57:11 2014 +0200
loplugin:staticcall
Change-Id: Idea97df52106af64f6c5605460756d48296551e2
diff --git a/sfx2/source/appl/shutdowniconaqua.mm b/sfx2/source/appl/shutdowniconaqua.mm
index 7218061..24458ad 100644
--- a/sfx2/source/appl/shutdowniconaqua.mm
+++ b/sfx2/source/appl/shutdowniconaqua.mm
@@ -399,7 +399,7 @@ void aqua_init_systray()
// disable shutdown
pShutdownIcon->SetVeto( true );
- pShutdownIcon->addTerminateListener();
+ ShutdownIcon::addTerminateListener();
if( ! pDefMenu )
{
commit 977c50178f804dad2817bca98cb9b26affd5bf9a
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jun 26 22:49:40 2014 +0200
idl: ignore -isystem args
Change-Id: I0758fd3117795ed68789385576aee5a885639104
diff --git a/idl/source/prj/command.cxx b/idl/source/prj/command.cxx
index 896ed4d6..9eceab1 100644
--- a/idl/source/prj/command.cxx
+++ b/idl/source/prj/command.cxx
@@ -316,6 +316,18 @@ SvCommand::SvCommand( int argc, char ** argv )
while(SyntaxStrings[j])
printf("%s\n",SyntaxStrings[j++]);
}
+ else if (aParam == "isystem")
+ {
+ // ignore "-isystem" and following arg
+ if (i < aList.size())
+ {
+ ++i;
+ }
+ }
+ else if (aParam.startsWith("isystem"))
+ {
+ // ignore args starting with "-isystem"
+ }
else if( aParam.startsWithIgnoreAsciiCase( "i" ) )
{ // define include paths
OUString aName( aParam.copy( 1 ) );
commit 7c5a21dd4142c414de4e5925533e8cfbb6f329b0
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Thu Jun 26 22:32:13 2014 +0200
rsc: ignore -isystem args
Change-Id: Ic46b84d740159826542ead857d15230d54547d88
diff --git a/rsc/source/prj/start.cxx b/rsc/source/prj/start.cxx
index 46c62a7..7c7cc32 100644
--- a/rsc/source/prj/start.cxx
+++ b/rsc/source/prj/start.cxx
@@ -235,7 +235,20 @@ SAL_IMPLEMENT_MAIN_WITH_ARGS(argc, argv)
bool bSetSrs = false;
while( ppStr && i < (aCmdLine.GetCount() -1) )
{
- if( '-' == **ppStr )
+ if (strcmp(*ppStr, "-isystem") == 0)
+ {
+ // ignore "-isystem" and following arg
+ if (i < aCmdLine.GetCount() - 1)
+ {
+ ++ppStr;
+ ++i;
+ }
+ }
+ else if (strncmp(*ppStr, "-isystem", strlen("-isystem")) == 0)
+ {
+ // ignore args starting with "-isystem"
+ }
+ else if( '-' == **ppStr )
{
if( !rsc_stricmp( (*ppStr) + 1, "p" )
|| !rsc_stricmp( (*ppStr) + 1, "l" ) )
diff --git a/rsc/source/rsc/rsc.cxx b/rsc/source/rsc/rsc.cxx
index 0fac410..e5a7228 100644
--- a/rsc/source/rsc/rsc.cxx
+++ b/rsc/source/rsc/rsc.cxx
@@ -100,7 +100,20 @@ RscCmdLine::RscCmdLine( int argc, char ** argv, RscError * pEH )
#if OSL_DEBUG_LEVEL > 1
fprintf( stderr, "CmdLineArg: \"%s\"\n", *ppStr );
#endif
- if( '-' == **ppStr )
+ if (strcmp(*ppStr, "-isystem") == 0)
+ {
+ // ignore "-isystem" and following arg
+ if (i < aCmdLine.GetCount() - 1)
+ {
+ ++ppStr;
+ ++i;
+ }
+ }
+ else if (strncmp(*ppStr, "-isystem", strlen("-isystem")) == 0)
+ {
+ // ignore args starting with "-isystem"
+ }
+ else if( '-' == **ppStr )
{
if( !rsc_stricmp( (*ppStr) + 1, "h" )
|| !strcmp( (*ppStr) + 1, "?" ) )
diff --git a/rsc/source/rscpp/cpp3.c b/rsc/source/rscpp/cpp3.c
index 287b2a5..02361649 100644
--- a/rsc/source/rscpp/cpp3.c
+++ b/rsc/source/rscpp/cpp3.c
@@ -217,7 +217,19 @@ dooptions(int argc, char** argv)
for (i = j = 1; i < argc; i++) {
arg = ap = argv[i];
- if (*ap++ != '-' || *ap == EOS)
+ if (strcmp(arg, "-isystem") == 0)
+ {
+ // ignore "-isystem" and following arg
+ if (i < argc)
+ {
+ ++i;
+ }
+ }
+ else if (strncmp(arg, "-isystem", strlen("-isystem")) == 0)
+ {
+ // ignore args starting with "-isystem"
+ }
+ else if (*ap++ != '-' || *ap == EOS)
{
argv[j++] = argv[i];
}
commit aa6495b6fa231abfe8b55a806ff6d5a306843cd3
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Jun 26 14:23:29 2014 -0400
Better way to dump the content of InternalData.
Row levels are currently not dumped, but that may change later.
Change-Id: I849f8b65d6f419bc4d97e2af2d456e73c7e9a355
diff --git a/chart2/source/inc/InternalData.hxx b/chart2/source/inc/InternalData.hxx
index 082f6ee..94b7eee 100644
--- a/chart2/source/inc/InternalData.hxx
+++ b/chart2/source/inc/InternalData.hxx
@@ -76,9 +76,7 @@ public:
void setComplexColumnLabels( const tVecVecAny& rNewColumnLabels );
tVecVecAny getComplexColumnLabels() const { return m_aColumnLabels;}
-#if OSL_DEBUG_LEVEL > 1
- void traceData() const;
-#endif
+ void dump() const;
private: //methods
/** resizes the data if at least one of the given dimensions is larger than
diff --git a/chart2/source/tools/InternalData.cxx b/chart2/source/tools/InternalData.cxx
index f79bd62..ac796a9 100644
--- a/chart2/source/tools/InternalData.cxx
+++ b/chart2/source/tools/InternalData.cxx
@@ -22,6 +22,14 @@
#include "Strings.hrc"
#include <rtl/math.hxx>
+#if OSL_DEBUG_LEVEL > 1
+#define DEBUG_INTERNAL_DATA 1
+#endif
+
+#ifdef DEBUG_INTERNAL_DATA
+#include <svl/gridprinter.hxx>
+#endif
+
#include <algorithm>
#include <iterator>
@@ -223,6 +231,8 @@ void InternalData::setComplexColumnLabel( sal_Int32 nColumnIndex, const vector<
enlargeData( nColumnIndex+1, 0 );
}
m_aColumnLabels[nColumnIndex]=rComplexLabel;
+
+ dump();
}
void InternalData::setComplexRowLabel( sal_Int32 nRowIndex, const vector< uno::Any >& rComplexLabel )
@@ -351,9 +361,7 @@ void InternalData::insertColumn( sal_Int32 nAfterIndex )
if( nAfterIndex < static_cast< sal_Int32 >( m_aColumnLabels.size()))
m_aColumnLabels.insert( m_aColumnLabels.begin() + (nAfterIndex + 1), vector< uno::Any >(1) );
-#if OSL_DEBUG_LEVEL > 1
- traceData();
-#endif
+ dump();
}
sal_Int32 InternalData::appendColumn()
@@ -403,9 +411,7 @@ void InternalData::insertRow( sal_Int32 nAfterIndex )
if( nAfterIndex < static_cast< sal_Int32 >( m_aRowLabels.size()))
m_aRowLabels.insert( m_aRowLabels.begin() + nIndex, vector< uno::Any > (1));
-#if OSL_DEBUG_LEVEL > 1
- traceData();
-#endif
+ dump();
}
void InternalData::deleteColumn( sal_Int32 nAtIndex )
@@ -439,9 +445,7 @@ void InternalData::deleteColumn( sal_Int32 nAtIndex )
if( nAtIndex < static_cast< sal_Int32 >( m_aColumnLabels.size()))
m_aColumnLabels.erase( m_aColumnLabels.begin() + nAtIndex );
-#if OSL_DEBUG_LEVEL > 1
- traceData();
-#endif
+ dump();
}
void InternalData::deleteRow( sal_Int32 nAtIndex )
@@ -479,9 +483,7 @@ void InternalData::deleteRow( sal_Int32 nAtIndex )
if( nAtIndex < static_cast< sal_Int32 >( m_aRowLabels.size()))
m_aRowLabels.erase( m_aRowLabels.begin() + nAtIndex );
-#if OSL_DEBUG_LEVEL > 1
- traceData();
-#endif
+ dump();
}
@@ -507,21 +509,32 @@ void InternalData::setComplexColumnLabels( const vector< vector< uno::Any > >& r
enlargeData( nNewColumnCount, 0 );
}
-
-#if OSL_DEBUG_LEVEL > 1
-void InternalData::traceData() const
+#ifdef DEBUG_INTERNAL_DATA
+void InternalData::dump() const
{
- OSL_TRACE( "InternalData: Data in rows" );
+ // Header
+ svl::GridPrinter aPrinter(1, m_nColumnCount, true);
+ for (sal_Int32 nCol = 0; nCol < m_nColumnCount; ++nCol)
+ {
+ OUString aStr;
+ if (m_aColumnLabels[nCol][0] >>= aStr)
+ aPrinter.set(0, nCol, aStr);
+ }
+ aPrinter.print("Header");
- for( sal_Int32 i=0; i<m_nRowCount; ++i )
+ aPrinter.resize(m_nRowCount, m_nColumnCount);
+
+ for (sal_Int32 nRow = 0; nRow < m_nRowCount; ++nRow)
{
- tDataType aSlice( m_aData[ ::std::slice( i*m_nColumnCount, m_nColumnCount, 1 ) ] );
- for( sal_Int32 j=0; j<m_nColumnCount; ++j )
- OSL_TRACE( "%lf ", aSlice[j] );
- OSL_TRACE( "\n" );
+ tDataType aSlice( m_aData[ ::std::slice( nRow*m_nColumnCount, m_nColumnCount, 1 ) ] );
+ for (sal_Int32 nCol = 0; nCol < m_nColumnCount; ++nCol)
+ aPrinter.set(nRow, nCol, OUString::number(aSlice[nCol]));
}
- OSL_TRACE( "\n" );
+
+ aPrinter.print("Column data");
}
+#else
+void InternalData::dump() const {}
#endif
} // namespace chart
commit 1fabecb123dcc91ebd9d43f3e5c163c7b12b37b0
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Jun 26 13:50:17 2014 -0400
svl now depends on mdds.
Change-Id: Ifd0bde11ad7e72683e1b95106f487e1eb2a4b487
diff --git a/svl/Library_svl.mk b/svl/Library_svl.mk
index d00505e..f527701 100644
--- a/svl/Library_svl.mk
+++ b/svl/Library_svl.mk
@@ -19,7 +19,10 @@
$(eval $(call gb_Library_Library,svl))
-$(eval $(call gb_Library_use_external,svl,boost_headers))
+$(eval $(call gb_Library_use_externals,svl,\
+ boost_headers \
+ mdds_headers \
+))
$(eval $(call gb_Library_set_componentfile,svl,svl/util/svl))
commit b2bbd5375ab6ca6ddf4c133d2fdf0b5e38d818b5
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Jun 26 13:36:15 2014 -0400
Initialize it with empty OUString instances.
Since we only store strings the matrix.
Change-Id: Ie30e9ce0235810b3082ba13ac17c7d1b3c19375a
diff --git a/svl/source/misc/gridprinter.cxx b/svl/source/misc/gridprinter.cxx
index c36de35..a472649 100644
--- a/svl/source/misc/gridprinter.cxx
+++ b/svl/source/misc/gridprinter.cxx
@@ -56,7 +56,7 @@ struct GridPrinter::Impl
bool mbPrint;
Impl( size_t nRows, size_t nCols, bool bPrint ) :
- maMatrix(nRows, nCols), mbPrint(bPrint) {}
+ maMatrix(nRows, nCols, OUString()), mbPrint(bPrint) {}
};
GridPrinter::GridPrinter( size_t nRows, size_t nCols, bool bPrint ) :
commit f15e440d148ed021091ef9b20f3aed2488f0fde3
Author: Kohei Yoshida <kohei.yoshida at collabora.com>
Date: Thu Jun 26 13:33:09 2014 -0400
Move SheetPrinter to svl and rename it to GridPrinter.
I need to use this outside of sc.
Change-Id: I153863d6c5c31e5ab5f25da2dba81bd4d4b6d3fe
diff --git a/include/svl/gridprinter.hxx b/include/svl/gridprinter.hxx
new file mode 100644
index 0000000..d63adfc
--- /dev/null
+++ b/include/svl/gridprinter.hxx
@@ -0,0 +1,44 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SVL_GRIDPRINTER_HXX
+#define INCLUDED_SVL_GRIDPRINTER_HXX
+
+#include <rtl/ustring.hxx>
+#include <svl/svldllapi.h>
+
+namespace svl {
+
+/**
+ * Print 2-dimensional data in a nice and pleasant fashion. Useful when
+ * debugging grid layout data.
+ */
+class SVL_DLLPUBLIC GridPrinter
+{
+ struct Impl;
+ Impl* mpImpl;
+
+public:
+ GridPrinter( size_t nRows, size_t nCols, bool bPrint = true );
+ ~GridPrinter();
+
+ void set( size_t nRow, size_t nCol, const OUString& rStr );
+
+ void print( const char* pHeader ) const;
+
+ void clear();
+
+ void resize( size_t nRows, size_t nCols );
+};
+
+}
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sc/qa/unit/helper/debughelper.hxx b/sc/qa/unit/helper/debughelper.hxx
index dc6e7bd..509f4af 100644
--- a/sc/qa/unit/helper/debughelper.hxx
+++ b/sc/qa/unit/helper/debughelper.hxx
@@ -23,10 +23,10 @@
#undef NOMINMAX
#endif
-#define MDDS_HASH_CONTAINER_BOOST 1
-#include <mdds/mixed_type_matrix.hpp>
-
#include <iostream>
+#include <vector>
+
+#include <svl/gridprinter.hxx>
#define CALC_DEBUG_OUTPUT 0
#define CALC_TEST_PERF 0
@@ -37,113 +37,6 @@ using ::std::cerr;
using ::std::endl;
using ::std::vector;
-/**
- * Print nicely formatted sheet content to stdout. Indispensable when
- * debugging the unit test code involving testing of sheet contents.
- */
-class SheetPrinter
-{
- typedef ::mdds::mixed_type_matrix<OUString, bool> MatrixType;
-public:
- SheetPrinter(size_t rows, size_t cols) :
- maMatrix(rows, cols, ::mdds::matrix_density_sparse_empty) {}
-
- void set(size_t row, size_t col, const OUString& aStr)
- {
- maMatrix.set_string(row, col, new OUString(aStr));
- }
-
-#if CALC_DEBUG_OUTPUT
- void print(const char* header) const
- {
- if (header)
- cout << header << endl;
-
- MatrixType::size_pair_type ns = maMatrix.size();
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list