[Libreoffice-commits] core.git: Branch 'feature/gsoc-tiled-rendering' - 234 commits - basctl/source basegfx/source basic/source bin/find-german-comments bridges/source bridges/test chart2/source comphelper/source config_host.mk.in configmgr/source configure.ac connectivity/source cppuhelper/source cui/source dbaccess/source desktop/Library_sofficeapp.mk desktop/source download.lst drawinglayer/source editeng/source embeddedobj/source extensions/source extensions/test extensions/uiconfig external/curl external/graphite external/liborcus external/mdds external/Module_external.mk external/nss external/redland filter/source forms/qa forms/source formula/source fpicker/source framework/inc framework/qa framework/source helpcompiler/source hwpfilter/source i18nlangtag/source i18npool/inc i18npool/Library_localedata_en.mk i18npool/source icon-themes/breeze icon-themes/sifr icon-themes/tango idlc/test idl/source include/basegfx include/basic include/comphelper include/drawinglayer include/editeng include /filter include/formula include/framework include/i18nlangtag include/jvmfwk include/LibreOfficeKit include/oox include/osl include/registry include/rtl include/sfx2 include/sot include/svl include/svtools include/svx include/toolkit include/tools include/typelib include/ucbhelper include/unotools include/vbahelper include/vcl include/xmloff instsetoo_native/CustomTarget_install.mk instsetoo_native/CustomTarget_setup.mk instsetoo_native/util io/source jurt/com jvmfwk/plugins librelogo/source libreofficekit/qa libreofficekit/source linguistic/source lotuswordpro/source Makefile.fetch nlpsolver/ThirdParty odk/config odk/docs odk/examples odk/README offapi/com offapi/type_reference officecfg/registry onlineupdate/Executable_mar.mk onlineupdate/Executable_updater.mk onlineupdate/Makefile onlineupdate/Module_onlineupdate.mk onlineupdate/README onlineupdate/source oox/inc oox/source package/source pyuno/inc pyuno/source qadevOOo/runner qadevOOo/tests registry/Executable_regview.mk registr y/inc registry/Library_reg.mk registry/source registry/tools reportdesign/inc reportdesign/source RepositoryExternal.mk Repository.mk RepositoryModule_host.mk sal/rtl scaddins/source scp2/source sc/qa sc/sdi sc/source sdext/source sd/source setup_native/source sfx2/source sfx2/uiconfig shell/source solenv/bin solenv/gbuild sot/source starmath/source stoc/source store/source svl/qa svl/source svtools/langsupport svtools/source svx/Library_svxcore.mk svx/source svx/uiconfig sw/inc sw/qa sw/sdi sw/source sw/uiconfig sysui/desktop tools/inc tools/qa tools/source ucb/source unotools/source vbahelper/source vcl/generic vcl/headless vcl/inc vcl/opengl vcl/source vcl/unx winaccessibility/inc wizards/com wizards/source writerfilter/source xmerge/source xmlhelp/source xmloff/dtd xmloff/inc xmloff/source xmlscript/source xmlsecurity/source
Pranav Kant
pranavk at gnome.org
Fri Jul 3 09:51:40 PDT 2015
Rebased ref, commits from common ancestor:
commit 08ad2b1223f0b5b0791b2de134fc5067640f0bf2
Author: Pranav Kant <pranavk at gnome.org>
Date: Thu Jul 2 23:47:33 2015 +0530
lokdocview: Grab focus on mouse 'button-press-event'
Change-Id: I65187bbd2cc32d9278d8b3890a82b5555390858a
diff --git a/libreofficekit/source/gtk/lokdocview.cxx b/libreofficekit/source/gtk/lokdocview.cxx
index 62f1e61..bf12ca0 100644
--- a/libreofficekit/source/gtk/lokdocview.cxx
+++ b/libreofficekit/source/gtk/lokdocview.cxx
@@ -812,6 +812,7 @@ lok_doc_view_signal_button(GtkWidget* pWidget, GdkEventButton* pEvent)
(int)pEvent->x, (int)pEvent->y,
(int)pixelToTwip(pEvent->x, priv->m_fZoom),
(int)pixelToTwip(pEvent->y, priv->m_fZoom));
+ gtk_widget_grab_focus(GTK_WIDGET(pDocView));
if (pEvent->type == GDK_BUTTON_RELEASE)
{
commit 4802bf32b84655f6e1d3389070c76371ede8fbce
Author: Justin Luth <justin_luth at sil.org>
Date: Wed Jun 24 23:02:57 2015 +0300
tdf#87348 enable docx exporting linked textboxes that LO can import
Exporting linked textboxes to docx format is in terrible condition.
Spacing, textboxes instead of frames, duplicate links and orphaned
shapes lying around, not to mention being being unlinked in MSWord...
This fix resolves this situation slightly: what LO saves can be
re-imported and re-saved without breaking the links - an incremental
improvement.
Change-Id: I8f0aef39eeed88a2b3dfc673a565fb1d8f4713b0
Reviewed-on: https://gerrit.libreoffice.org/16516
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Miklos Vajna <vmiklos at collabora.co.uk>
diff --git a/sw/qa/extras/ooxmlexport/data/tdf87348_linkedTextboxes.docx b/sw/qa/extras/ooxmlexport/data/tdf87348_linkedTextboxes.docx
new file mode 100644
index 0000000..8f9eb97
Binary files /dev/null and b/sw/qa/extras/ooxmlexport/data/tdf87348_linkedTextboxes.docx differ
diff --git a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
index ac7ba3c..6354f42 100644
--- a/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
+++ b/sw/qa/extras/ooxmlexport/ooxmlexport7.cxx
@@ -999,6 +999,70 @@ DECLARE_OOXMLEXPORT_TEST(testExportAdjustmentValue, "tdf91429.docx")
assertXPath(pXmlDoc,"/w:document/w:body/w:p/w:r[1]/mc:AlternateContent/mc:Choice/w:drawing/wp:anchor/a:graphic/a:graphicData/wps:wsp/wps:spPr/a:prstGeom/a:avLst/a:gd", "fmla", "val 50000");
}
+
+DECLARE_OOXMLEXPORT_TEST(testTDF87348, "tdf87348_linkedTextboxes.docx")
+{
+int followCount=0;
+int precedeCount=0;
+if( !parseDump("/root/page/body/txt/anchored/fly[1]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[1]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[2]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[2]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[3]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[3]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[4]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[4]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[5]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[5]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[6]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[6]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[7]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[7]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[8]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[8]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[9]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[9]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[10]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[10]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[11]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[11]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[12]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[12]/txt","precede").isEmpty() )
+ precedeCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[13]/txt","follow").isEmpty() )
+ followCount++;
+if( !parseDump("/root/page/body/txt/anchored/fly[13]/txt","precede").isEmpty() )
+ precedeCount++;
+ //there should be 4 chains/13 linked textboxes (set of 5, set of 3, set of 3, set of 2)
+ //that means 9 NEXT links and 9 PREV links.
+ //however, the current implementation adds leftover shapes, so can't go on exact numbers
+ // (unknown number of flys, unknown order of leftovers)
+ CPPUNIT_ASSERT ( (followCount >= 6) && (precedeCount >= 6) );
+}
+
#endif
CPPUNIT_PLUGIN_IMPLEMENT();
diff --git a/sw/source/filter/ww8/docxexport.cxx b/sw/source/filter/ww8/docxexport.cxx
index e91bea8..de23a27 100644
--- a/sw/source/filter/ww8/docxexport.cxx
+++ b/sw/source/filter/ww8/docxexport.cxx
@@ -453,6 +453,7 @@ void DocxExport::ExportDocument_Impl()
WriteEmbeddings();
+ m_aLinkedTextboxesHelper.clear(); //final cleanup
delete m_pStyles, m_pStyles = NULL;
delete m_pSections, m_pSections = NULL;
}
@@ -1314,6 +1315,10 @@ void DocxExport::WriteMainText()
// setup the namespaces
m_pDocumentFS->startElementNS( XML_w, XML_document, MainXmlNamespaces());
+ // reset the incrementing linked-textboxes chain ID before re-saving.
+ m_nLinkedTextboxesChainId=0;
+ m_aLinkedTextboxesHelper.clear();
+
// Write background page color
if (boost::optional<SvxBrushItem> oBrush = getBackground())
{
@@ -1331,6 +1336,9 @@ void DocxExport::WriteMainText()
// the text
WriteText();
+ // clear linked textboxes since old ones can't be linked to frames in a different section (correct?)
+ m_aLinkedTextboxesHelper.clear();
+
// the last section info
m_pAttrOutput->EndParaSdtBlock();
const WW8_SepInfo *pSectionInfo = m_pSections? m_pSections->CurrentSectionInfo(): NULL;
diff --git a/sw/source/filter/ww8/docxsdrexport.cxx b/sw/source/filter/ww8/docxsdrexport.cxx
index 44d9ebb..b59de52 100644
--- a/sw/source/filter/ww8/docxsdrexport.cxx
+++ b/sw/source/filter/ww8/docxsdrexport.cxx
@@ -143,8 +143,6 @@ struct DocxSdrExport::Impl
sax_fastparser::FastAttributeList* m_pFlyWrapAttrList;
sax_fastparser::FastAttributeList* m_pBodyPrAttrList;
std::unique_ptr<sax_fastparser::FastAttributeList> m_pDashLineStyleAttr;
- sal_Int32 m_nId ;
- sal_Int32 m_nSeq ;
bool m_bDMLAndVMLDrawingOpen;
/// List of TextBoxes in this document: they are exported as part of their shape, never alone.
std::set<const SwFrameFormat*> m_aTextBoxes;
@@ -166,8 +164,6 @@ struct DocxSdrExport::Impl
m_bFlyFrameGraphic(false),
m_pFlyWrapAttrList(0),
m_pBodyPrAttrList(0),
- m_nId(0),
- m_nSeq(0),
m_bDMLAndVMLDrawingOpen(false),
m_aTextBoxes(SwTextBoxHelper::findTextBoxes(m_rExport.m_pDoc)),
m_nDMLandVMLTextFrameRotation(0)
@@ -1475,48 +1471,87 @@ void DocxSdrExport::writeDMLTextFrame(sw::Frame* pParentFrame, int nAnchorId, bo
pFS->endElementNS(XML_wps, XML_spPr);
}
+ //first, loop through ALL of the chained textboxes to identify a unique ID for each chain, and sequence number for each textbox in that chain.
+ std::map<OUString, MSWordExportBase::LinkedTextboxInfo>::iterator linkedTextboxesIter;
+ if( !m_pImpl->m_rExport.m_bLinkedTextboxesHelperInitialized )
+ {
+ sal_Int32 nSeq=0;
+ linkedTextboxesIter = m_pImpl->m_rExport.m_aLinkedTextboxesHelper.begin();
+ while ( linkedTextboxesIter != m_pImpl->m_rExport.m_aLinkedTextboxesHelper.end() )
+ {
+ //find the start of a textbox chain: has no PREVIOUS link, but does have NEXT link
+ if ( linkedTextboxesIter->second.sPrevChain.isEmpty() && !linkedTextboxesIter->second.sNextChain.isEmpty() )
+ {
+ //assign this chain a unique ID and start a new sequence
+ nSeq = 0;
+ linkedTextboxesIter->second.nId = ++m_pImpl->m_rExport.m_nLinkedTextboxesChainId;
+ linkedTextboxesIter->second.nSeq = nSeq;
+
+ OUString sCheckForBrokenChains = linkedTextboxesIter->first;
+
+ //follow the chain and assign the same id, and incremental sequence numbers.
+ std::map<OUString, MSWordExportBase::LinkedTextboxInfo>::iterator followChainIter;
+ followChainIter = m_pImpl->m_rExport.m_aLinkedTextboxesHelper.find(linkedTextboxesIter->second.sNextChain);
+ while ( followChainIter != m_pImpl->m_rExport.m_aLinkedTextboxesHelper.end() )
+ {
+ //verify that the NEXT textbox also points to me as the PREVIOUS.
+ // A broken link indicates a leftover remnant that can be ignored.
+ if( followChainIter->second.sPrevChain != sCheckForBrokenChains )
+ break;
+
+ followChainIter->second.nId = m_pImpl->m_rExport.m_nLinkedTextboxesChainId;
+ followChainIter->second.nSeq = ++nSeq;
+
+ //empty next chain indicates the end of the linked chain.
+ if ( followChainIter->second.sNextChain.isEmpty() )
+ break;
+
+ sCheckForBrokenChains = followChainIter->first;
+ followChainIter = m_pImpl->m_rExport.m_aLinkedTextboxesHelper.find(followChainIter->second.sNextChain);
+ }
+ }
+ ++linkedTextboxesIter;
+ }
+ m_pImpl->m_rExport.m_bLinkedTextboxesHelperInitialized = true;
+ }
+
m_pImpl->m_rExport.m_pParentFrame = NULL;
bool skipTxBxContent = false ;
bool isTxbxLinked = false ;
- /* Check if the text box is linked and then decides whether
- to write the tag txbx or linkedTxbx
- */
- if (xPropSetInfo.is() && xPropSetInfo->hasPropertyByName("ChainPrevName") &&
- xPropSetInfo->hasPropertyByName("ChainNextName"))
+ OUString sLinkChainName;
+ if ( xPropSetInfo.is() )
{
- OUString sChainPrevName;
- OUString sChainNextName;
-
- xPropertySet->getPropertyValue("ChainPrevName") >>= sChainPrevName ;
- xPropertySet->getPropertyValue("ChainNextName") >>= sChainNextName ;
+ if ( xPropSetInfo->hasPropertyByName("LinkDisplayName") )
+ xPropertySet->getPropertyValue("LinkDisplayName") >>= sLinkChainName;
+ else if ( xPropSetInfo->hasPropertyByName("ChainName") )
+ xPropertySet->getPropertyValue("ChainName") >>= sLinkChainName;
+ }
- if (!sChainPrevName.isEmpty())
+ // second, check if THIS textbox is linked and then decide whether to write the tag txbx or linkedTxbx
+ linkedTextboxesIter = m_pImpl->m_rExport.m_aLinkedTextboxesHelper.find(sLinkChainName);
+ if ( linkedTextboxesIter != m_pImpl->m_rExport.m_aLinkedTextboxesHelper.end() )
+ {
+ if( (linkedTextboxesIter->second.nId !=0) && (linkedTextboxesIter->second.nSeq != 0) )
{
+ //not the first in the chain, so write the tag as linkedTxbx
+ pFS->singleElementNS(XML_wps, XML_linkedTxbx,
+ XML_id, I32S(linkedTextboxesIter->second.nId),
+ XML_seq, I32S(linkedTextboxesIter->second.nSeq),
+ FSEND);
/* no text content should be added to this tag,
since the textbox is linked, the entire content
is written in txbx block
*/
- ++m_pImpl->m_nSeq ;
- pFS->singleElementNS(XML_wps, XML_linkedTxbx,
- XML_id, I32S(m_pImpl->m_nId),
- XML_seq, I32S(m_pImpl->m_nSeq),
- FSEND);
skipTxBxContent = true ;
-
- //Text box chaining for a group of textboxes ends here,
- //therefore reset the seq.
- if (sChainNextName.isEmpty())
- m_pImpl->m_nSeq = 0 ;
}
- else if (sChainPrevName.isEmpty() && !sChainNextName.isEmpty())
+ else if( (linkedTextboxesIter->second.nId != 0) && (linkedTextboxesIter->second.nSeq == 0) )
{
/* this is the first textbox in the chaining, we add the text content
to this block*/
- ++m_pImpl->m_nId ;
//since the text box is linked, it needs an id.
pFS->startElementNS(XML_wps, XML_txbx,
- XML_id, I32S(m_pImpl->m_nId),
+ XML_id, I32S(linkedTextboxesIter->second.nId),
FSEND);
isTxbxLinked = true ;
}
diff --git a/sw/source/filter/ww8/wrtw8nds.cxx b/sw/source/filter/ww8/wrtw8nds.cxx
index 608d2b3..1cc2803 100644
--- a/sw/source/filter/ww8/wrtw8nds.cxx
+++ b/sw/source/filter/ww8/wrtw8nds.cxx
@@ -549,6 +549,69 @@ bool SwWW8AttrIter::IsAnchorLinkedToThisNode( sal_uLong nNodePos )
FlyProcessingState SwWW8AttrIter::OutFlys(sal_Int32 nSwPos)
{
+ // collection point to first gather info about all of the potentially linked textboxes: to be analyzed later.
+ OUString sLinkChainName;
+ sw::FrameIter linkedTextboxesIter = maFlyIter;
+ while ( linkedTextboxesIter != maFlyFrms.end() )
+ {
+ uno::Reference< drawing::XShape > xShape;
+ sw::Frame xFrame = *linkedTextboxesIter;
+ const SdrObject* pSdrObj = xFrame.GetFrameFormat().FindRealSdrObject();
+ if( pSdrObj )
+ xShape = uno::Reference< drawing::XShape >(const_cast<SdrObject*>(pSdrObj)->getUnoShape(), uno::UNO_QUERY);
+ uno::Reference< beans::XPropertySet > xPropertySet(xShape, uno::UNO_QUERY);
+ uno::Reference< beans::XPropertySetInfo > xPropertySetInfo;
+ if( xPropertySet.is() )
+ xPropertySetInfo = xPropertySet->getPropertySetInfo();
+ if( xPropertySetInfo.is() )
+ {
+ MSWordExportBase::LinkedTextboxInfo aLinkedTextboxInfo = MSWordExportBase::LinkedTextboxInfo();
+
+ if( xPropertySetInfo->hasPropertyByName("LinkDisplayName") )
+ xPropertySet->getPropertyValue("LinkDisplayName") >>= sLinkChainName;
+ else if( xPropertySetInfo->hasPropertyByName("ChainName") )
+ xPropertySet->getPropertyValue("ChainName") >>= sLinkChainName;
+
+ if( xPropertySetInfo->hasPropertyByName("ChainNextName") )
+ xPropertySet->getPropertyValue("ChainNextName") >>= aLinkedTextboxInfo.sNextChain;
+ if( xPropertySetInfo->hasPropertyByName("ChainPrevName") )
+ xPropertySet->getPropertyValue("ChainPrevName") >>= aLinkedTextboxInfo.sPrevChain;
+
+ //collect a list of linked textboxes: those with a NEXT or PREVIOUS link
+ if( !aLinkedTextboxInfo.sNextChain.isEmpty() || !aLinkedTextboxInfo.sPrevChain.isEmpty() )
+ {
+ assert( !sLinkChainName.isEmpty() );
+
+ //there are many discarded duplicates in documents - no duplicates allowed in the list, so try to find the real one.
+ //if this LinkDisplayName/ChainName already exists on a different shape...
+ // the earlier processed duplicates are thrown out unless this one can be proved as bad. (last processed duplicate usually is stored)
+ std::map<OUString,MSWordExportBase::LinkedTextboxInfo>::iterator linkFinder;
+ linkFinder = m_rExport.m_aLinkedTextboxesHelper.find(sLinkChainName);
+ if( linkFinder != m_rExport.m_aLinkedTextboxesHelper.end() )
+ {
+ //If my NEXT/PREV targets have already been discovered, but don't match me, then assume I'm an abandoned remnant
+ // (this logic fails if both me and one of my links are duplicated, and the remnants were added first.)
+ linkFinder = m_rExport.m_aLinkedTextboxesHelper.find(aLinkedTextboxInfo.sNextChain);
+ if( (linkFinder != m_rExport.m_aLinkedTextboxesHelper.end()) && (linkFinder->second.sPrevChain != sLinkChainName) )
+ {
+ ++linkedTextboxesIter;
+ break;
+ }
+
+ linkFinder = m_rExport.m_aLinkedTextboxesHelper.find(aLinkedTextboxInfo.sPrevChain);
+ if( (linkFinder != m_rExport.m_aLinkedTextboxesHelper.end()) && (linkFinder->second.sNextChain != sLinkChainName) )
+ {
+ ++linkedTextboxesIter;
+ break;
+ }
+ }
+ m_rExport.m_bLinkedTextboxesHelperInitialized = false;
+ m_rExport.m_aLinkedTextboxesHelper[sLinkChainName] = aLinkedTextboxInfo;
+ }
+ }
+ ++linkedTextboxesIter;
+ }
+
/*
#i2916#
May have an anchored graphic to be placed, loop through sorted array
diff --git a/sw/source/filter/ww8/wrtww8.cxx b/sw/source/filter/ww8/wrtww8.cxx
index 564381d..a5efd2e 100644
--- a/sw/source/filter/ww8/wrtww8.cxx
+++ b/sw/source/filter/ww8/wrtww8.cxx
@@ -1682,6 +1682,9 @@ void MSWordExportBase::WriteSpecialText( sal_uLong nStart, sal_uLong nEnd, sal_u
// bOutKF was setted / stored in WriteKF1
SetCurPam(nStart, nEnd);
+ // clear linked textboxes since old ones can't be linked to frames in this section
+ m_aLinkedTextboxesHelper.clear();
+
WriteText();
m_bOutPageDescs = bOldPageDescs;
diff --git a/sw/source/filter/ww8/wrtww8.hxx b/sw/source/filter/ww8/wrtww8.hxx
index 8691bfa..34f0412 100644
--- a/sw/source/filter/ww8/wrtww8.hxx
+++ b/sw/source/filter/ww8/wrtww8.hxx
@@ -490,6 +490,18 @@ public:
WW8_WrPlcAnnotations* m_pAtn;
WW8_WrPlcTextBoxes *m_pTextBxs, *m_pHFTextBxs;
+ struct LinkedTextboxInfo //help analyze textbox flow links
+ {
+ sal_Int32 nId;
+ sal_Int32 nSeq;
+ OUString sNextChain;
+ OUString sPrevChain;
+ LinkedTextboxInfo(): nId(0), nSeq(0) {}
+ };
+ std::map<OUString,LinkedTextboxInfo> m_aLinkedTextboxesHelper;
+ bool m_bLinkedTextboxesHelperInitialized = false;
+ sal_Int32 m_nLinkedTextboxesChainId=0;
+
const sw::Frame *m_pParentFrame; // If set we are exporting content inside
// a frame, e.g. a graphic node
commit e83cb37cf7546e8bc46d0d49b487dcd352b67093
Author: Jan Holesovsky <kendy at collabora.com>
Date: Fri Jul 3 18:14:31 2015 +0200
LOK: Don't try to absolutize URL's.
Based on a patch by Henry Castro.
Change-Id: Ia7aca20feb8f6095adf7dfe510ed78b1e9882740
diff --git a/desktop/source/lib/init.cxx b/desktop/source/lib/init.cxx
index ee47cd8..3a0ce67 100644
--- a/desktop/source/lib/init.cxx
+++ b/desktop/source/lib/init.cxx
@@ -161,13 +161,18 @@ static OUString getUString(const char* pString)
return OStringToOUString(sString, RTL_TEXTENCODING_UTF8);
}
-// Try to convert a relative URL to an absolute one
+/// Try to convert a relative URL to an absolute one, unless it already looks like an URL.
static OUString getAbsoluteURL(const char* pURL)
{
- OUString aURL( getUString( pURL ) );
+ OUString aURL(getUString(pURL));
+
+ // return unchanged if it likely is an URL already
+ if (aURL.indexOf("://") > 0)
+ return aURL;
+
OUString sAbsoluteDocUrl, sWorkingDir, sDocPathUrl;
- // FIXME: this would appear to kill non-file URLs.
+ // convert relative paths to absolute ones
osl_getProcessWorkingDir(&sWorkingDir.pData);
osl::FileBase::getFileURLFromSystemPath( aURL, sDocPathUrl );
osl::FileBase::getAbsoluteFileURL(sWorkingDir, sDocPathUrl, sAbsoluteDocUrl);
@@ -343,7 +348,7 @@ static LibreOfficeKitDocument* lo_documentLoadWithOptions(LibreOfficeKit* pThis,
SolarMutexGuard aGuard;
- OUString aURL = getAbsoluteURL(pURL);
+ OUString aURL(getAbsoluteURL(pURL));
pLib->maLastExceptionMsg.clear();
@@ -409,7 +414,7 @@ static int doc_saveAs(LibreOfficeKitDocument* pThis, const char* sUrl, const cha
LibLODocument_Impl* pDocument = static_cast<LibLODocument_Impl*>(pThis);
OUString sFormat = getUString(pFormat);
- OUString aURL = getAbsoluteURL(sUrl);
+ OUString aURL(getAbsoluteURL(sUrl));
try
{
commit c9175a1bd3249ad573ae6827bf19963a3ebe2fbc
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date: Fri Jul 3 17:52:44 2015 +0200
SwViewShell::ImplEndAction: avoid direct PaintDesktop()
With double-buffering enabled and typing quickly, one saw blinks in the
text sometimes. The reason was that PaintDesktop() painted directly
outside SwViewShell::Paint().
The problem is more visible with VCL_DOUBLEBUFFERING_AVOID_PAINT=1,
loading a simple document + pressing a key draw an unexpected white
rectangle.
Given that InvalidateWindows() already calls PaintDesktop() inside
Paint() implicitly (via SwViewShell::Paint()), fix the problem by just
avoiding the DLPrePaint2() + PaintDesktop() + DLPostPaint2() calls.
Change-Id: Ib8ce26a0bdd526bf85d362f0e865dd61d29f6d11
diff --git a/sw/source/core/view/viewsh.cxx b/sw/source/core/view/viewsh.cxx
index 0f27fc5..9462b8f 100644
--- a/sw/source/core/view/viewsh.cxx
+++ b/sw/source/core/view/viewsh.cxx
@@ -405,20 +405,7 @@ void SwViewShell::ImplEndAction( const bool bIdleEnd )
}
if ( bPaint )
{
- // #i75172# begin DrawingLayer paint
- // need to do begin/end DrawingLayer preparation for each single rectangle of the
- // repaint region. I already tried to prepare only once for the whole Region. This
- // seems to work (and does technically) but fails with transparent objects. Since the
- // region given to BeginDarwLayers() defines the clip region for DrawingLayer paint,
- // transparent objects in the single rectangles will indeed be painted multiple times.
- DLPrePaint2(vcl::Region(aRect.SVRect()));
-
- if ( bPaintsFromSystem )
- PaintDesktop(*GetOut(), aRect);
- pCurrentLayout->GetCurrShell()->InvalidateWindows(aRect.SVRect());
-
- // #i75172# end DrawingLayer paint
- DLPostPaint2(true);
+ InvalidateWindows(aRect.SVRect());
}
lcl_PaintTransparentFormControls(*this, aRect); // i#107365
commit abbe4f9d64073d77c4be93b7c89c03d0651bacef
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Jul 3 15:53:00 2015 +0100
fix deselect of textbox on slides with images in underlying master
The original work of tdf#55430 tries to select an object under
another one on the second click, but these images are unselectable
so this fails. Red Hat has a whole new shiny bunch of templates which
have such images in their masters.
Check if the object is selectable before continuing
Change-Id: I182abaf50e8bb1084c5819dc9e1ffd8b386a9e93
diff --git a/include/svx/svdpagv.hxx b/include/svx/svdpagv.hxx
index 5369616..8bf305f 100644
--- a/include/svx/svdpagv.hxx
+++ b/include/svx/svdpagv.hxx
@@ -235,6 +235,11 @@ public:
// Beim Gruppenobjekt muss wenigstens ein Member sichtbar sein,
// gesperrt sein darf keiner.
bool IsObjMarkable(SdrObject* pObj) const;
+ // hmm, selectable is surely the same as markable, now that I
+ // see this as I look for a place to put it. TO-DO,
+ // merge these
+ bool IsObjSelectable(SdrObject *pObj) const;
+
// Betreten (Editieren) einer Objektgruppe. Anschliessend liegen alle
// Memberobjekte der Gruppe im direkten Zugriff. Alle anderen Objekte
diff --git a/sd/source/ui/func/fusel.cxx b/sd/source/ui/func/fusel.cxx
index dd63708..000ac60 100644
--- a/sd/source/ui/func/fusel.cxx
+++ b/sd/source/ui/func/fusel.cxx
@@ -684,9 +684,12 @@ bool FuSelection::MouseButtonUp(const MouseEvent& rMEvt)
**************************************************************/
if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK))
{
- mpView->UnmarkAllObj();
- mpView->MarkObj(pObj,pPV,false,false);
- return true;
+ if (pPV->IsObjSelectable(pObj))
+ {
+ mpView->UnmarkAllObj();
+ mpView->MarkObj(pObj,pPV,false,false);
+ return true;
+ }
}
/**************************************************************
* Toggle between selection and rotation
diff --git a/sd/source/ui/func/futext.cxx b/sd/source/ui/func/futext.cxx
index e308e2e..c3b4090 100644
--- a/sd/source/ui/func/futext.cxx
+++ b/sd/source/ui/func/futext.cxx
@@ -657,9 +657,12 @@ bool FuText::MouseButtonUp(const MouseEvent& rMEvt)
**************************************************************/
if (mpView->PickObj(aMDPos, mpView->getHitTolLog(), pObj, pPV, SdrSearchOptions::ALSOONMASTER | SdrSearchOptions::BEFOREMARK))
{
- mpView->UnmarkAllObj();
- mpView->MarkObj(pObj,pPV,false,false);
- return bReturn;
+ if (pPV->IsObjSelectable(pObj))
+ {
+ mpView->UnmarkAllObj();
+ mpView->MarkObj(pObj,pPV,false,false);
+ return bReturn;
+ }
}
}
}
diff --git a/svx/source/svdraw/svdmrkv.cxx b/svx/source/svdraw/svdmrkv.cxx
index f58f88b..d281507 100644
--- a/svx/source/svdraw/svdmrkv.cxx
+++ b/svx/source/svdraw/svdmrkv.cxx
@@ -1226,6 +1226,33 @@ void SdrMarkView::SetRef2(const Point& rPt)
}
}
+bool SdrPageView::IsObjSelectable(SdrObject *pObj) const
+{
+ SdrLayerID nLay=pObj->GetLayer();
+ bool bRaus=!pObj->IsInserted(); // Obj deleted?
+ if (!pObj->Is3DObj()) {
+ bRaus=bRaus || pObj->GetPage()!=GetPage(); // Obj suddenly in different Page or Group
+ }
+ bRaus=bRaus || GetLockedLayers().IsSet(nLay) || // Layer locked?
+ !GetVisibleLayers().IsSet(nLay); // Layer invisible?
+
+ if( !bRaus )
+ bRaus = !pObj->IsVisible(); // invisible objects can not be selected
+
+ if (!bRaus) {
+ // Grouped objects can now be selected.
+ // After EnterGroup the higher-level objects,
+ // have to be deselected, though.
+ const SdrObjList* pOOL=pObj->GetObjList();
+ const SdrObjList* pVOL=GetObjList();
+ while (pOOL!=NULL && pOOL!=pVOL) {
+ pOOL=pOOL->GetUpList();
+ }
+ bRaus=pOOL!=pVOL;
+ }
+ return !bRaus;
+}
+
void SdrMarkView::CheckMarked()
{
for (size_t nm=GetMarkedObjectCount(); nm>0;) {
@@ -1233,29 +1260,7 @@ void SdrMarkView::CheckMarked()
SdrMark* pM=GetSdrMarkByIndex(nm);
SdrObject* pObj=pM->GetMarkedSdrObj();
SdrPageView* pPV=pM->GetPageView();
- SdrLayerID nLay=pObj->GetLayer();
- bool bRaus=!pObj->IsInserted(); // Obj deleted?
- if (!pObj->Is3DObj()) {
- bRaus=bRaus || pObj->GetPage()!=pPV->GetPage(); // Obj suddenly in different Page or Group
- }
- bRaus=bRaus || pPV->GetLockedLayers().IsSet(nLay) || // Layer locked?
- !pPV->GetVisibleLayers().IsSet(nLay); // Layer invisible?
-
- if( !bRaus )
- bRaus = !pObj->IsVisible(); // invisible objects can not be selected
-
- if (!bRaus) {
- // Grouped objects can now be selected.
- // After EnterGroup the higher-level objects,
- // have to be deselected, though.
- const SdrObjList* pOOL=pObj->GetObjList();
- const SdrObjList* pVOL=pPV->GetObjList();
- while (pOOL!=NULL && pOOL!=pVOL) {
- pOOL=pOOL->GetUpList();
- }
- bRaus=pOOL!=pVOL;
- }
-
+ bool bRaus=!pPV->IsObjSelectable(pObj);
if (bRaus)
{
GetMarkedObjectListWriteAccess().DeleteMark(nm);
commit 2a583603dec40090289ddb5b4b70d800794cf57b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jul 3 16:57:50 2015 +0200
Make test code more robust
Change-Id: If3b58c02b289224938b1dfd8074f9802ea6d2474
diff --git a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
index a5d0740..2971669 100644
--- a/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
+++ b/qadevOOo/tests/java/ifc/accessibility/_XAccessibleEventBroadcaster.java
@@ -77,7 +77,9 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest {
if (nev instanceof com.sun.star.accessibility.XAccessible) {
System.out.println("New: "+((XAccessible)nev).getAccessibleContext().getAccessibleName());
}
- notifiedEvent = ev;
+ synchronized (this) {
+ notifiedEvent = ev;
+ }
}
public void disposing(EventObject ev) {}
@@ -118,7 +120,11 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest {
boolean works = true;
- if (list.notifiedEvent == null) {
+ AccessibleEventObject ne;
+ synchronized (list) {
+ ne = list.notifiedEvent;
+ }
+ if (ne == null) {
if (!isTransient) {
log.println("listener wasn't called");
works = false;
@@ -151,17 +157,23 @@ public class _XAccessibleEventBroadcaster extends MultiMethodTest {
public void _removeEventListener() throws Exception {
requiredMethod("addEventListener()");
- list.notifiedEvent = null;
-
log.println("remove listener");
oObj.removeAccessibleEventListener(list);
+ synchronized (list) {
+ list.notifiedEvent = null;
+ }
+
log.println("fire event");
prod.fireEvent() ;
waitForEventIdle();
- if (list.notifiedEvent == null) {
+ AccessibleEventObject ne;
+ synchronized (list) {
+ ne = list.notifiedEvent;
+ }
+ if (ne == null) {
log.println("listener wasn't called -- OK");
}
commit a6f5770b4aaaa6506a22eae0d641ad48f9b6d239
Author: Michael Stahl <mstahl at redhat.com>
Date: Fri Jul 3 16:53:45 2015 +0200
Revert "loplugin:unusedmethods sax,shell,stoc,basegfx"
The basegfx changes appear to break Windows builds.
This reverts commit 3b32c5898ff4e744d3f18b00421b433500426d74.
diff --git a/include/basegfx/color/bcolor.hxx b/include/basegfx/color/bcolor.hxx
index 4358e05..2bdd420 100644
--- a/include/basegfx/color/bcolor.hxx
+++ b/include/basegfx/color/bcolor.hxx
@@ -131,6 +131,15 @@ namespace basegfx
return *this;
}
+ // blend to another color using luminance
+ void blend(const BColor& rColor)
+ {
+ const double fLuminance(luminance());
+ mfX = rColor.getRed() * fLuminance;
+ mfY = rColor.getGreen() * fLuminance;
+ mfZ = rColor.getBlue() * fLuminance;
+ }
+
// luminance
double luminance() const
{
@@ -155,6 +164,16 @@ namespace basegfx
return sqrt(fDistR * fDistR + fDistG * fDistG + fDistB * fDistB);
}
+ double getMinimumDistance(const BColor& rColor) const
+ {
+ const double fDistR(getDistanceRed(rColor));
+ const double fDistG(getDistanceGreen(rColor));
+ const double fDistB(getDistanceBlue(rColor));
+
+ double fRetval(fDistR < fDistG ? fDistR : fDistG);
+ return (fRetval < fDistB ? fRetval : fDistB);
+ }
+
double getMaximumDistance(const BColor& rColor) const
{
const double fDistR(getDistanceRed(rColor));
@@ -187,6 +206,18 @@ namespace basegfx
return static_cast<const BColor&>( ::basegfx::B3DTuple::getEmptyTuple() );
}
+ com::sun::star::uno::Sequence< double > colorToDoubleSequence(const com::sun::star::uno::Reference< com::sun::star::rendering::XGraphicDevice >& /*xGraphicDevice*/) const
+ {
+ com::sun::star::uno::Sequence< double > aRet(4);
+ double* pRet = aRet.getArray();
+
+ pRet[0] = mfX;
+ pRet[1] = mfY;
+ pRet[2] = mfZ;
+ pRet[3] = 1.0;
+
+ return aRet;
+ }
};
} // end of namespace basegfx
diff --git a/include/basegfx/matrix/b2dhommatrixtools.hxx b/include/basegfx/matrix/b2dhommatrixtools.hxx
index 41a17ec..b2aef89 100644
--- a/include/basegfx/matrix/b2dhommatrixtools.hxx
+++ b/include/basegfx/matrix/b2dhommatrixtools.hxx
@@ -218,6 +218,7 @@ namespace basegfx
const B2DVector& getScale() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maScale; }
const B2DVector& getTranslate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return maTranslate; }
double getRotate() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfRotate; }
+ double getShearX() const { const_cast< B2DHomMatrixBufferedOnDemandDecompose* >(this)->impCheckDecompose(); return mfShearX; }
};
} // end of namespace tools
diff --git a/include/basegfx/pixel/bpixel.hxx b/include/basegfx/pixel/bpixel.hxx
index fda6a79..cf5c7a3 100644
--- a/include/basegfx/pixel/bpixel.hxx
+++ b/include/basegfx/pixel/bpixel.hxx
@@ -95,16 +95,21 @@ namespace basegfx
sal_uInt8 getGreen() const { return maPixelUnion.maRGBO.mnG; }
sal_uInt8 getBlue() const { return maPixelUnion.maRGBO.mnB; }
sal_uInt8 getOpacity() const { return maPixelUnion.maRGBO.mnO; }
+ sal_uInt32 getRedGreenBlueOpacity() const { return maPixelUnion.maCombinedRGBO.mnValue; }
// data access write
void setRed(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnR = nNew; }
void setGreen(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnG = nNew; }
void setBlue(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnB = nNew; }
void setOpacity(sal_uInt8 nNew) { maPixelUnion.maRGBO.mnO = nNew; }
+ void setRedGreenBlueOpacity(sal_uInt32 nRedGreenBlueOpacity) { maPixelUnion.maCombinedRGBO.mnValue = nRedGreenBlueOpacity; }
+ void setRedGreenBlue(sal_uInt8 nR, sal_uInt8 nG, sal_uInt8 nB) { maPixelUnion.maRGBO.mnR = nR; maPixelUnion.maRGBO.mnG = nG; maPixelUnion.maRGBO.mnB = nB; }
// comparators
bool isInvisible() const { return (0 == maPixelUnion.maRGBO.mnO); }
bool isVisible() const { return (0 != maPixelUnion.maRGBO.mnO); }
+ bool isEmpty() const { return isInvisible(); }
+ bool isUsed() const { return isVisible(); }
bool operator==( const BPixel& rPixel ) const
{
diff --git a/include/basegfx/range/b1drange.hxx b/include/basegfx/range/b1drange.hxx
index c1e35b1..1d8fe92 100644
--- a/include/basegfx/range/b1drange.hxx
+++ b/include/basegfx/range/b1drange.hxx
@@ -71,6 +71,12 @@ namespace basegfx
return maRange.isEmpty();
}
+ /// reset the object to empty state again, clearing all values
+ void reset()
+ {
+ maRange.reset();
+ }
+
bool operator==( const B1DRange& rRange ) const
{
return (maRange == rRange.maRange);
@@ -81,6 +87,11 @@ namespace basegfx
return (maRange != rRange.maRange);
}
+ bool equal(const B1DRange& rRange) const
+ {
+ return (maRange.equal(rRange.maRange));
+ }
+
/// get lower bound of the set. returns arbitrary values for empty sets.
double getMinimum() const
{
@@ -111,6 +122,12 @@ namespace basegfx
return maRange.isInside(fValue);
}
+ /// yields true if rRange is inside, or equal to set
+ bool isInside(const B1DRange& rRange) const
+ {
+ return maRange.isInside(rRange.maRange);
+ }
+
/// yields true if rRange at least partly inside set
bool overlaps(const B1DRange& rRange) const
{
@@ -141,6 +158,11 @@ namespace basegfx
maRange.intersect(rRange.maRange);
}
+ /// grow set by fValue on both sides
+ void grow(double fValue)
+ {
+ maRange.grow(fValue);
+ }
};
} // end of namespace basegfx
diff --git a/include/basegfx/range/b2ibox.hxx b/include/basegfx/range/b2ibox.hxx
index b5c4d33..09ae867 100644
--- a/include/basegfx/range/b2ibox.hxx
+++ b/include/basegfx/range/b2ibox.hxx
@@ -104,6 +104,13 @@ namespace basegfx
return maRangeX.isEmpty() || maRangeY.isEmpty();
}
+ /// reset the object to empty state again, clearing all values
+ void reset()
+ {
+ maRangeX.reset();
+ maRangeY.reset();
+ }
+
bool operator==( const B2IBox& rBox ) const
{
return (maRangeX == rBox.maRangeX
@@ -170,6 +177,24 @@ namespace basegfx
);
}
+ /// return difference between upper and lower value. returns (0,0) for empty sets.
+ B2I64Tuple getRange() const
+ {
+ return B2I64Tuple(
+ maRangeX.getRange(),
+ maRangeY.getRange()
+ );
+ }
+
+ /// return center point of set. returns (0,0) for empty sets.
+ B2DPoint getCenter() const
+ {
+ return B2DPoint(
+ maRangeX.getCenter(),
+ maRangeY.getCenter()
+ );
+ }
+
/// yields true if point is contained in set
bool isInside(const B2ITuple& rTuple) const
{
@@ -179,6 +204,24 @@ namespace basegfx
);
}
+ /// yields true if rBox is inside, or equal to set
+ bool isInside(const B2IBox& rBox) const
+ {
+ return (
+ maRangeX.isInside(rBox.maRangeX)
+ && maRangeY.isInside(rBox.maRangeY)
+ );
+ }
+
+ /// yields true if rBox at least partly inside set
+ bool overlaps(const B2IBox& rBox) const
+ {
+ return (
+ maRangeX.overlaps(rBox.maRangeX)
+ && maRangeY.overlaps(rBox.maRangeY)
+ );
+ }
+
/// add point to the set, expanding as necessary
void expand(const B2ITuple& rTuple)
{
@@ -186,6 +229,13 @@ namespace basegfx
maRangeY.expand(rTuple.getY());
}
+ /// add rBox to the set, expanding as necessary
+ void expand(const B2IBox& rBox)
+ {
+ maRangeX.expand(rBox.maRangeX);
+ maRangeY.expand(rBox.maRangeY);
+ }
+
/// calc set intersection
void intersect(const B2IBox& rBox)
{
@@ -193,6 +243,13 @@ namespace basegfx
maRangeY.intersect(rBox.maRangeY);
}
+ /// grow set by nValue on all sides
+ void grow(sal_Int32 nValue)
+ {
+ maRangeX.grow(nValue);
+ maRangeY.grow(nValue);
+ }
+
private:
BasicBox maRangeX;
BasicBox maRangeY;
diff --git a/include/basegfx/range/b2irange.hxx b/include/basegfx/range/b2irange.hxx
index 7a07229..65756df 100644
--- a/include/basegfx/range/b2irange.hxx
+++ b/include/basegfx/range/b2irange.hxx
@@ -178,6 +178,15 @@ namespace basegfx
);
}
+ /// return center point of set. returns (0,0) for empty sets.
+ B2DPoint getCenter() const
+ {
+ return B2DPoint(
+ maRangeX.getCenter(),
+ maRangeY.getCenter()
+ );
+ }
+
/// yields true if given point is contained in set
bool isInside(const B2ITuple& rTuple) const
{
@@ -187,6 +196,33 @@ namespace basegfx
);
}
+ /// yields true if rRange is inside, or equal to set
+ bool isInside(const B2IRange& rRange) const
+ {
+ return (
+ maRangeX.isInside(rRange.maRangeX)
+ && maRangeY.isInside(rRange.maRangeY)
+ );
+ }
+
+ /// yields true if rRange at least partly inside set
+ bool overlaps(const B2IRange& rRange) const
+ {
+ return (
+ maRangeX.overlaps(rRange.maRangeX)
+ && maRangeY.overlaps(rRange.maRangeY)
+ );
+ }
+
+ /// yields true if overlaps(rRange) does, and the overlap is larger than infinitesimal
+ bool overlapsMore(const B2IRange& rRange) const
+ {
+ return (
+ maRangeX.overlapsMore(rRange.maRangeX)
+ && maRangeY.overlapsMore(rRange.maRangeY)
+ );
+ }
+
/// add point to the set, expanding as necessary
void expand(const B2ITuple& rTuple)
{
@@ -194,6 +230,13 @@ namespace basegfx
maRangeY.expand(rTuple.getY());
}
+ /// add rRange to the set, expanding as necessary
+ void expand(const B2IRange& rRange)
+ {
+ maRangeX.expand(rRange.maRangeX);
+ maRangeY.expand(rRange.maRangeY);
+ }
+
/// calc set intersection
void intersect(const B2IRange& rRange)
{
@@ -201,6 +244,13 @@ namespace basegfx
maRangeY.intersect(rRange.maRangeY);
}
+ /// grow set by nValue on all sides
+ void grow(sal_Int32 nValue)
+ {
+ maRangeX.grow(nValue);
+ maRangeY.grow(nValue);
+ }
+
private:
typedef ::basegfx::BasicRange< ValueType, TraitsType > MyBasicRange;
diff --git a/include/basegfx/range/b3drange.hxx b/include/basegfx/range/b3drange.hxx
index 351dea8..3ce6925 100644
--- a/include/basegfx/range/b3drange.hxx
+++ b/include/basegfx/range/b3drange.hxx
@@ -102,6 +102,13 @@ namespace basegfx
|| maRangeZ != rRange.maRangeZ);
}
+ bool equal(const B3DRange& rRange) const
+ {
+ return (maRangeX.equal(rRange.maRangeX)
+ && maRangeY.equal(rRange.maRangeY)
+ && maRangeZ.equal(rRange.maRangeZ));
+ }
+
double getMinX() const
{
return maRangeX.getMinimum();
@@ -147,6 +154,24 @@ namespace basegfx
return maRangeZ.getRange();
}
+ B3DPoint getMinimum() const
+ {
+ return B3DPoint(
+ maRangeX.getMinimum(),
+ maRangeY.getMinimum(),
+ maRangeZ.getMinimum()
+ );
+ }
+
+ B3DPoint getMaximum() const
+ {
+ return B3DPoint(
+ maRangeX.getMaximum(),
+ maRangeY.getMaximum(),
+ maRangeZ.getMaximum()
+ );
+ }
+
B3DVector getRange() const
{
return B3DVector(
@@ -165,6 +190,39 @@ namespace basegfx
);
}
+ double getCenterX() const
+ {
+ return maRangeX.getCenter();
+ }
+
+ double getCenterY() const
+ {
+ return maRangeY.getCenter();
+ }
+
+ double getCenterZ() const
+ {
+ return maRangeZ.getCenter();
+ }
+
+ bool isInside(const B3DTuple& rTuple) const
+ {
+ return (
+ maRangeX.isInside(rTuple.getX())
+ && maRangeY.isInside(rTuple.getY())
+ && maRangeZ.isInside(rTuple.getZ())
+ );
+ }
+
+ bool isInside(const B3DRange& rRange) const
+ {
+ return (
+ maRangeX.isInside(rRange.maRangeX)
+ && maRangeY.isInside(rRange.maRangeY)
+ && maRangeZ.isInside(rRange.maRangeZ)
+ );
+ }
+
bool overlaps(const B3DRange& rRange) const
{
return (
@@ -188,6 +246,13 @@ namespace basegfx
maRangeZ.expand(rRange.maRangeZ);
}
+ void intersect(const B3DRange& rRange)
+ {
+ maRangeX.intersect(rRange.maRangeX);
+ maRangeY.intersect(rRange.maRangeY);
+ maRangeZ.intersect(rRange.maRangeZ);
+ }
+
void grow(double fValue)
{
maRangeX.grow(fValue);
diff --git a/include/basegfx/tuple/b2i64tuple.hxx b/include/basegfx/tuple/b2i64tuple.hxx
index e4b40ac..2d0bfcf 100644
--- a/include/basegfx/tuple/b2i64tuple.hxx
+++ b/include/basegfx/tuple/b2i64tuple.hxx
@@ -91,6 +91,18 @@ namespace basegfx
return mnY;
}
+ /// Set X-Coordinate of 2D Tuple
+ void setX(sal_Int64 fX)
+ {
+ mnX = fX;
+ }
+
+ /// Set Y-Coordinate of 2D Tuple
+ void setY(sal_Int64 fY)
+ {
+ mnY = fY;
+ }
+
/// Array-access to 2D Tuple
const sal_Int64& operator[] (int nPos) const
{
@@ -159,6 +171,8 @@ namespace basegfx
return B2I64Tuple(-mnX, -mnY);
}
+ bool equalZero() const { return mnX == 0 && mnY == 0; }
+
bool operator==( const B2I64Tuple& rTup ) const
{
return this == &rTup || (rTup.mnX == mnX && rTup.mnY == mnY);
diff --git a/include/basegfx/tuple/b3ituple.hxx b/include/basegfx/tuple/b3ituple.hxx
index 7802101..3bd9199 100644
--- a/include/basegfx/tuple/b3ituple.hxx
+++ b/include/basegfx/tuple/b3ituple.hxx
@@ -104,6 +104,24 @@ namespace basegfx
return mnZ;
}
+ /// set X-Coordinate of 3D Tuple
+ void setX(sal_Int32 nX)
+ {
+ mnX = nX;
+ }
+
+ /// set Y-Coordinate of 3D Tuple
+ void setY(sal_Int32 nY)
+ {
+ mnY = nY;
+ }
+
+ /// set Z-Coordinate of 3D Tuple
+ void setZ(sal_Int32 nZ)
+ {
+ mnZ = nZ;
+ }
+
/// Array-access to 3D Tuple
const sal_Int32& operator[] (int nPos) const
{
diff --git a/include/basegfx/vector/b3dvector.hxx b/include/basegfx/vector/b3dvector.hxx
index 1e8572e..8a8997b 100644
--- a/include/basegfx/vector/b3dvector.hxx
+++ b/include/basegfx/vector/b3dvector.hxx
@@ -126,6 +126,18 @@ namespace basegfx
return sqrt(fLen);
}
+ /** Calculate the length in the XY-Plane for this 3D Vector
+
+ @return The XY-Plane Length of the 3D Vector
+ */
+ double getXYLength() const
+ {
+ double fLen((mfX * mfX) + (mfY * mfY));
+ if((0.0 == fLen) || (1.0 == fLen))
+ return fLen;
+ return sqrt(fLen);
+ }
+
/** Calculate the length in the XZ-Plane for this 3D Vector
@return The XZ-Plane Length of the 3D Vector
@@ -182,6 +194,20 @@ namespace basegfx
*/
B3DVector& normalize();
+ /** Test if this 3D Vector is normalized
+
+ @return
+ true if lenth of vector is equal to 1.0
+ false else
+ */
+ bool isNormalized() const
+ {
+ const double fOne(1.0);
+ const double fScalar(scalar(*this));
+
+ return (::basegfx::fTools::equal(fOne, fScalar));
+ }
+
/** get a 3D Vector which is perpendicular to this and a given 3D Vector
@attention This only works if this and the given 3D Vector are
diff --git a/sax/inc/xml2utf.hxx b/sax/inc/xml2utf.hxx
index bbbfd41..b9ffee3 100644
--- a/sax/inc/xml2utf.hxx
+++ b/sax/inc/xml2utf.hxx
@@ -56,6 +56,10 @@ public:
Unicode2TextConverter( rtl_TextEncoding encoding );
~Unicode2TextConverter();
+ inline ::com::sun::star::uno::Sequence<sal_Int8> convert( const OUString &s )
+ {
+ return convert( s.getStr() , s.getLength() );
+ }
::com::sun::star::uno::Sequence<sal_Int8> convert( const sal_Unicode * , sal_Int32 nLength );
bool canContinue() { return m_bCanContinue; }
diff --git a/shell/inc/internal/i_xml_parser_event_handler.hxx b/shell/inc/internal/i_xml_parser_event_handler.hxx
index 48dd746..77db6321 100644
--- a/shell/inc/internal/i_xml_parser_event_handler.hxx
+++ b/shell/inc/internal/i_xml_parser_event_handler.hxx
@@ -40,6 +40,10 @@ class i_xml_parser_event_handler
public:
virtual ~i_xml_parser_event_handler() {};
+ virtual void start_document() = 0;
+
+ virtual void end_document() = 0;
+
virtual void start_element(
const string_t& raw_name,
const string_t& local_name,
@@ -55,6 +59,9 @@ public:
virtual void ignore_whitespace(
const string_t& whitespaces) = 0;
+ virtual void processing_instruction(
+ const string_t& target, const string_t& data) = 0;
+
virtual void comment(const string_t& comment) = 0;
};
diff --git a/shell/source/unix/sysshell/recently_used_file_handler.cxx b/shell/source/unix/sysshell/recently_used_file_handler.cxx
index 0beba20..e66d96d 100644
--- a/shell/source/unix/sysshell/recently_used_file_handler.cxx
+++ b/shell/source/unix/sysshell/recently_used_file_handler.cxx
@@ -266,9 +266,16 @@ namespace /* private */ {
current_element_ += character;
}
+ virtual void start_document() SAL_OVERRIDE {}
+ virtual void end_document() SAL_OVERRIDE {}
+
virtual void ignore_whitespace(const string_t& /*whitespaces*/) SAL_OVERRIDE
{}
+ virtual void processing_instruction(
+ const string_t& /*target*/, const string_t& /*data*/) SAL_OVERRIDE
+ {}
+
virtual void comment(const string_t& /*comment*/) SAL_OVERRIDE
{}
private:
diff --git a/stoc/source/corereflection/base.hxx b/stoc/source/corereflection/base.hxx
index 426c2d2..ea1b852 100644
--- a/stoc/source/corereflection/base.hxx
+++ b/stoc/source/corereflection/base.hxx
@@ -159,6 +159,10 @@ public:
{ return _pTypeDescr; }
IdlReflectionServiceImpl * getReflection() const
{ return _pReflection; }
+ css::uno::Reference< css::lang::XMultiServiceFactory > getSMgr() const
+ { return _pReflection->getSMgr(); }
+ css::uno::Reference< css::container::XHierarchicalNameAccess > getTDMgr() const
+ { return getReflection()->getTDMgr(); }
// Ctor
IdlClassImpl( IdlReflectionServiceImpl * pReflection,
@@ -342,6 +346,8 @@ protected:
public:
IdlReflectionServiceImpl * getReflection() const
{ return _pReflection; }
+ css::uno::Reference< css::lang::XMultiServiceFactory > getSMgr() const
+ { return _pReflection->getSMgr(); }
typelib_TypeDescription * getTypeDescr() const
{ return _pTypeDescr; }
typelib_TypeDescription * getDeclTypeDescr() const
diff --git a/stoc/source/javavm/javavm.hxx b/stoc/source/javavm/javavm.hxx
index cf3e358..a8046b6 100644
--- a/stoc/source/javavm/javavm.hxx
+++ b/stoc/source/javavm/javavm.hxx
@@ -128,6 +128,9 @@ private:
virtual void SAL_CALL disposing() SAL_OVERRIDE;
+ JavaVM * createJavaVM(JVM const & jvm, JNIEnv ** pMainThreadEnv);
+ // throws css::uno::RuntimeException
+
void registerConfigChangesListener();
void setINetSettingsInVM(bool set_reset);
commit 5bc343cc723f993ed112cf5c700e3f397527d671
Author: Adolfo Jayme Barrientos <fitojb at ubuntu.com>
Date: Fri Jul 3 09:53:29 2015 -0500
Start Center: Better icon for Recent Files
Change-Id: I99a87da22d877bc1386552a8978b0bf5e8e7f51f
diff --git a/icon-themes/tango/framework/res/recent-documents.png b/icon-themes/tango/framework/res/recent-documents.png
index 93fddb8..eb7d222 100644
Binary files a/icon-themes/tango/framework/res/recent-documents.png and b/icon-themes/tango/framework/res/recent-documents.png differ
commit c6483666232a231446190d5c256857db45c5e4cc
Author: Matthias Freund <matti_lx at secure.mailbox.org>
Date: Tue Jun 30 18:32:43 2015 +0200
tdf#92425 - Correct the inactive pageindicators
The inactive pageindicators had the same grey like the active ones, I correct
this and changed the dark grey into light grey.
Change-Id: Iea810d466504ceb80750c45358a01f8b8d3c8b9e
Reviewed-on: https://gerrit.libreoffice.org/16621
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Yousuf Philips <philipz85 at hotmail.com>
diff --git a/icon-themes/sifr/sw/res/doublepage_10x22.png b/icon-themes/sifr/sw/res/doublepage_10x22.png
index ccdf656..27630e3 100644
Binary files a/icon-themes/sifr/sw/res/doublepage_10x22.png and b/icon-themes/sifr/sw/res/doublepage_10x22.png differ
diff --git a/icon-themes/sifr/sw/res/emptypage_10x14.png b/icon-themes/sifr/sw/res/emptypage_10x14.png
index aae3865..3a781f3 100644
Binary files a/icon-themes/sifr/sw/res/emptypage_10x14.png and b/icon-themes/sifr/sw/res/emptypage_10x14.png differ
diff --git a/icon-themes/sifr/sw/res/twopages_10x24.png b/icon-themes/sifr/sw/res/twopages_10x24.png
index 9aa128e..c32ee06 100644
Binary files a/icon-themes/sifr/sw/res/twopages_10x24.png and b/icon-themes/sifr/sw/res/twopages_10x24.png differ
commit bded4ddd6da0de2c465b28a51d773720338542c3
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jul 3 11:22:38 2015 +0200
Make RegistryTypeWriter non-copyable
(and note the operator == vs. = typo)
Change-Id: I9c25149967ed9b80f5e8f014de0dfee2e8f485d8
diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index 288beb9..689bc2d 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -1165,14 +1165,6 @@ void TypeWriter::createBlop()
extern "C" {
-static void TYPEREG_CALLTYPE acquire(TypeWriterImpl hEntry)
-{
- TypeWriter* pEntry = static_cast<TypeWriter*>(hEntry);
-
- if (pEntry != NULL)
- pEntry->m_refCount++;
-}
-
static void TYPEREG_CALLTYPE release(TypeWriterImpl hEntry)
{
TypeWriter* pEntry = static_cast<TypeWriter*>(hEntry);
@@ -1374,29 +1366,11 @@ RegistryTypeWriter::RegistryTypeWriter(RTTypeClass RTTypeClass,
referenceCount);
}
-RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy)
- : m_hImpl(toCopy.m_hImpl)
-{
- acquire(m_hImpl);
-}
-
RegistryTypeWriter::~RegistryTypeWriter()
{
release(m_hImpl);
}
-RegistryTypeWriter& RegistryTypeWriter::operator == (const RegistryTypeWriter& toAssign)
-{
- if (m_hImpl != toAssign.m_hImpl)
- {
- release(m_hImpl);
- m_hImpl = toAssign.m_hImpl;
- acquire(m_hImpl);
- }
-
- return *this;
-}
-
void RegistryTypeWriter::setFieldData( sal_uInt16 index,
const rtl::OUString& name,
const rtl::OUString& typeName,
diff --git a/registry/source/reflwrit.hxx b/registry/source/reflwrit.hxx
index 9bb8475..dcf2eec 100644
--- a/registry/source/reflwrit.hxx
+++ b/registry/source/reflwrit.hxx
@@ -58,18 +58,12 @@ public:
sal_uInt16 methodCount,
sal_uInt16 referenceCount);
- /// Copy constructcor
- RegistryTypeWriter(const RegistryTypeWriter& toCopy);
-
/** Destructor. The Destructor frees the internal data block.
The pointer (returned by getBlop) will be set to NULL.
*/
~RegistryTypeWriter();
- /// Assign operator
- RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
-
/** sets the data for a field member of a type blob.
@param index indicates the index of the field.
@@ -100,7 +94,9 @@ public:
*/
sal_uInt32 getBlopSize();
-protected:
+private:
+ RegistryTypeWriter(RegistryTypeWriter &) = delete;
+ void operator =(RegistryTypeWriter) = delete;
/// stores the handle of an implementation class
TypeWriterImpl m_hImpl;
commit 79429448052d4b69cc235000b74f3f8d6fa5a74c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jul 3 11:19:50 2015 +0200
Remove RegistryTypeWriter_Api indirection
Change-Id: I313adfb72272a631299efb3d2464873853a126be
diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index c8ec720..288beb9 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -1356,26 +1356,66 @@ static TypeWriterImpl TYPEREG_CALLTYPE createEntry(
return t;
}
-RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api()
+}
+
+RegistryTypeWriter::RegistryTypeWriter(RTTypeClass RTTypeClass,
+ const rtl::OUString& typeName,
+ const rtl::OUString& superTypeName,
+ sal_uInt16 fieldCount,
+ sal_uInt16 methodCount,
+ sal_uInt16 referenceCount)
+ : m_hImpl(NULL)
{
- static RegistryTypeWriter_Api aApi= {0,0,0,0,0,0};
- if (!aApi.acquire)
- {
- aApi.createEntry = &createEntry;
- aApi.acquire = &acquire;
- aApi.release = &release;
- aApi.setFieldData = &setFieldData;
- aApi.getBlop = &getBlop;
- aApi.getBlopSize = &getBlopSize;
-
- return (&aApi);
- }
- else
+ m_hImpl = createEntry(RTTypeClass,
+ typeName.pData,
+ superTypeName.pData,
+ fieldCount,
+ methodCount,
+ referenceCount);
+}
+
+RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy)
+ : m_hImpl(toCopy.m_hImpl)
+{
+ acquire(m_hImpl);
+}
+
+RegistryTypeWriter::~RegistryTypeWriter()
+{
+ release(m_hImpl);
+}
+
+RegistryTypeWriter& RegistryTypeWriter::operator == (const RegistryTypeWriter& toAssign)
+{
+ if (m_hImpl != toAssign.m_hImpl)
{
- return (&aApi);
+ release(m_hImpl);
+ m_hImpl = toAssign.m_hImpl;
+ acquire(m_hImpl);
}
+
+ return *this;
}
+void RegistryTypeWriter::setFieldData( sal_uInt16 index,
+ const rtl::OUString& name,
+ const rtl::OUString& typeName,
+ const rtl::OUString& doku,
+ const rtl::OUString& fileName,
+ RTFieldAccess access,
+ const RTConstValue& constValue)
+{
+ ::setFieldData(m_hImpl, index, name.pData, typeName.pData, doku.pData, fileName.pData, access, constValue.m_type, constValue.m_value);
+}
+
+const sal_uInt8* RegistryTypeWriter::getBlop()
+{
+ return ::getBlop(m_hImpl);
+}
+
+sal_uInt32 RegistryTypeWriter::getBlopSize()
+{
+ return ::getBlopSize(m_hImpl);
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/registry/source/reflwrit.hxx b/registry/source/reflwrit.hxx
index 0be0fb3..9bb8475 100644
--- a/registry/source/reflwrit.hxx
+++ b/registry/source/reflwrit.hxx
@@ -27,43 +27,10 @@
/// Implememetation handle
typedef void* TypeWriterImpl;
-/****************************************************************************
-
- C-Api
-
-*****************************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** specifies a collection of function pointers which represents the complete registry type writer C-API.
-
- This funtions pointers are used by the C++ wrapper to call the C-API.
-*/
-struct RegistryTypeWriter_Api
-{
- TypeWriterImpl (TYPEREG_CALLTYPE *createEntry) (RTTypeClass, rtl_uString*, rtl_uString*, sal_uInt16, sal_uInt16, sal_uInt16);
- void (TYPEREG_CALLTYPE *acquire) (TypeWriterImpl);
- void (TYPEREG_CALLTYPE *release) (TypeWriterImpl);
- void (TYPEREG_CALLTYPE *setFieldData) (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, rtl_uString*, rtl_uString*, RTFieldAccess, RTValueType, RTConstValueUnion);
- const sal_uInt8* (TYPEREG_CALLTYPE *getBlop) (TypeWriterImpl);
- sal_uInt32 (TYPEREG_CALLTYPE *getBlopSize) (TypeWriterImpl);
-};
-
-/** the API initialization function.
-*/
-RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api();
-
-#ifdef __cplusplus
-}
-#endif
-
/** RegistryTypeWriter writes/creates a binary type blob.
This class provides the necessary functions to write type information
for all kinds of types into a blob.
- The class is inline and use a C-Api.
@deprecated
use typereg::Writer instead
@@ -84,7 +51,7 @@ public:
@param referenceCount specifies the number of references (eg. number of supported interfaces,
exported services ...)
*/
- inline RegistryTypeWriter(RTTypeClass RTTypeClass,
+ RegistryTypeWriter(RTTypeClass RTTypeClass,
const rtl::OUString& typeName,
const rtl::OUString& superTypeName,
sal_uInt16 fieldCount,
@@ -92,16 +59,16 @@ public:
sal_uInt16 referenceCount);
/// Copy constructcor
- inline RegistryTypeWriter(const RegistryTypeWriter& toCopy);
+ RegistryTypeWriter(const RegistryTypeWriter& toCopy);
/** Destructor. The Destructor frees the internal data block.
The pointer (returned by getBlop) will be set to NULL.
*/
- inline ~RegistryTypeWriter();
+ ~RegistryTypeWriter();
/// Assign operator
- inline RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
+ RegistryTypeWriter& operator == (const RegistryTypeWriter& toAssign);
/** sets the data for a field member of a type blob.
@@ -114,7 +81,7 @@ public:
@param constValue specifies the value of the field. The value is only interesting
for enum values or constants.
*/
- inline void setFieldData( sal_uInt16 index,
+ void setFieldData( sal_uInt16 index,
const rtl::OUString& name,
const rtl::OUString& typeName,
const rtl::OUString& doku,
@@ -127,86 +94,18 @@ public:
The pointer will be invalid (NULL) if the instance of
the RegistryTypeWriter will be destroyed.
*/
- inline const sal_uInt8* getBlop();
+ const sal_uInt8* getBlop();
/** returns the size of the new type blob in bytes.
*/
- inline sal_uInt32 getBlopSize();
+ sal_uInt32 getBlopSize();
protected:
- /// stores the registry type writer Api.
- const RegistryTypeWriter_Api* m_pApi;
/// stores the handle of an implementation class
TypeWriterImpl m_hImpl;
};
-
-
-inline RegistryTypeWriter::RegistryTypeWriter(RTTypeClass RTTypeClass,
- const rtl::OUString& typeName,
- const rtl::OUString& superTypeName,
- sal_uInt16 fieldCount,
- sal_uInt16 methodCount,
- sal_uInt16 referenceCount)
- : m_pApi(initRegistryTypeWriter_Api())
- , m_hImpl(NULL)
-{
- m_hImpl = m_pApi->createEntry(RTTypeClass,
- typeName.pData,
- superTypeName.pData,
- fieldCount,
- methodCount,
- referenceCount);
-}
-
-
-inline RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy)
- : m_pApi(toCopy.m_pApi)
- , m_hImpl(toCopy.m_hImpl)
-{
- m_pApi->acquire(m_hImpl);
-}
-
-inline RegistryTypeWriter::~RegistryTypeWriter()
-{
- m_pApi->release(m_hImpl);
-}
-
-inline RegistryTypeWriter& RegistryTypeWriter::operator == (const RegistryTypeWriter& toAssign)
-{
- if (m_hImpl != toAssign.m_hImpl)
- {
- m_pApi->release(m_hImpl);
- m_hImpl = toAssign.m_hImpl;
- m_pApi->acquire(m_hImpl);
- }
-
- return *this;
-}
-
-inline void RegistryTypeWriter::setFieldData( sal_uInt16 index,
- const rtl::OUString& name,
- const rtl::OUString& typeName,
- const rtl::OUString& doku,
- const rtl::OUString& fileName,
- RTFieldAccess access,
- const RTConstValue& constValue)
-{
- m_pApi->setFieldData(m_hImpl, index, name.pData, typeName.pData, doku.pData, fileName.pData, access, constValue.m_type, constValue.m_value);
-}
-
-inline const sal_uInt8* RegistryTypeWriter::getBlop()
-{
- return m_pApi->getBlop(m_hImpl);
-}
-
-inline sal_uInt32 RegistryTypeWriter::getBlopSize()
-{
- return m_pApi->getBlopSize(m_hImpl);
-}
-
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 7e74fe416de8f2da49d7fd2eb13759cde76e9c6c
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jul 3 11:16:31 2015 +0200
Remove unused functions
Change-Id: Ic4058c133a676646bc0c5d1e52207471bb78a1cb
diff --git a/registry/source/reflwrit.cxx b/registry/source/reflwrit.cxx
index ea26929..c8ec720 100644
--- a/registry/source/reflwrit.cxx
+++ b/registry/source/reflwrit.cxx
@@ -1184,35 +1184,6 @@ static void TYPEREG_CALLTYPE release(TypeWriterImpl hEntry)
}
}
-static void TYPEREG_CALLTYPE setUik(TypeWriterImpl hEntry, const RTUik* uik)
-{
- TypeWriter* pEntry = static_cast<TypeWriter*>(hEntry);
-
- if (pEntry != NULL)
- {
- if (pEntry->m_pUik)
- {
- pEntry->m_pUik->m_Data1 = uik->m_Data1;
- pEntry->m_pUik->m_Data2 = uik->m_Data2;
- pEntry->m_pUik->m_Data3 = uik->m_Data3;
- pEntry->m_pUik->m_Data4 = uik->m_Data4;
- pEntry->m_pUik->m_Data5 = uik->m_Data5;
- }
- else
- pEntry->m_pUik = new RTUik(*uik);
- }
-}
-
-static void TYPEREG_CALLTYPE setDoku(TypeWriterImpl hEntry, rtl_uString* doku)
-{
- static_cast< TypeWriter * >(hEntry)->m_doku = toByteString(doku);
-}
-
-static void TYPEREG_CALLTYPE setFileName(TypeWriterImpl hEntry, rtl_uString* fileName)
-{
- static_cast< TypeWriter * >(hEntry)->m_fileName = toByteString(fileName);
-}
-
sal_Bool TYPEREG_CALLTYPE typereg_writer_setFieldData(
void * handle, sal_uInt16 index, rtl_uString const * documentation,
rtl_uString const * fileName, RTFieldAccess flags, rtl_uString const * name,
@@ -1263,19 +1234,6 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodData(
return true;
}
-static void TYPEREG_CALLTYPE setMethodData(TypeWriterImpl hEntry,
- sal_uInt16 index,
- rtl_uString* name,
- rtl_uString* returnTypeName,
- RTMethodMode mode,
- sal_uInt16 paramCount,
- sal_uInt16 excCount,
- rtl_uString* doku)
-{
- typereg_writer_setMethodData(
- hEntry, index, doku, mode, name, returnTypeName, paramCount, excCount);
-}
-
sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodParameterData(
void * handle, sal_uInt16 methodIndex, sal_uInt16 parameterIndex,
RTParamMode flags, rtl_uString const * name, rtl_uString const * typeName)
@@ -1291,17 +1249,6 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodParameterData(
return true;
}
-static void TYPEREG_CALLTYPE setParamData(TypeWriterImpl hEntry,
- sal_uInt16 index,
- sal_uInt16 paramIndex,
- rtl_uString* type,
- rtl_uString* name,
- RTParamMode mode)
-{
- typereg_writer_setMethodParameterData(
- hEntry, index, paramIndex, mode, name, type);
-}
-
sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodExceptionTypeName(
void * handle, sal_uInt16 methodIndex, sal_uInt16 exceptionIndex,
rtl_uString const * typeName)
@@ -1316,14 +1263,6 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setMethodExceptionTypeName(
return true;
}
-static void TYPEREG_CALLTYPE setExcData(TypeWriterImpl hEntry,
- sal_uInt16 index,
- sal_uInt16 excIndex,
- rtl_uString* type)
-{
- typereg_writer_setMethodExceptionTypeName(hEntry, index, excIndex, type);
-}
-
void const * TYPEREG_CALLTYPE typereg_writer_getBlob(void * handle, sal_uInt32 * size)
SAL_THROW_EXTERN_C()
{
@@ -1367,16 +1306,6 @@ sal_Bool TYPEREG_CALLTYPE typereg_writer_setReferenceData(
return true;
}
-static void TYPEREG_CALLTYPE setReferenceData(TypeWriterImpl hEntry,
- sal_uInt16 index,
- rtl_uString* name,
- RTReferenceType refType,
- rtl_uString* doku,
- RTFieldAccess access)
-{
- typereg_writer_setReferenceData(hEntry, index, doku, refType, access, name);
-}
-
void * TYPEREG_CALLTYPE typereg_writer_create(
typereg_Version version, rtl_uString const * documentation,
rtl_uString const * fileName, RTTypeClass typeClass, sal_Bool published,
@@ -1429,22 +1358,15 @@ static TypeWriterImpl TYPEREG_CALLTYPE createEntry(
RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api()
{
- static RegistryTypeWriter_Api aApi= {0,0,0,0,0,0,0,0,0,0,0,0,0};
+ static RegistryTypeWriter_Api aApi= {0,0,0,0,0,0};
if (!aApi.acquire)
{
aApi.createEntry = &createEntry;
aApi.acquire = &acquire;
aApi.release = &release;
- aApi.setUik = &setUik;
- aApi.setDoku = &setDoku;
- aApi.setFileName = &setFileName;
aApi.setFieldData = &setFieldData;
- aApi.setMethodData = &setMethodData;
- aApi.setParamData = &setParamData;
- aApi.setExcData = &setExcData;
aApi.getBlop = &getBlop;
aApi.getBlopSize = &getBlopSize;
- aApi.setReferenceData = &setReferenceData;
return (&aApi);
}
diff --git a/registry/source/reflwrit.hxx b/registry/source/reflwrit.hxx
index 0025ab0..0be0fb3 100644
--- a/registry/source/reflwrit.hxx
+++ b/registry/source/reflwrit.hxx
@@ -46,17 +46,9 @@ struct RegistryTypeWriter_Api
TypeWriterImpl (TYPEREG_CALLTYPE *createEntry) (RTTypeClass, rtl_uString*, rtl_uString*, sal_uInt16, sal_uInt16, sal_uInt16);
void (TYPEREG_CALLTYPE *acquire) (TypeWriterImpl);
void (TYPEREG_CALLTYPE *release) (TypeWriterImpl);
- void (TYPEREG_CALLTYPE *setUik) (TypeWriterImpl, const RTUik*);
- void (TYPEREG_CALLTYPE *setDoku) (TypeWriterImpl, rtl_uString*);
- void (TYPEREG_CALLTYPE *setFileName) (TypeWriterImpl, rtl_uString*);
void (TYPEREG_CALLTYPE *setFieldData) (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, rtl_uString*, rtl_uString*, RTFieldAccess, RTValueType, RTConstValueUnion);
- void (TYPEREG_CALLTYPE *setMethodData) (TypeWriterImpl, sal_uInt16, rtl_uString*, rtl_uString*, RTMethodMode, sal_uInt16, sal_uInt16, rtl_uString*);
- void (TYPEREG_CALLTYPE *setParamData) (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*, rtl_uString*, RTParamMode);
- void (TYPEREG_CALLTYPE *setExcData) (TypeWriterImpl, sal_uInt16, sal_uInt16, rtl_uString*);
const sal_uInt8* (TYPEREG_CALLTYPE *getBlop) (TypeWriterImpl);
sal_uInt32 (TYPEREG_CALLTYPE *getBlopSize) (TypeWriterImpl);
-
- void (TYPEREG_CALLTYPE *setReferenceData) (TypeWriterImpl, sal_uInt16, rtl_uString*, RTReferenceType, rtl_uString*, RTFieldAccess);
};
/** the API initialization function.
commit cd0474555eed3e65c145c85ed21baab8f09258d2
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jul 3 11:13:32 2015 +0200
Make RegistryTypeReader non-copyable
(and note the operator == vs. = typo)
Change-Id: I4567927f3f702f8e74b168becce4002e84d5c7a0
diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx
index 15e3f2f..aa8d61a 100644
--- a/registry/source/reflread.cxx
+++ b/registry/source/reflread.cxx
@@ -1749,26 +1749,9 @@ RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer,
m_hImpl = createEntry(buffer, bufferLen, copyData);
}
-RegistryTypeReader::RegistryTypeReader(const RegistryTypeReader& toCopy)
- : m_hImpl(toCopy.m_hImpl)
-{ typereg_reader_acquire(m_hImpl); }
-
-
RegistryTypeReader::~RegistryTypeReader()
{ typereg_reader_release(m_hImpl); }
-RegistryTypeReader& RegistryTypeReader::operator == (const RegistryTypeReader& toAssign)
-{
- if (m_hImpl != toAssign.m_hImpl)
- {
- typereg_reader_release(m_hImpl);
- m_hImpl = toAssign.m_hImpl;
- typereg_reader_acquire(m_hImpl);
- }
-
- return *this;
-}
-
RTTypeClass RegistryTypeReader::getTypeClass() const
{ return typereg_reader_getTypeClass(m_hImpl); }
diff --git a/registry/source/reflread.hxx b/registry/source/reflread.hxx
index a4f3b9f..6912fa8 100644
--- a/registry/source/reflread.hxx
+++ b/registry/source/reflread.hxx
@@ -51,16 +51,9 @@ public:
sal_uInt32 bufferLen,
bool copyData);
- /// Copy constructcor
- RegistryTypeReader(const RegistryTypeReader& toCopy);
-
/// Destructor. The Destructor frees the data block if the copyData flag was TRUE.
~RegistryTypeReader();
- /// Assign operator
- RegistryTypeReader& operator == (const RegistryTypeReader& toAssign);
-
-
/** returns the typeclass of the type represented by this blob.
This function will always return the type class without the internal
@@ -113,7 +106,9 @@ public:
*/
rtl::OUString getFieldFileName( sal_uInt16 index ) const;
-protected:
+private:
+ RegistryTypeReader(RegistryTypeReader &) = delete;
+ void operator =(RegistryTypeReader) = delete;
/// stores the handle of an implementation class
TypeReaderImpl m_hImpl;
commit a843c457044acc3155b0d3c49534e78569c69d96
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jul 3 11:11:14 2015 +0200
Remove RegistryTypeReader_Api indirection
Change-Id: I43710d057043a258ec9ab94bca0703434098e6c9
diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx
index 33343e2..15e3f2f 100644
--- a/registry/source/reflread.cxx
+++ b/registry/source/reflread.cxx
@@ -1741,31 +1741,90 @@ void TYPEREG_CALLTYPE typereg_reader_getSuperTypeName(
rtl_uString_new(pSuperTypeName);
}
-RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api()
-{
- static RegistryTypeReader_Api aApi= {0,0,0,0,0,0,0,0,0,0,0,0,0};
- if (!aApi.acquire)
- {
- aApi.createEntry = &createEntry;
- aApi.acquire = &typereg_reader_acquire;
- aApi.release = &typereg_reader_release;
- aApi.getTypeClass = &typereg_reader_getTypeClass;
- aApi.getTypeName = &typereg_reader_getTypeName;
- aApi.getSuperTypeName = &getSuperTypeName;
- aApi.getFieldCount = &getFieldCount;
- aApi.getFieldName = &typereg_reader_getFieldName;
- aApi.getFieldType = &typereg_reader_getFieldTypeName;
- aApi.getFieldAccess = &typereg_reader_getFieldFlags;
- aApi.getFieldConstValue = &getFieldConstValue;
- aApi.getFieldDoku = &typereg_reader_getFieldDocumentation;
- aApi.getFieldFileName = &typereg_reader_getFieldFileName;
-
- return (&aApi);
- }
- else
+RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer,
+ sal_uInt32 bufferLen,
+ bool copyData)
+ : m_hImpl(NULL)
+{
+ m_hImpl = createEntry(buffer, bufferLen, copyData);
+}
+
+RegistryTypeReader::RegistryTypeReader(const RegistryTypeReader& toCopy)
+ : m_hImpl(toCopy.m_hImpl)
+{ typereg_reader_acquire(m_hImpl); }
+
+
+RegistryTypeReader::~RegistryTypeReader()
+{ typereg_reader_release(m_hImpl); }
+
+RegistryTypeReader& RegistryTypeReader::operator == (const RegistryTypeReader& toAssign)
+{
+ if (m_hImpl != toAssign.m_hImpl)
{
- return (&aApi);
+ typereg_reader_release(m_hImpl);
+ m_hImpl = toAssign.m_hImpl;
+ typereg_reader_acquire(m_hImpl);
}
+
+ return *this;
+}
+
+RTTypeClass RegistryTypeReader::getTypeClass() const
+{ return typereg_reader_getTypeClass(m_hImpl); }
+
+rtl::OUString RegistryTypeReader::getTypeName() const
+{
+ rtl::OUString sRet;
+ typereg_reader_getTypeName(m_hImpl, &sRet.pData);
+ return sRet;
+}
+
+rtl::OUString RegistryTypeReader::getSuperTypeName() const
+{
+ rtl::OUString sRet;
+ ::getSuperTypeName(m_hImpl, &sRet.pData);
+ return sRet;
+}
+
+sal_uInt32 RegistryTypeReader::getFieldCount() const
+{ return ::getFieldCount(m_hImpl); }
+
+rtl::OUString RegistryTypeReader::getFieldName( sal_uInt16 index ) const
+{
+ rtl::OUString sRet;
+ typereg_reader_getFieldName(m_hImpl, &sRet.pData, index);
+ return sRet;
+}
+
+rtl::OUString RegistryTypeReader::getFieldType( sal_uInt16 index ) const
+{
+ rtl::OUString sRet;
+ typereg_reader_getFieldTypeName(m_hImpl, &sRet.pData, index);
+ return sRet;
+}
+
+RTFieldAccess RegistryTypeReader::getFieldAccess( sal_uInt16 index ) const
+{ return typereg_reader_getFieldFlags(m_hImpl, index); }
+
+RTConstValue RegistryTypeReader::getFieldConstValue( sal_uInt16 index ) const
+{
+ RTConstValue ret;
+ ret.m_type = ::getFieldConstValue(m_hImpl, index, &ret.m_value);
+ return ret;
+}
+
+rtl::OUString RegistryTypeReader::getFieldDoku( sal_uInt16 index ) const
+{
+ rtl::OUString sRet;
+ typereg_reader_getFieldDocumentation(m_hImpl, &sRet.pData, index);
+ return sRet;
+}
+
+rtl::OUString RegistryTypeReader::getFieldFileName( sal_uInt16 index ) const
+{
+ rtl::OUString sRet;
+ typereg_reader_getFieldFileName(m_hImpl, &sRet.pData, index);
+ return sRet;
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/registry/source/reflread.hxx b/registry/source/reflread.hxx
index 5d6fc0c..a4f3b9f 100644
--- a/registry/source/reflread.hxx
+++ b/registry/source/reflread.hxx
@@ -27,50 +27,10 @@
/// Implememetation handle
typedef void* TypeReaderImpl;
-/****************************************************************************
-
- C-Api
-
-*****************************************************************************/
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/** specifies a collection of function pointers which represents the complete registry type reader C-API.
-
- This funtions pointers are used by the C++ wrapper to call the C-API.
-*/
-struct RegistryTypeReader_Api
-{
- TypeReaderImpl (TYPEREG_CALLTYPE *createEntry) (const sal_uInt8*, sal_uInt32, bool);
- void (TYPEREG_CALLTYPE *acquire) (TypeReaderImpl);
- void (TYPEREG_CALLTYPE *release) (TypeReaderImpl);
- RTTypeClass (TYPEREG_CALLTYPE *getTypeClass) (TypeReaderImpl);
- void (TYPEREG_CALLTYPE *getTypeName) (TypeReaderImpl, rtl_uString**);
- void (TYPEREG_CALLTYPE *getSuperTypeName) (TypeReaderImpl, rtl_uString**);
- sal_uInt32 (TYPEREG_CALLTYPE *getFieldCount) (TypeReaderImpl);
- void (TYPEREG_CALLTYPE *getFieldName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
- void (TYPEREG_CALLTYPE *getFieldType) (TypeReaderImpl, rtl_uString**, sal_uInt16);
- RTFieldAccess (TYPEREG_CALLTYPE *getFieldAccess) (TypeReaderImpl, sal_uInt16);
- RTValueType (TYPEREG_CALLTYPE *getFieldConstValue) (TypeReaderImpl, sal_uInt16, RTConstValueUnion*);
- void (TYPEREG_CALLTYPE *getFieldDoku) (TypeReaderImpl, rtl_uString**, sal_uInt16);
- void (TYPEREG_CALLTYPE *getFieldFileName) (TypeReaderImpl, rtl_uString**, sal_uInt16);
-};
-
-/** the API initialization function.
-*/
-RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api();
-
-#ifdef __cplusplus
-}
-#endif
-
/** RegistryTypeReades reads a binary type blob.
This class provides the necessary functions to read type information
for all kinds of types of a type blob.
- The class is inline and use a C-Api.
@deprecated
use typereg::Reader instead
@@ -87,18 +47,18 @@ public:
The block can be copied to ensure that the data
is valid for the lifetime of this instance.
*/
- inline RegistryTypeReader(const sal_uInt8* buffer,
+ RegistryTypeReader(const sal_uInt8* buffer,
sal_uInt32 bufferLen,
bool copyData);
/// Copy constructcor
- inline RegistryTypeReader(const RegistryTypeReader& toCopy);
+ RegistryTypeReader(const RegistryTypeReader& toCopy);
/// Destructor. The Destructor frees the data block if the copyData flag was TRUE.
- inline ~RegistryTypeReader();
+ ~RegistryTypeReader();
/// Assign operator
- inline RegistryTypeReader& operator == (const RegistryTypeReader& toAssign);
+ RegistryTypeReader& operator == (const RegistryTypeReader& toAssign);
/** returns the typeclass of the type represented by this blob.
@@ -106,158 +66,59 @@ public:
This function will always return the type class without the internal
RT_TYPE_PUBLISHED flag set.
*/
- inline RTTypeClass getTypeClass() const;
+ RTTypeClass getTypeClass() const;
/** returns the full qualified name of the type.
*/
- inline rtl::OUString getTypeName() const;
+ rtl::OUString getTypeName() const;
/** returns the full qualified name of the supertype.
*/
- inline rtl::OUString getSuperTypeName() const;
+ rtl::OUString getSuperTypeName() const;
/** returns the number of fields (attributes/properties, enum values or number
of constants in a module).
*/
- inline sal_uInt32 getFieldCount() const;
+ sal_uInt32 getFieldCount() const;
/** returns the name of the field specified by index.
*/
- inline rtl::OUString getFieldName( sal_uInt16 index ) const;
+ rtl::OUString getFieldName( sal_uInt16 index ) const;
/** returns the full qualified name of the field specified by index.
*/
- inline rtl::OUString getFieldType( sal_uInt16 index ) const;
+ rtl::OUString getFieldType( sal_uInt16 index ) const;
/** returns the access mode of the field specified by index.
*/
- inline RTFieldAccess getFieldAccess( sal_uInt16 index ) const;
+ RTFieldAccess getFieldAccess( sal_uInt16 index ) const;
/** returns the value of the field specified by index.
This function returns the value of an enum value or of a constant.
*/
- inline RTConstValue getFieldConstValue( sal_uInt16 index ) const;
+ RTConstValue getFieldConstValue( sal_uInt16 index ) const;
/** returns the documentation string for the field specified by index.
Each field of a type can have their own documentation.
*/
- inline rtl::OUString getFieldDoku( sal_uInt16 index ) const;
+ rtl::OUString getFieldDoku( sal_uInt16 index ) const;
/** returns the IDL filename of the field specified by index.
The IDL filename of a field can differ from the filename of the ype itself
because modules and also constants can be defined in different IDL files.
*/
- inline rtl::OUString getFieldFileName( sal_uInt16 index ) const;
+ rtl::OUString getFieldFileName( sal_uInt16 index ) const;
protected:
- /// stores the registry type reader Api.
- const RegistryTypeReader_Api* m_pApi;
/// stores the handle of an implementation class
TypeReaderImpl m_hImpl;
};
-
-
-inline RegistryTypeReader::RegistryTypeReader(const sal_uInt8* buffer,
- sal_uInt32 bufferLen,
- bool copyData)
- : m_pApi(initRegistryTypeReader_Api())
- , m_hImpl(NULL)
- {
- m_hImpl = m_pApi->createEntry(buffer, bufferLen, copyData);
- }
-
-
-inline RegistryTypeReader::RegistryTypeReader(const RegistryTypeReader& toCopy)
- : m_pApi(toCopy.m_pApi)
- , m_hImpl(toCopy.m_hImpl)
- { m_pApi->acquire(m_hImpl); }
-
-
-inline RegistryTypeReader::~RegistryTypeReader()
- { m_pApi->release(m_hImpl); }
-
-inline RegistryTypeReader& RegistryTypeReader::operator == (const RegistryTypeReader& toAssign)
-{
- if (m_hImpl != toAssign.m_hImpl)
- {
- m_pApi->release(m_hImpl);
- m_hImpl = toAssign.m_hImpl;
- m_pApi->acquire(m_hImpl);
- }
-
- return *this;
-}
-
-
-
-
-
-
-
-inline RTTypeClass RegistryTypeReader::getTypeClass() const
- { return m_pApi->getTypeClass(m_hImpl); }
-
-inline rtl::OUString RegistryTypeReader::getTypeName() const
- {
- rtl::OUString sRet;
- m_pApi->getTypeName(m_hImpl, &sRet.pData);
- return sRet;
- }
-
-inline rtl::OUString RegistryTypeReader::getSuperTypeName() const
- {
- rtl::OUString sRet;
- m_pApi->getSuperTypeName(m_hImpl, &sRet.pData);
- return sRet;
- }
-
-inline sal_uInt32 RegistryTypeReader::getFieldCount() const
- { return m_pApi->getFieldCount(m_hImpl); }
-
-inline rtl::OUString RegistryTypeReader::getFieldName( sal_uInt16 index ) const
- {
- rtl::OUString sRet;
- m_pApi->getFieldName(m_hImpl, &sRet.pData, index);
- return sRet;
- }
-
-inline rtl::OUString RegistryTypeReader::getFieldType( sal_uInt16 index ) const
- {
- rtl::OUString sRet;
- m_pApi->getFieldType(m_hImpl, &sRet.pData, index);
- return sRet;
- }
-
-inline RTFieldAccess RegistryTypeReader::getFieldAccess( sal_uInt16 index ) const
- { return m_pApi->getFieldAccess(m_hImpl, index); }
-
-inline RTConstValue RegistryTypeReader::getFieldConstValue( sal_uInt16 index ) const
- {
- RTConstValue ret;
- ret.m_type = m_pApi->getFieldConstValue(m_hImpl, index, &ret.m_value);
- return ret;
- }
-
-inline rtl::OUString RegistryTypeReader::getFieldDoku( sal_uInt16 index ) const
- {
- rtl::OUString sRet;
- m_pApi->getFieldDoku(m_hImpl, &sRet.pData, index);
- return sRet;
- }
-
-inline rtl::OUString RegistryTypeReader::getFieldFileName( sal_uInt16 index ) const
- {
- rtl::OUString sRet;
- m_pApi->getFieldFileName(m_hImpl, &sRet.pData, index);
- return sRet;
- }
-
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit cfde943f59b0cf63c46cbe061fd37e53201d2363
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Fri Jul 3 10:53:47 2015 +0200
Remove unused functions
Change-Id: Ib615ff7eb12232b0b83664af134744d96754ffd8
diff --git a/registry/source/reflread.cxx b/registry/source/reflread.cxx
index 1dc6a47..33343e2 100644
--- a/registry/source/reflread.cxx
+++ b/registry/source/reflread.cxx
@@ -288,7 +288,6 @@ public:
double readDoubleConstant(sal_uInt16 index);
const sal_Unicode* readStringConstant(sal_uInt16 index);
// throws std::bad_alloc
- void readUIK(sal_uInt16 index, RTUik* uik);
};
ConstantPool::~ConstantPool()
@@ -582,29 +581,6 @@ const sal_Unicode* ConstantPool::readStringConstant(sal_uInt16 index)
return aString;
}
-void ConstantPool::readUIK(sal_uInt16 index, RTUik* uik)
-{
- if (index == 0)
- {
- uik->m_Data1 = 0;
- uik->m_Data2 = 0;
- uik->m_Data3 = 0;
- uik->m_Data4 = 0;
- uik->m_Data5 = 0;
- }
- else if (m_pIndex && (index <= m_numOfEntries))
- {
- if (readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_TAG) == CP_TAG_UIK)
- {
- uik->m_Data1 = readUINT32(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK1);
- uik->m_Data2 = readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK2);
- uik->m_Data3 = readUINT16(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK3);
- uik->m_Data4 = readUINT32(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK4);
- uik->m_Data5 = readUINT32(m_pIndex[index - 1] + CP_OFFSET_ENTRY_UIK5);
- }
- }
-}
-
/**************************************************************************
class FieldList
@@ -1325,32 +1301,6 @@ typereg_Version TYPEREG_CALLTYPE typereg_reader_getVersion(void * handle) {
return TYPEREG_VERSION_0;
}
-static sal_uInt16 TYPEREG_CALLTYPE getMinorVersion(TypeReaderImpl hEntry)
-{
- TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
- if (pEntry != nullptr) {
- try {
- return pEntry->readUINT16(OFFSET_MINOR_VERSION);
- } catch (BlopObject::BoundsError &) {
- SAL_WARN("registry", "bad data");
- }
- }
- return 0;
-}
-
-static sal_uInt16 TYPEREG_CALLTYPE getMajorVersion(TypeReaderImpl hEntry)
-{
- TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
- if (pEntry != nullptr) {
- try {
- return pEntry->readUINT16(OFFSET_MAJOR_VERSION);
- } catch (BlopObject::BoundsError &) {
- SAL_WARN("registry", "bad data");
- }
- }
- return 0;
-}
-
RTTypeClass TYPEREG_CALLTYPE typereg_reader_getTypeClass(void * hEntry)
{
TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1413,20 +1363,6 @@ static void TYPEREG_CALLTYPE getSuperTypeName(TypeReaderImpl hEntry, rtl_uString
rtl_uString_new(pSuperTypeName);
}
-static void TYPEREG_CALLTYPE getUik(TypeReaderImpl hEntry, RTUik* uik)
-{
- TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
-
- if (pEntry != NULL)
- {
- try {
- pEntry->m_pCP->readUIK(pEntry->readUINT16(OFFSET_UIK), uik);
- } catch (BlopObject::BoundsError &) {
- SAL_WARN("registry", "bad data");
- }
- }
-}
-
void TYPEREG_CALLTYPE typereg_reader_getDocumentation(void * hEntry, rtl_uString** pDoku)
{
TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1584,11 +1520,6 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodCount(void * hEntry)
return pEntry->m_pMethods->m_numOfEntries;
}
-static sal_uInt32 TYPEREG_CALLTYPE getMethodCount(TypeReaderImpl hEntry)
-{
- return typereg_reader_getMethodCount(hEntry);
-}
-
void TYPEREG_CALLTYPE typereg_reader_getMethodName(void * hEntry, rtl_uString** pMethodName, sal_uInt16 index)
{
TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1615,11 +1546,6 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodParameterCount(
return pEntry->m_pMethods->getMethodParamCount(index);
}
-static sal_uInt32 TYPEREG_CALLTYPE getMethodParamCount(TypeReaderImpl hEntry, sal_uInt16 index)
-{
- return typereg_reader_getMethodParameterCount(hEntry, index);
-}
-
void TYPEREG_CALLTYPE typereg_reader_getMethodParameterTypeName(void * hEntry, rtl_uString** pMethodParamType, sal_uInt16 index, sal_uInt16 paramIndex)
{
TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1671,11 +1597,6 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getMethodExceptionCount(
return pEntry->m_pMethods->getMethodExcCount(index);
}
-static sal_uInt32 TYPEREG_CALLTYPE getMethodExcCount(TypeReaderImpl hEntry, sal_uInt16 index)
-{
- return typereg_reader_getMethodExceptionCount(hEntry, index);
-}
-
void TYPEREG_CALLTYPE typereg_reader_getMethodExceptionTypeName(void * hEntry, rtl_uString** pMethodExcpType, sal_uInt16 index, sal_uInt16 excIndex)
{
TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1742,11 +1663,6 @@ sal_uInt16 TYPEREG_CALLTYPE typereg_reader_getReferenceCount(void * hEntry)
return pEntry->m_pReferences->m_numOfEntries;
}
-static sal_uInt32 TYPEREG_CALLTYPE getReferenceCount(TypeReaderImpl hEntry)
-{
- return typereg_reader_getReferenceCount(hEntry);
-}
-
void TYPEREG_CALLTYPE typereg_reader_getReferenceTypeName(void * hEntry, rtl_uString** pReferenceName, sal_uInt16 index)
{
TypeRegistryEntry* pEntry = static_cast<TypeRegistryEntry*>(hEntry);
@@ -1827,20 +1743,15 @@ void TYPEREG_CALLTYPE typereg_reader_getSuperTypeName(
RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api()
{
- static RegistryTypeReader_Api aApi= {0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0};
+ static RegistryTypeReader_Api aApi= {0,0,0,0,0,0,0,0,0,0,0,0,0};
if (!aApi.acquire)
{
aApi.createEntry = &createEntry;
aApi.acquire = &typereg_reader_acquire;
aApi.release = &typereg_reader_release;
- aApi.getMinorVersion = &getMinorVersion;
- aApi.getMajorVersion = &getMajorVersion;
aApi.getTypeClass = &typereg_reader_getTypeClass;
aApi.getTypeName = &typereg_reader_getTypeName;
aApi.getSuperTypeName = &getSuperTypeName;
- aApi.getUik = &getUik;
- aApi.getDoku = &typereg_reader_getDocumentation;
- aApi.getFileName = &typereg_reader_getFileName;
aApi.getFieldCount = &getFieldCount;
aApi.getFieldName = &typereg_reader_getFieldName;
aApi.getFieldType = &typereg_reader_getFieldTypeName;
@@ -1848,22 +1759,6 @@ RegistryTypeReader_Api* TYPEREG_CALLTYPE initRegistryTypeReader_Api()
aApi.getFieldConstValue = &getFieldConstValue;
aApi.getFieldDoku = &typereg_reader_getFieldDocumentation;
aApi.getFieldFileName = &typereg_reader_getFieldFileName;
- aApi.getMethodCount = &getMethodCount;
- aApi.getMethodName = &typereg_reader_getMethodName;
- aApi.getMethodParamCount = &getMethodParamCount;
- aApi.getMethodParamType = &typereg_reader_getMethodParameterTypeName;
- aApi.getMethodParamName = &typereg_reader_getMethodParameterName;
- aApi.getMethodParamMode = &typereg_reader_getMethodParameterFlags;
- aApi.getMethodExcCount = &getMethodExcCount;
- aApi.getMethodExcType = &typereg_reader_getMethodExceptionTypeName;
- aApi.getMethodReturnType = &typereg_reader_getMethodReturnTypeName;
- aApi.getMethodMode = &typereg_reader_getMethodFlags;
- aApi.getMethodDoku = &typereg_reader_getMethodDocumentation;
- aApi.getReferenceCount = &getReferenceCount;
- aApi.getReferenceName = &typereg_reader_getReferenceTypeName;
- aApi.getReferenceType = &typereg_reader_getReferenceSort;
- aApi.getReferenceDoku = &typereg_reader_getReferenceDocumentation;
- aApi.getReferenceAccess = &typereg_reader_getReferenceFlags;
return (&aApi);
}
diff --git a/registry/source/reflread.hxx b/registry/source/reflread.hxx
index 9cd9447..5d6fc0c 100644
--- a/registry/source/reflread.hxx
+++ b/registry/source/reflread.hxx
@@ -46,12 +46,7 @@ struct RegistryTypeReader_Api
TypeReaderImpl (TYPEREG_CALLTYPE *createEntry) (const sal_uInt8*, sal_uInt32, bool);
void (TYPEREG_CALLTYPE *acquire) (TypeReaderImpl);
void (TYPEREG_CALLTYPE *release) (TypeReaderImpl);
- sal_uInt16 (TYPEREG_CALLTYPE *getMinorVersion) (TypeReaderImpl);
- sal_uInt16 (TYPEREG_CALLTYPE *getMajorVersion) (TypeReaderImpl);
RTTypeClass (TYPEREG_CALLTYPE *getTypeClass) (TypeReaderImpl);
- void (TYPEREG_CALLTYPE *getUik) (TypeReaderImpl, RTUik*);
- void (TYPEREG_CALLTYPE *getDoku) (TypeReaderImpl, rtl_uString**);
- void (TYPEREG_CALLTYPE *getFileName) (TypeReaderImpl, rtl_uString**);
void (TYPEREG_CALLTYPE *getTypeName) (TypeReaderImpl, rtl_uString**);
void (TYPEREG_CALLTYPE *getSuperTypeName) (TypeReaderImpl, rtl_uString**);
sal_uInt32 (TYPEREG_CALLTYPE *getFieldCount) (TypeReaderImpl);
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list