[Libreoffice-commits] core.git: Branch 'feature/gsoc14-personas' - 118 commits - accessibility/inc accessibility/source avmedia/source basctl/source binaryurp/source bin/lo-all-static-libs bin/update_pch.sh bridges/inc bridges/source canvas/source chart2/qa chart2/source codemaker/source compilerplugins/clang configure.ac connectivity/source cppuhelper/source cppu/source cui/Library_cui.mk cui/source cui/uiconfig dbaccess/inc dbaccess/source desktop/source desktop/unx download.lst editeng/source extensions/inc extensions/source external/coinmp external/collada2gltf external/cppunit external/freetype external/glew external/lcms2 external/openssl external/python3 filter/source forms/source formula/source fpicker/source framework/inc helpcontent2 hwpfilter/source idlc/inc idlc/source include/codemaker include/editeng include/formula include/osl include/sfx2 include/svl include/svtools include/svx include/toolkit include/tools include/vcl lotuswordpro/inc lotuswordpro/Library_lwpft.mk lotuswordpro/so urce officecfg/registry oox/source package/source pyuno/source reportdesign/inc reportdesign/source rsc/source sal/cppunittester sal/osl sal/qa sal/util scaddins/source sc/inc scripting/workben sc/source sdext/Library_pdfimport.mk sdext/source sd/inc sd/source sfx2/inc sfx2/source slideshow/Library_OGLTrans.mk slideshow/source solenv/bin starmath/inc starmath/source stoc/source svl/source svtools/source svx/inc svx/source svx/workben sw/inc sw/qa sw/source sw/uiconfig tools/source ucb/source unotools/source uui/source vcl/inc vcl/Library_vcl.mk vcl/osx vcl/source vcl/unx wizards/source writerfilter/inc writerfilter/source xmloff/source xmlsecurity/inc xmlsecurity/qa xmlsecurity/source
Rachit Gupta
rachitgupta1792 at gmail.com
Wed May 21 06:44:57 PDT 2014
Rebased ref, commits from common ancestor:
commit c5d9a570eb6f1a157dd1ad317dcefccdaf48216a
Author: Rachit Gupta <rachitgupta1792 at gmail.com>
Date: Wed May 21 11:38:21 2014 +0530
Added SearchAndParseThread.
The search results data is retrieved and parsed in a separate
thread so that the UI doesn't hang awkwardly.
Change-Id: I51437edd4cfbd45f5fb7e487ad2baf5dba6618a4
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index a46b7b2..b454d17 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -35,7 +35,6 @@ using namespace ::com::sun::star::ucb;
SelectPersonaDialog::SelectPersonaDialog( Window *pParent )
: ModalDialog( pParent, "SelectPersonaDialog", "cui/ui/select_persona_dialog.ui" )
{
- PushButton *pButton;
get( pButton, "search_personas" );
pButton->SetClickHdl( LINK( this, SelectPersonaDialog, VisitPersonas ) );
@@ -55,29 +54,10 @@ OUString SelectPersonaDialog::GetPersonaURL() const
IMPL_LINK( SelectPersonaDialog, VisitPersonas, PushButton*, /*pButton*/ )
{
- Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
- Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(xContext);
- PersonasDocHandler* pHandler = new PersonasDocHandler();
- Reference< xml::sax::XDocumentHandler > xDocHandler = pHandler;
- uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY );
- uno::Reference< io::XInputStream > xStream;
- xParser->setDocumentHandler( xDocHandler );
-
OUString searchTerm = m_pEdit->GetText();
OUString rURL = "https://addons.allizom.org/en-US/firefox/api/1.5/search/" + searchTerm + "/9/";
- if ( !xFileAccess.is() )
- return false;
-
- try {
- xStream = xFileAccess->openFileRead( rURL );
- }
- catch (...)
- {
- return false;
- }
- xml::sax::InputSource aParserInput;
- aParserInput.aInputStream = xStream;
- xParser->parseStream( aParserInput );
+ m_aSearchThread = new SearchAndParseThread( this, rURL );
+ m_aSearchThread->launch();
return 0;
}
@@ -297,4 +277,42 @@ bool SvxPersonalizationTabPage::CopyPersonaToGallery( const OUString &rURL )
return true;
}
+
+SearchAndParseThread::SearchAndParseThread( SelectPersonaDialog* pDialog,
+ const OUString& rURL ) :
+ Thread( "cuiPersonasSearchThread" ),
+ m_pPersonaDialog( pDialog ),
+ m_aURL( rURL )
+{
+}
+
+SearchAndParseThread::~SearchAndParseThread()
+{
+}
+
+void SearchAndParseThread::execute()
+{
+ Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
+ Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(xContext);
+ PersonasDocHandler* pHandler = new PersonasDocHandler();
+ Reference< xml::sax::XDocumentHandler > xDocHandler = pHandler;
+ uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY );
+ uno::Reference< io::XInputStream > xStream;
+ xParser->setDocumentHandler( xDocHandler );
+
+ // if ( !xFileAccess.is() )
+ // return false;
+
+ try {
+ xStream = xFileAccess->openFileRead( m_aURL );
+ }
+ catch (...)
+ {
+ // return false;
+ }
+ xml::sax::InputSource aParserInput;
+ aParserInput.aInputStream = xStream;
+ xParser->parseStream( aParserInput );
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx
index 9190eb2..906a969 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -11,8 +11,12 @@
#define INCLUDED_CUI_SOURCE_OPTIONS_PERSONALIZATION_HXX
#include <sfx2/tabdlg.hxx>
+#include <salhelper/thread.hxx>
+#include <rtl/ref.hxx>
+#include <vcl/prgsbar.hxx>
class FixedText;
+class SearchAndParseThread;
class SvxPersonalizationTabPage : public SfxTabPage
{
@@ -57,9 +61,12 @@ class SelectPersonaDialog : public ModalDialog
{
private:
Edit *m_pEdit; ///< The input line for the Persona URL
+ PushButton *pButton;
+
public:
SelectPersonaDialog( Window *pParent );
+ ::rtl::Reference< SearchAndParseThread > m_aSearchThread;
/// Get the URL from the Edit field.
OUString GetPersonaURL() const;
@@ -69,7 +76,21 @@ private:
DECL_LINK( VisitPersonas, PushButton* );
};
+class SearchAndParseThread: public salhelper::Thread
+{
+private:
+
+ SelectPersonaDialog *m_pPersonaDialog;
+ OUString m_aURL;
+ virtual ~SearchAndParseThread();
+ virtual void execute() SAL_OVERRIDE;
+
+public:
+
+ SearchAndParseThread( SelectPersonaDialog* pDialog,
+ const OUString& rURL );
+};
#endif // INCLUDED_CUI_SOURCE_OPTIONS_PERSONALIZATION_HXX
commit 584010c43d2f1bc38e6f0419e1493290d538cbcb
Author: Rachit Gupta <rachitgupta1792 at gmail.com>
Date: Mon May 19 19:56:44 2014 +0530
Moved definition of SelectPersonaDialog to personalization.hxx
Change-Id: Ic6ffcfb394e36d4d9ce9825b26095fe2a0f34fdd
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index cb318a3..a46b7b2 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -21,6 +21,7 @@
#include <vcl/msgbox.hxx>
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
+#include <vcl/graphicfilter.hxx>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
@@ -31,28 +32,6 @@ using namespace com::sun::star;
using namespace ::com::sun::star::uno;
using namespace ::com::sun::star::ucb;
-
-/** Dialog that will allow the user to choose a Persona to use.
-
-So far there is no better possibility than just to paste the URL from
-https://addons.mozilla.org/firefox/themes ...
-*/
-class SelectPersonaDialog : public ModalDialog
-{
-private:
- Edit *m_pEdit; ///< The input line for the Persona URL
-
-public:
- SelectPersonaDialog( Window *pParent );
-
- /// Get the URL from the Edit field.
- OUString GetPersonaURL() const;
-
-private:
- /// Handle the [Visit Firefox Personas] button
- DECL_LINK( VisitPersonas, PushButton* );
-};
-
SelectPersonaDialog::SelectPersonaDialog( Window *pParent )
: ModalDialog( pParent, "SelectPersonaDialog", "cui/ui/select_persona_dialog.ui" )
{
@@ -76,9 +55,6 @@ OUString SelectPersonaDialog::GetPersonaURL() const
IMPL_LINK( SelectPersonaDialog, VisitPersonas, PushButton*, /*pButton*/ )
{
- // uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell( com::sun::star::system::SystemShellExecute::create( ::comphelper::getProcessComponentContext() ) );
-
- // xSystemShell->execute( "https://addons.mozilla.org/firefox/themes/", OUString(), com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY );
Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(xContext);
PersonasDocHandler* pHandler = new PersonasDocHandler();
diff --git a/cui/source/options/personalization.hxx b/cui/source/options/personalization.hxx
index 40661f8..9190eb2 100644
--- a/cui/source/options/personalization.hxx
+++ b/cui/source/options/personalization.hxx
@@ -48,6 +48,29 @@ private:
bool CopyPersonaToGallery( const OUString &rURL );
};
+/** Dialog that will allow the user to choose a Persona to use.
+
+So far there is no better possibility than just to paste the URL from
+https://addons.mozilla.org/firefox/themes ...
+*/
+class SelectPersonaDialog : public ModalDialog
+{
+private:
+ Edit *m_pEdit; ///< The input line for the Persona URL
+
+public:
+ SelectPersonaDialog( Window *pParent );
+
+ /// Get the URL from the Edit field.
+ OUString GetPersonaURL() const;
+
+private:
+ /// Handle the [Visit Firefox Personas] button
+ DECL_LINK( VisitPersonas, PushButton* );
+};
+
+
+
#endif // INCLUDED_CUI_SOURCE_OPTIONS_PERSONALIZATION_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/personasdochandler.cxx b/cui/source/options/personasdochandler.cxx
index 9b0e034..521b561 100644
--- a/cui/source/options/personasdochandler.cxx
+++ b/cui/source/options/personasdochandler.cxx
@@ -5,16 +5,6 @@
* 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
#include "personasdochandler.hxx"
commit eb0a1f777e2c7fef7cb0e748176392a61be0609c
Author: Rachit Gupta <rachitgupta1792 at gmail.com>
Date: Mon May 19 18:56:24 2014 +0530
Changed license and added #ifdef.
Change-Id: If1b0d447eba7c7afdc28aa4246556d14e2fcc98e
diff --git a/cui/source/options/personasdochandler.hxx b/cui/source/options/personasdochandler.hxx
index 76afb95..29be26d 100644
--- a/cui/source/options/personasdochandler.hxx
+++ b/cui/source/options/personasdochandler.hxx
@@ -5,18 +5,11 @@
* 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/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
*/
+#ifndef INCLUDED_CUI_SOURCE_OPTIONS_PERSONASDOCHANDLER_HXX
+#define INCLUDED_CUI_SOURCE_OPTIONS_PERSONASDOCHANDLER_HXX
+
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
@@ -59,4 +52,6 @@ public:
throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
};
+#endif // INCLUDED_CUI_SOURCE_OPTIONS_PERSONASDOCHANDLER_HXX
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit adeb20a9ff1a1886be6cb4d5c9cb81895afb5d8b
Author: Rachit Gupta <rachitgupta1792 at gmail.com>
Date: Tue May 13 22:16:05 2014 +0530
Created std::vector to store learnmore URLs.
For now, we have to parse the HTML and display the images as the
result XML does not contain the header and footer URLs.
Change-Id: Ie95a75e218bc3da12802c971ea744fb38951e574
diff --git a/cui/source/options/personasdochandler.cxx b/cui/source/options/personasdochandler.cxx
index d8ab54c..9b0e034 100644
--- a/cui/source/options/personasdochandler.cxx
+++ b/cui/source/options/personasdochandler.cxx
@@ -36,9 +36,11 @@ throw ( xml::sax::SAXException, RuntimeException, std::exception )
}
void SAL_CALL
-PersonasDocHandler::characters( const OUString & )
+PersonasDocHandler::characters( const OUString & aChars)
throw ( xml::sax::SAXException, RuntimeException, std::exception )
{
+ if( m_bLearnmoreTag )
+ m_vLearnmoreURLs.push_back( aChars );
}
void SAL_CALL
@@ -63,21 +65,19 @@ PersonasDocHandler::setDocumentLocator(
void SAL_CALL
PersonasDocHandler::startElement( const OUString& aName,
- const Reference< xml::sax::XAttributeList > & xAttribs )
+ const Reference< xml::sax::XAttributeList > & )
throw ( xml::sax::SAXException,
RuntimeException, std::exception )
{
- SAL_DEBUG("startElement: " << aName << "\n");
- for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
- {
- SAL_DEBUG("\t\tAttribute Name: " << xAttribs->getNameByIndex(i) << "\tAttribute Value: " << xAttribs->getValueByIndex(i) << "\n");
- }
+ if ( aName == "learnmore" )
+ m_bLearnmoreTag = true;
+ else
+ m_bLearnmoreTag = false;
}
-void SAL_CALL PersonasDocHandler::endElement( const OUString & aName )
+void SAL_CALL PersonasDocHandler::endElement( const OUString & )
throw ( xml::sax::SAXException, RuntimeException, std::exception )
{
- SAL_DEBUG("endElement: " << aName << "\n");
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/personasdochandler.hxx b/cui/source/options/personasdochandler.hxx
index 4ff9d83..76afb95 100644
--- a/cui/source/options/personasdochandler.hxx
+++ b/cui/source/options/personasdochandler.hxx
@@ -20,20 +20,15 @@
#include <cppuhelper/implbase1.hxx>
#include <com/sun/star/xml/sax/XAttributeList.hpp>
#include <com/sun/star/xml/sax/XParser.hpp>
+#include <vector>
class PersonasDocHandler : public ::cppu::WeakImplHelper1< css::xml::sax::XDocumentHandler >
{
private:
- OUString m_sHeaderURL;
- OUString m_sFooterURL;
- OUString m_sTextColor;
- OUString m_sAccentColor;
+ std::vector<OUString> m_vLearnmoreURLs;
+ bool m_bLearnmoreTag;
public:
- PersonasDocHandler(){}
- OUString getHeaderURL() { return m_sHeaderURL; }
- OUString getFooterURL() { return m_sFooterURL; }
- OUString getTextColor() { return m_sTextColor; }
- OUString getAccentColor() { return m_sAccentColor; }
+ PersonasDocHandler(){ m_bLearnmoreTag = false; }
// XDocumentHandler
virtual void SAL_CALL startDocument()
throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
commit 3278c011a0178c8f27287935d137a02a5590da72
Author: Rachit Gupta <rachitgupta1792 at gmail.com>
Date: Thu May 1 23:55:41 2014 +0530
select_persona_dialog.ui changed to include search.
The entered text is searched on Mozilla's test server and the result is parsed.
Change-Id: I2be660b0f7f60d2bdb2c54cbc958084b87ad1e05
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 5374773..cb318a3 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -57,11 +57,11 @@ SelectPersonaDialog::SelectPersonaDialog( Window *pParent )
: ModalDialog( pParent, "SelectPersonaDialog", "cui/ui/select_persona_dialog.ui" )
{
PushButton *pButton;
- get( pButton, "visit_personas" );
+ get( pButton, "search_personas" );
pButton->SetClickHdl( LINK( this, SelectPersonaDialog, VisitPersonas ) );
- get( m_pEdit, "persona_url" );
- m_pEdit->SetPlaceholderText( "https://addons.mozilla.org/firefox/themes/" );
+ get( m_pEdit, "search_term" );
+ m_pEdit->SetPlaceholderText( "Search term..." );
}
OUString SelectPersonaDialog::GetPersonaURL() const
@@ -84,10 +84,14 @@ IMPL_LINK( SelectPersonaDialog, VisitPersonas, PushButton*, /*pButton*/ )
PersonasDocHandler* pHandler = new PersonasDocHandler();
Reference< xml::sax::XDocumentHandler > xDocHandler = pHandler;
uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY );
+ uno::Reference< io::XInputStream > xStream;
xParser->setDocumentHandler( xDocHandler );
- OUString rURL = "file:////home/rachit/test.xml";
- Reference< io::XInputStream > xStream;
+ OUString searchTerm = m_pEdit->GetText();
+ OUString rURL = "https://addons.allizom.org/en-US/firefox/api/1.5/search/" + searchTerm + "/9/";
+ if ( !xFileAccess.is() )
+ return false;
+
try {
xStream = xFileAccess->openFileRead( rURL );
}
diff --git a/cui/uiconfig/ui/select_persona_dialog.ui b/cui/uiconfig/ui/select_persona_dialog.ui
index 84b1201..fd3ca9b 100644
--- a/cui/uiconfig/ui/select_persona_dialog.ui
+++ b/cui/uiconfig/ui/select_persona_dialog.ui
@@ -11,7 +11,7 @@
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="spacing">12</property>
- <child internal-child="action_area">
+ <child internal-child="action_area">"e
<object class="GtkButtonBox" id="dialog-action_area1">
<property name="visible">True</property>
<property name="can_focus">False</property>
@@ -79,7 +79,7 @@
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
- <property name="label" translatable="yes">First visit Firefox Themes (https://addons.mozilla.org/firefox/themes). Find the Theme you like, and want to choose for %PRODUCTNAME.</property>
+ <property name="label" translatable="yes">Search for themes that you wish to apply:</property>
<property name="wrap">True</property>
<property name="max_width_chars">54</property>
</object>
@@ -90,16 +90,29 @@
</packing>
</child>
<child>
- <object class="GtkHBox" id="hbox2">
+ <object class="GtkEntry" id="search_term">
+ <property name="visible">True</property>
+ <property name="can_focus">True</property>
+ <property name="invisible_char">â</property>
+ <property name="primary_icon_activatable">False</property>
+ <property name="secondary_icon_activatable">False</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkBox" id="box2">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="homogeneous">True</property>
<child>
<placeholder/>
</child>
<child>
- <object class="GtkButton" id="visit_personas">
- <property name="label" translatable="yes">Visit Firefox Themes</property>
+ <object class="GtkButton" id="search_personas">
+ <property name="label" translatable="yes">Search</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
@@ -117,55 +130,9 @@
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
- <property name="padding">10</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <object class="GtkLabel" id="label2">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Then, in your web browser's location bar, copy the address of the page that contains the Theme to clipboard, and paste it to the input field below.</property>
- <property name="wrap">True</property>
- <property name="max_width_chars">54</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
- <child>
- <object class="GtkLabel" id="label3">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Theme address:</property>
- <property name="use_underline">True</property>
- <property name="mnemonic_widget">persona_url</property>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <object class="GtkEntry" id="persona_url">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="invisible_char">â</property>
- <property name="invisible_char_set">True</property>
- <property name="primary_icon_activatable">False</property>
- <property name="secondary_icon_activatable">False</property>
- </object>
- <packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">4</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
commit 5d3d078dbb7375e4862a02800566bdd2456ae95e
Author: Rachit Gupta <rachitgupta1792 at gmail.com>
Date: Tue Apr 29 19:48:48 2014 +0530
Created basic architecture for PersonasDocHandler.
Change-Id: Ic1454344756c48090ebe821799d10dd6ace0264c
diff --git a/cui/Library_cui.mk b/cui/Library_cui.mk
index 1ac0ed7..07949ed 100644
--- a/cui/Library_cui.mk
+++ b/cui/Library_cui.mk
@@ -158,6 +158,7 @@ $(eval $(call gb_Library_add_exception_objects,cui,\
cui/source/options/optsave \
cui/source/options/optupdt \
cui/source/options/personalization \
+ cui/source/options/personasdochandler \
cui/source/options/radiobtnbox \
cui/source/options/sdbcdriverenum \
cui/source/options/securityoptions \
diff --git a/cui/source/options/personalization.cxx b/cui/source/options/personalization.cxx
index 21cb2b4..5374773 100644
--- a/cui/source/options/personalization.cxx
+++ b/cui/source/options/personalization.cxx
@@ -10,6 +10,7 @@
#include <config_folders.h>
#include "personalization.hxx"
+#include "personasdochandler.hxx"
#include <comphelper/processfactory.hxx>
#include <officecfg/Office/Common.hxx>
@@ -21,18 +22,15 @@
#include <vcl/svapp.hxx>
#include <vcl/settings.hxx>
-#include <com/sun/star/lang/XMultiServiceFactory.hpp>
-#include <com/sun/star/system/SystemShellExecute.hpp>
-#include <com/sun/star/system/SystemShellExecuteFlags.hpp>
#include <com/sun/star/ucb/SimpleFileAccess.hpp>
-#include <com/sun/star/ui/dialogs/ExecutableDialogResults.hpp>
-#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
-#include <com/sun/star/ui/dialogs/FilePicker.hpp>
-#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
-#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
-#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
+#include <com/sun/star/xml/sax/XParser.hpp>
+#include <com/sun/star/xml/sax/Parser.hpp>
+#include "ucbhelper/content.hxx"
using namespace com::sun::star;
+using namespace ::com::sun::star::uno;
+using namespace ::com::sun::star::ucb;
+
/** Dialog that will allow the user to choose a Persona to use.
@@ -78,10 +76,28 @@ OUString SelectPersonaDialog::GetPersonaURL() const
IMPL_LINK( SelectPersonaDialog, VisitPersonas, PushButton*, /*pButton*/ )
{
- uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell( com::sun::star::system::SystemShellExecute::create( ::comphelper::getProcessComponentContext() ) );
+ // uno::Reference< com::sun::star::system::XSystemShellExecute > xSystemShell( com::sun::star::system::SystemShellExecute::create( ::comphelper::getProcessComponentContext() ) );
- xSystemShell->execute( "https://addons.mozilla.org/firefox/themes/", OUString(), com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY );
+ // xSystemShell->execute( "https://addons.mozilla.org/firefox/themes/", OUString(), com::sun::star::system::SystemShellExecuteFlags::URIS_ONLY );
+ Reference<XComponentContext> xContext( ::comphelper::getProcessComponentContext() );
+ Reference< xml::sax::XParser > xParser = xml::sax::Parser::create(xContext);
+ PersonasDocHandler* pHandler = new PersonasDocHandler();
+ Reference< xml::sax::XDocumentHandler > xDocHandler = pHandler;
+ uno::Reference< ucb::XSimpleFileAccess3 > xFileAccess( ucb::SimpleFileAccess::create( comphelper::getProcessComponentContext() ), uno::UNO_QUERY );
+ xParser->setDocumentHandler( xDocHandler );
+ OUString rURL = "file:////home/rachit/test.xml";
+ Reference< io::XInputStream > xStream;
+ try {
+ xStream = xFileAccess->openFileRead( rURL );
+ }
+ catch (...)
+ {
+ return false;
+ }
+ xml::sax::InputSource aParserInput;
+ aParserInput.aInputStream = xStream;
+ xParser->parseStream( aParserInput );
return 0;
}
diff --git a/cui/source/options/personasdochandler.cxx b/cui/source/options/personasdochandler.cxx
new file mode 100644
index 0000000..d8ab54c
--- /dev/null
+++ b/cui/source/options/personasdochandler.cxx
@@ -0,0 +1,83 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include "personasdochandler.hxx"
+
+using namespace ::com::sun::star;
+using namespace ::com::sun::star::uno;
+
+// XDocumentHandler
+void SAL_CALL
+PersonasDocHandler::startDocument()
+throw ( xml::sax::SAXException, RuntimeException, std::exception )
+{
+}
+
+void SAL_CALL
+PersonasDocHandler::endDocument()
+throw ( xml::sax::SAXException, RuntimeException, std::exception )
+{
+}
+
+void SAL_CALL
+PersonasDocHandler::characters( const OUString & )
+ throw ( xml::sax::SAXException, RuntimeException, std::exception )
+{
+}
+
+void SAL_CALL
+PersonasDocHandler::ignorableWhitespace( const OUString & )
+ throw ( xml::sax::SAXException, RuntimeException, std::exception )
+{
+}
+
+void SAL_CALL
+PersonasDocHandler::processingInstruction(
+ const OUString &, const OUString & )
+ throw ( xml::sax::SAXException, RuntimeException, std::exception )
+{
+}
+
+void SAL_CALL
+PersonasDocHandler::setDocumentLocator(
+ const Reference< xml::sax::XLocator >& )
+ throw ( xml::sax::SAXException, RuntimeException, std::exception )
+{
+}
+
+void SAL_CALL
+PersonasDocHandler::startElement( const OUString& aName,
+ const Reference< xml::sax::XAttributeList > & xAttribs )
+ throw ( xml::sax::SAXException,
+ RuntimeException, std::exception )
+{
+ SAL_DEBUG("startElement: " << aName << "\n");
+ for (sal_Int16 i = 0; i < xAttribs->getLength(); ++i)
+ {
+ SAL_DEBUG("\t\tAttribute Name: " << xAttribs->getNameByIndex(i) << "\tAttribute Value: " << xAttribs->getValueByIndex(i) << "\n");
+ }
+}
+
+void SAL_CALL PersonasDocHandler::endElement( const OUString & aName )
+ throw ( xml::sax::SAXException, RuntimeException, std::exception )
+{
+ SAL_DEBUG("endElement: " << aName << "\n");
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/personasdochandler.hxx b/cui/source/options/personasdochandler.hxx
new file mode 100644
index 0000000..4ff9d83
--- /dev/null
+++ b/cui/source/options/personasdochandler.hxx
@@ -0,0 +1,67 @@
+/* -*- 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/.
+ *
+ * This file incorporates work covered by the following license notice:
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed
+ * with this work for additional information regarding copyright
+ * ownership. The ASF licenses this file to you under the Apache
+ * License, Version 2.0 (the "License"); you may not use this file
+ * except in compliance with the License. You may obtain a copy of
+ * the License at http://www.apache.org/licenses/LICENSE-2.0 .
+ */
+
+#include <cppuhelper/implbase1.hxx>
+#include <com/sun/star/xml/sax/XAttributeList.hpp>
+#include <com/sun/star/xml/sax/XParser.hpp>
+
+class PersonasDocHandler : public ::cppu::WeakImplHelper1< css::xml::sax::XDocumentHandler >
+{
+private:
+ OUString m_sHeaderURL;
+ OUString m_sFooterURL;
+ OUString m_sTextColor;
+ OUString m_sAccentColor;
+public:
+ PersonasDocHandler(){}
+ OUString getHeaderURL() { return m_sHeaderURL; }
+ OUString getFooterURL() { return m_sFooterURL; }
+ OUString getTextColor() { return m_sTextColor; }
+ OUString getAccentColor() { return m_sAccentColor; }
+ // XDocumentHandler
+ virtual void SAL_CALL startDocument()
+ throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ virtual void SAL_CALL endDocument()
+ throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ virtual void SAL_CALL startElement( const OUString& aName,
+ const css::uno::Reference< css::xml::sax::XAttributeList > & xAttribs )
+ throw ( css::xml::sax::SAXException,
+ css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ virtual void SAL_CALL endElement( const OUString & aName )
+ throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ virtual void SAL_CALL characters( const OUString & aChars )
+ throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ virtual void SAL_CALL ignorableWhitespace( const OUString & aWhitespaces )
+ throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ virtual void SAL_CALL processingInstruction(
+ const OUString & aTarget, const OUString & aData )
+ throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+
+ virtual void SAL_CALL setDocumentLocator(
+ const css::uno::Reference< css::xml::sax::XLocator >& xLocator )
+ throw ( css::xml::sax::SAXException, css::uno::RuntimeException, std::exception ) SAL_OVERRIDE;
+};
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 85dc388993beca806b5a7ec91c9c49172b3a781b
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed May 21 09:02:43 2014 +0200
Default OS X thread stack size too small for -fsanitize=address
...witnessed stack overflow in huge function
FunctionMapFactory::createFunctionMap__library_effects__allChildren in
workdir/UnpackedTarball/opencollada/COLLADASaxFrameworkLoader/src/generated14/
COLLADASaxFWLColladaParserAutoGen14PrivateFunctionMapFactory.cpp
Change-Id: I9451912043e282c8e06aff446cf3d1190f1de9cf
diff --git a/sal/osl/unx/thread.c b/sal/osl/unx/thread.c
index 0140936..5335dd6 100644
--- a/sal/osl/unx/thread.c
+++ b/sal/osl/unx/thread.c
@@ -22,6 +22,7 @@
#if defined(OPENBSD)
#include <sched.h>
#endif
+#include <config_options.h>
#include <osl/diagnose.h>
#include <osl/thread.h>
#include <osl/nlsupport.h>
@@ -251,8 +252,9 @@ static oslThread osl_thread_create_Impl (
short nFlags)
{
Thread_Impl* pImpl;
-#if defined(OPENBSD)
+#if defined OPENBSD || (defined MACOSX && !ENABLE_RUNTIME_OPTIMIZATIONS)
pthread_attr_t attr;
+ size_t stacksize;
#endif
int nRet=0;
@@ -266,11 +268,16 @@ static oslThread osl_thread_create_Impl (
pthread_mutex_lock (&(pImpl->m_Lock));
-#if defined(OPENBSD)
+#if defined OPENBSD || (defined MACOSX && !ENABLE_RUNTIME_OPTIMIZATIONS)
if (pthread_attr_init(&attr) != 0)
return (0);
- if (pthread_attr_setstacksize(&attr, 262144) != 0) {
+#if defined OPENBSD
+ stacksize = 262144;
+#else
+ stacksize = 100 * PTHREAD_STACK_MIN;
+#endif
+ if (pthread_attr_setstacksize(&attr, stacksize) != 0) {
pthread_attr_destroy(&attr);
return (0);
}
@@ -278,7 +285,7 @@ static oslThread osl_thread_create_Impl (
if ((nRet = pthread_create (
&(pImpl->m_hThread),
-#if defined(OPENBSD)
+#if defined OPENBSD || (defined MACOSX && !ENABLE_RUNTIME_OPTIMIZATIONS)
&attr,
#else
PTHREAD_ATTR_DEFAULT,
@@ -295,7 +302,7 @@ static oslThread osl_thread_create_Impl (
return (0);
}
-#if defined(OPENBSD)
+#if defined OPENBSD || (defined MACOSX && !ENABLE_RUNTIME_OPTIMIZATIONS)
pthread_attr_destroy(&attr);
#endif
commit 00468b48e8678d819a8e34be8c1e256ce36c1396
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Wed May 21 08:55:48 2014 +0200
Work around Clang -fsanitize=address inline asm error
same as 08947735f9cc4b7bd69676c9dd4d1700e8e3b15b for gcc_linux_x86-64
Change-Id: I28d138dd13adc9a3e09d46befe69ac86ab1fffb6
diff --git a/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx b/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx
index 3b6cd4a..971ca8a 100644
--- a/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx
+++ b/bridges/source/cpp_uno/gcc3_macosx_x86-64/callvirtualmethod.cxx
@@ -57,10 +57,27 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
if ( nGPR > x86_64::MAX_GPR_REGS )
nGPR = x86_64::MAX_GPR_REGS;
+ // Work around -fsanitize=address "inline assembly requires more registers
+ // than available" error:
+ struct Data {
+ sal_uInt64 pMethod;
+ sal_uInt64 * pGPR;
+ double * pFPR;
+ sal_uInt64 nFPR;
+ // Return values:
+ sal_uInt64 rax;
+ sal_uInt64 rdx;
+ double xmm0;
+ double xmm1;
+ } data;
+ data.pGPR = pGPR;
+ data.pFPR = pFPR;
+ data.nFPR = nFPR;
+
// Get pointer to method
sal_uInt64 pMethod = *((sal_uInt64 *)pThis);
pMethod += 8 * nVtableIndex;
- pMethod = *((sal_uInt64 *)pMethod);
+ data.pMethod = *((sal_uInt64 *)pMethod);
// Load parameters to stack, if necessary
if ( nStack )
@@ -71,16 +88,10 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
std::memcpy( pCallStack, pStack, nStackBytes );
}
- // Return values
- sal_uInt64 rax;
- sal_uInt64 rdx;
- double xmm0;
- double xmm1;
-
asm volatile (
// Fill the xmm registers
- "movq %6, %%rax\n\t"
+ "movq 16%0, %%rax\n\t"
"movsd (%%rax), %%xmm0\n\t"
"movsd 8(%%rax), %%xmm1\n\t"
@@ -92,7 +103,7 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
"movsd 56(%%rax), %%xmm7\n\t"
// Fill the general purpose registers
- "movq %5, %%rax\n\t"
+ "movq 8%0, %%rax\n\t"
"movq (%%rax), %%rdi\n\t"
"movq 8(%%rax), %%rsi\n\t"
@@ -102,45 +113,45 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
"movq 40(%%rax), %%r9\n\t"
// Perform the call
- "movq %4, %%r11\n\t"
- "movq %7, %%rax\n\t"
+ "movq 0%0, %%r11\n\t"
+ "movq 24%0, %%rax\n\t"
"call *%%r11\n\t"
// Fill the return values
- "movq %%rax, %0\n\t"
- "movq %%rdx, %1\n\t"
- "movsd %%xmm0, %2\n\t"
- "movsd %%xmm1, %3\n\t"
- : "=m" ( rax ), "=m" ( rdx ), "=m" ( xmm0 ), "=m" ( xmm1 )
- : "m" ( pMethod ), "m" ( pGPR ), "m" ( pFPR ), "m" ( nFPR )
+ "movq %%rax, 32%0\n\t"
+ "movq %%rdx, 40%0\n\t"
+ "movsd %%xmm0, 48%0\n\t"
+ "movsd %%xmm1, 56%0\n\t"
+ :: "o" (data)
: "rax", "rdi", "rsi", "rdx", "rcx", "r8", "r9", "r10", "r11",
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
- "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15"
+ "xmm8", "xmm9", "xmm10", "xmm11", "xmm12", "xmm13", "xmm14", "xmm15",
+ "memory"
);
switch (pReturnTypeRef->eTypeClass)
{
case typelib_TypeClass_HYPER:
case typelib_TypeClass_UNSIGNED_HYPER:
- *reinterpret_cast<sal_uInt64 *>( pRegisterReturn ) = rax;
+ *reinterpret_cast<sal_uInt64 *>( pRegisterReturn ) = data.rax;
break;
case typelib_TypeClass_LONG:
case typelib_TypeClass_UNSIGNED_LONG:
case typelib_TypeClass_ENUM:
- *reinterpret_cast<sal_uInt32 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt32*>( &rax );
+ *reinterpret_cast<sal_uInt32 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt32 *>( &data.rax );
break;
case typelib_TypeClass_CHAR:
case typelib_TypeClass_SHORT:
case typelib_TypeClass_UNSIGNED_SHORT:
- *reinterpret_cast<sal_uInt16 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt16*>( &rax );
+ *reinterpret_cast<sal_uInt16 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt16 *>( &data.rax );
break;
case typelib_TypeClass_BOOLEAN:
case typelib_TypeClass_BYTE:
- *reinterpret_cast<sal_uInt8 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt8*>( &rax );
+ *reinterpret_cast<sal_uInt8 *>( pRegisterReturn ) = *reinterpret_cast<sal_uInt8 *>( &data.rax );
break;
case typelib_TypeClass_FLOAT:
case typelib_TypeClass_DOUBLE:
- *reinterpret_cast<double *>( pRegisterReturn ) = xmm0;
+ *reinterpret_cast<double *>( pRegisterReturn ) = data.xmm0;
break;
default:
{
@@ -148,12 +159,12 @@ void CPPU_CURRENT_NAMESPACE::callVirtualMethod(
if (bSimpleReturn && nRetSize <= 16 && nRetSize > 0)
{
sal_uInt64 longs[2];
- longs[0] = rax;
- longs[1] = rdx;
+ longs[0] = data.rax;
+ longs[1] = data.rdx;
double doubles[2];
- doubles[0] = xmm0;
- doubles[1] = xmm1;
+ doubles[0] = data.xmm0;
+ doubles[1] = data.xmm1;
x86_64::fill_struct( pReturnTypeRef, &longs[0], &doubles[0], pRegisterReturn);
}
break;
commit c354deac3c6174b0e725c9bb6aab10b65a95fa0d
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Tue May 20 17:53:25 2014 +0300
fdo#78921 Don't crash when there is no storage specified
Not sure it's a good idea to get here at all
when exporting as flat xml, but anyway it
shouldn't crash.
Change-Id: Ib2ce6b044b4395222a394312d49f5a01d157f9f3
diff --git a/xmloff/source/style/XMLFontAutoStylePool.cxx b/xmloff/source/style/XMLFontAutoStylePool.cxx
index ff95ad6..4800c05 100644
--- a/xmloff/source/style/XMLFontAutoStylePool.cxx
+++ b/xmloff/source/style/XMLFontAutoStylePool.cxx
@@ -325,6 +325,10 @@ OUString XMLFontAutoStylePool::embedFontFile( const OUString& fileUrl )
osl::File file( fileUrl );
if( file.open( osl_File_OpenFlag_Read ) != osl::File::E_None )
return OUString();
+
+ if ( !GetExport().GetTargetStorage().is() )
+ return OUString();
+
uno::Reference< embed::XStorage > storage;
storage.set( GetExport().GetTargetStorage()->openStorageElement( OUString( "Fonts" ),
::embed::ElementModes::WRITE ), uno::UNO_QUERY_THROW );
commit 005fae2bddf4e43cb361bbdb9fc2cfb961693ffd
Author: Thomas Arnhold <thomas at arnhold.org>
Date: Mon May 12 16:13:30 2014 +0200
upgrade to python-3.3.5
- remove now obselete patches, which were applied upstream.
- Hack to get MacOS to build
Change-Id: Id68e78e411efc92a46ea9e180f09c390fe5acb4a
Reviewed-on: https://gerrit.libreoffice.org/9311
Tested-by: LibreOffice gerrit bot <gerrit at libreoffice.org>
Reviewed-by: David Tardon <dtardon at redhat.com>
Tested-by: David Tardon <dtardon at redhat.com>
diff --git a/download.lst b/download.lst
index 69aa304..8a3b889 100644
--- a/download.lst
+++ b/download.lst
@@ -110,7 +110,8 @@ export PNG_MD5SUM := 5266905cef49d1224437465ad4d67fd9
export PNG_TARBALL := libpng-1.5.18.tar.gz
export POPPLER_TARBALL := 1cd27460f7e3379d1eb109cfd7bcdb39-poppler-0.22.5.tar.gz
export POSTGRESQL_TARBALL := c0b4799ea9850eae3ead14f0a60e9418-postgresql-9.2.1.tar.bz2
-export PYTHON_TARBALL := f3ebe34d4d8695bf889279b54673e10c-Python-3.3.3.tar.bz2
+export PYTHON_MD5SUM := 803a75927f8f241ca78633890c798021
+export PYTHON_TARBALL := Python-3.3.5.tgz
export RAPTOR_TARBALL := 4ceb9316488b0ea01acf011023cf7fff-raptor2-2.0.9.tar.gz
export RASQAL_TARBALL := b12c5f9cfdb6b04efce5a4a186b8416b-rasqal-0.9.30.tar.gz
export REDLAND_TARBALL := 32f8e1417a64d3c6f2c727f9053f55ea-redland-1.0.16.tar.gz
diff --git a/external/python3/UnpackedTarball_python3.mk b/external/python3/UnpackedTarball_python3.mk
index d08ba1f..d6a1d04 100644
--- a/external/python3/UnpackedTarball_python3.mk
+++ b/external/python3/UnpackedTarball_python3.mk
@@ -24,13 +24,12 @@ $(eval $(call gb_UnpackedTarball_add_patches,python3,\
external/python3/python-3.3.0-msvc-disable.patch.1 \
external/python3/python-3.3.0-msvc-x64.patch.1 \
external/python3/python-3.3.0-ssl.patch.1 \
- external/python3/python-3.3.0-implicit-int.patch.1 \
external/python3/python-3.3.0-gcc-4.8.patch.1 \
external/python3/python-3.3.0-pythreadstate.patch.1 \
external/python3/python-3.3.0-clang.patch.1 \
- external/python3/python-3.3.3-quoted-printable.patch.1 \
external/python3/python-3.3.3-py17797.patch.1 \
external/python3/python-3.3.3-msvc2012-winxp.patch.1 \
+ external/python3/python-3.3.5-pyexpat-symbols.patch.1 \
))
ifneq ($(filter DRAGONFLY FREEBSD LINUX NETBSD OPENBSD SOLARIS,$(OS)),)
diff --git a/external/python3/python-3.3.0-implicit-int.patch.1 b/external/python3/python-3.3.0-implicit-int.patch.1
deleted file mode 100644
index 6e4d2b0..0000000
--- a/external/python3/python-3.3.0-implicit-int.patch.1
+++ /dev/null
@@ -1,30 +0,0 @@
-fix function names in import.h
-
-MSVC complains about some declarations in Include/import.h.
-Apparently the problem is a missing space between PyAPI_FUNC(int) and the
-function name, leading to concatenated int_PyImport... names and no
-return type.
-
-diff -ru python3.old/Include/import.h python3/Include/import.h
---- python3.old/Include/import.h 2012-09-29 10:00:26.000000000 +0200
-+++ python3/Include/import.h 2012-11-27 16:09:26.449390966 +0100
-@@ -86,15 +86,15 @@
-
- PyAPI_FUNC(void) _PyImport_ReInitLock(void);
-
--PyAPI_FUNC(PyObject *)_PyImport_FindBuiltin(
-+PyAPI_FUNC(PyObject *) _PyImport_FindBuiltin(
- const char *name /* UTF-8 encoded string */
- );
--PyAPI_FUNC(PyObject *)_PyImport_FindExtensionObject(PyObject *, PyObject *);
--PyAPI_FUNC(int)_PyImport_FixupBuiltin(
-+PyAPI_FUNC(PyObject *) _PyImport_FindExtensionObject(PyObject *, PyObject *);
-+PyAPI_FUNC(int) _PyImport_FixupBuiltin(
- PyObject *mod,
- char *name /* UTF-8 encoded string */
- );
--PyAPI_FUNC(int)_PyImport_FixupExtensionObject(PyObject*, PyObject *, PyObject *);
-+PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *, PyObject *);
-
- struct _inittab {
- char *name; /* ASCII encoded string */
diff --git a/external/python3/python-3.3.0-msvc-x64.patch.1 b/external/python3/python-3.3.0-msvc-x64.patch.1
index 03fcfa7..8882a1c 100644
--- a/external/python3/python-3.3.0-msvc-x64.patch.1
+++ b/external/python3/python-3.3.0-msvc-x64.patch.1
@@ -210,7 +210,7 @@ diff -ru python3/PCbuild/pcbuild.sln python3.new/PCbuild/pcbuild.sln
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
--- python3/PCbuild/pythoncore.vcxproj
+++ python3/PCbuild/pythoncore.vcxproj
-@@ -185,35 +185,35 @@
+@@ -195,35 +195,35 @@
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<Midl>
<TargetEnvironment>X64</TargetEnvironment>
@@ -236,14 +236,14 @@ diff -ru python3/PCbuild/pcbuild.sln python3.new/PCbuild/pcbuild.sln
<IgnoreSpecificDefaultLibraries>libc;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
<BaseAddress>0x1e000000</BaseAddress>
</Link>
+ <PreBuildEvent>
+ <Command>$(KillPythonExe)
+ IF %ERRORLEVEL% NEQ 0 (
+ echo kill_python: warning: could not kill running Pythons, exit code %ERRORLEVEL%
+ exit /b 0
+ )</Command>
+ </PreBuildEvent>
+ <PreBuildEvent>
+ <Message>Killing any running $(PythonExe) instances...</Message>
+ </PreBuildEvent>
</ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
- <ClCompile>
- <AdditionalOptions>/Zm200 %(AdditionalOptions)</AdditionalOptions>
- <Optimization>Disabled</Optimization>
- <InlineFunctionExpansion>Default</InlineFunctionExpansion>
- <IntrinsicFunctions>false</IntrinsicFunctions>
- <AdditionalIncludeDirectories>..\Python;..\Modules\zlib;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
- <PreprocessorDefinitions>_USRDLL;Py_BUILD_CORE;Py_ENABLE_SHARED;WIN32;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <RuntimeLibrary>MultiThreadedDebugDLL</RuntimeLibrary>
- </ClCompile>
diff --git a/external/python3/python-3.3.3-quoted-printable.patch.1 b/external/python3/python-3.3.3-quoted-printable.patch.1
deleted file mode 100644
index 30c065d..0000000
--- a/external/python3/python-3.3.3-quoted-printable.patch.1
+++ /dev/null
@@ -1,201 +0,0 @@
-
-# HG changeset patch
-# User R David Murray <rdmurray at bitdance.com>
-# Date 1389637161 18000
-# Node ID 4c5b1932354bc4707ef182cf0fa61b2e8ccfaa5e
-# Parent 0ce2396a134bebca11b17337734d5e9966e2a95f
-#20206, #5803: more efficient algorithm that doesn't truncate output.
-
-This fixes an edge case (20206) where if the input ended in a character
-needing encoding but there was no newline on the string, the last byte
-of the encoded character would be dropped. The fix is to use a more
-efficient algorithm, provided by Serhiy Storchaka (5803), that does not
-have the bug.
-
-diff --git a/Lib/email/quoprimime.py b/Lib/email/quoprimime.py
---- a/Lib/email/quoprimime.py
-+++ b/Lib/email/quoprimime.py
-@@ -53,8 +53,9 @@ EMPTYSTRING = ''
- # space-wise. Remember that headers and bodies have different sets of safe
- # characters. Initialize both maps with the full expansion, and then override
- # the safe bytes with the more compact form.
--_QUOPRI_HEADER_MAP = dict((c, '=%02X' % c) for c in range(256))
--_QUOPRI_BODY_MAP = _QUOPRI_HEADER_MAP.copy()
-+_QUOPRI_MAP = ['=%02X' % c for c in range(256)]
-+_QUOPRI_HEADER_MAP = _QUOPRI_MAP[:]
-+_QUOPRI_BODY_MAP = _QUOPRI_MAP[:]
-
- # Safe header bytes which need no encoding.
- for c in b'-!*+/' + ascii_letters.encode('ascii') + digits.encode('ascii'):
-@@ -121,8 +122,7 @@ def unquote(s):
-
-
- def quote(c):
-- return '=%02X' % ord(c)
--
-+ return _QUOPRI_MAP[ord(c)]
-
-
- def header_encode(header_bytes, charset='iso-8859-1'):
-@@ -140,67 +140,15 @@ def header_encode(header_bytes, charset=
- if not header_bytes:
- return ''
- # Iterate over every byte, encoding if necessary.
-- encoded = []
-- for octet in header_bytes:
-- encoded.append(_QUOPRI_HEADER_MAP[octet])
-+ encoded = header_bytes.decode('latin1').translate(_QUOPRI_HEADER_MAP)
- # Now add the RFC chrome to each encoded chunk and glue the chunks
- # together.
-- return '=?%s?q?%s?=' % (charset, EMPTYSTRING.join(encoded))
-+ return '=?%s?q?%s?=' % (charset, encoded)
-
-
--class _body_accumulator(io.StringIO):
--
-- def __init__(self, maxlinelen, eol, *args, **kw):
-- super().__init__(*args, **kw)
-- self.eol = eol
-- self.maxlinelen = self.room = maxlinelen
--
-- def write_str(self, s):
-- """Add string s to the accumulated body."""
-- self.write(s)
-- self.room -= len(s)
--
-- def newline(self):
-- """Write eol, then start new line."""
-- self.write_str(self.eol)
-- self.room = self.maxlinelen
--
-- def write_soft_break(self):
-- """Write a soft break, then start a new line."""
-- self.write_str('=')
-- self.newline()
--
-- def write_wrapped(self, s, extra_room=0):
-- """Add a soft line break if needed, then write s."""
-- if self.room < len(s) + extra_room:
-- self.write_soft_break()
-- self.write_str(s)
--
-- def write_char(self, c, is_last_char):
-- if not is_last_char:
-- # Another character follows on this line, so we must leave
-- # extra room, either for it or a soft break, and whitespace
-- # need not be quoted.
-- self.write_wrapped(c, extra_room=1)
-- elif c not in ' \t':
-- # For this and remaining cases, no more characters follow,
-- # so there is no need to reserve extra room (since a hard
-- # break will immediately follow).
-- self.write_wrapped(c)
-- elif self.room >= 3:
-- # It's a whitespace character at end-of-line, and we have room
-- # for the three-character quoted encoding.
-- self.write(quote(c))
-- elif self.room == 2:
-- # There's room for the whitespace character and a soft break.
-- self.write(c)
-- self.write_soft_break()
-- else:
-- # There's room only for a soft break. The quoted whitespace
-- # will be the only content on the subsequent line.
-- self.write_soft_break()
-- self.write(quote(c))
--
-+_QUOPRI_BODY_ENCODE_MAP = _QUOPRI_BODY_MAP[:]
-+for c in b'\r\n':
-+ _QUOPRI_BODY_ENCODE_MAP[c] = chr(c)
-
- def body_encode(body, maxlinelen=76, eol=NL):
- """Encode with quoted-printable, wrapping at maxlinelen characters.
-@@ -226,26 +174,56 @@ def body_encode(body, maxlinelen=76, eol
- if not body:
- return body
-
-- # The last line may or may not end in eol, but all other lines do.
-- last_has_eol = (body[-1] in '\r\n')
-+ # quote speacial characters
-+ body = body.translate(_QUOPRI_BODY_ENCODE_MAP)
-
-- # This accumulator will make it easier to build the encoded body.
-- encoded_body = _body_accumulator(maxlinelen, eol)
-+ soft_break = '=' + eol
-+ # leave space for the '=' at the end of a line
-+ maxlinelen1 = maxlinelen - 1
-
-- lines = body.splitlines()
-- last_line_no = len(lines) - 1
-- for line_no, line in enumerate(lines):
-- last_char_index = len(line) - 1
-- for i, c in enumerate(line):
-- if body_check(ord(c)):
-- c = quote(c)
-- encoded_body.write_char(c, i==last_char_index)
-- # Add an eol if input line had eol. All input lines have eol except
-- # possibly the last one.
-- if line_no < last_line_no or last_has_eol:
-- encoded_body.newline()
-+ encoded_body = []
-+ append = encoded_body.append
-
-- return encoded_body.getvalue()
-+ for line in body.splitlines():
-+ # break up the line into pieces no longer than maxlinelen - 1
-+ start = 0
-+ laststart = len(line) - 1 - maxlinelen
-+ while start <= laststart:
-+ stop = start + maxlinelen1
-+ # make sure we don't break up an escape sequence
-+ if line[stop - 2] == '=':
-+ append(line[start:stop - 1])
-+ start = stop - 2
-+ elif line[stop - 1] == '=':
-+ append(line[start:stop])
-+ start = stop - 1
-+ else:
-+ append(line[start:stop] + '=')
-+ start = stop
-+
-+ # handle rest of line, special case if line ends in whitespace
-+ if line and line[-1] in ' \t':
-+ room = start - laststart
-+ if room >= 3:
-+ # It's a whitespace character at end-of-line, and we have room
-+ # for the three-character quoted encoding.
-+ q = quote(line[-1])
-+ elif room == 2:
-+ # There's room for the whitespace character and a soft break.
-+ q = line[-1] + soft_break
-+ else:
-+ # There's room only for a soft break. The quoted whitespace
-+ # will be the only content on the subsequent line.
-+ q = soft_break + quote(line[-1])
-+ append(line[start:-1] + q)
-+ else:
-+ append(line[start:])
-+
-+ # add back final newline if present
-+ if body[-1] in CRLF:
-+ append('')
-+
-+ return eol.join(encoded_body)
-
-
-
-diff --git a/Lib/test/test_email/test_email.py b/Lib/test/test_email/test_email.py
---- a/Lib/test/test_email/test_email.py
-+++ b/Lib/test/test_email/test_email.py
-@@ -4216,6 +4216,11 @@ class TestQuopri(unittest.TestCase):
- def test_encode_one_line_eol(self):
- self._test_encode('hello\n', 'hello\r\n', eol='\r\n')
-
-+ def test_encode_one_line_eol_after_non_ascii(self):
-+ # issue 20206; see changeset 0cf700464177 for why the encode/decode.
-+ self._test_encode('hello\u03c5\n'.encode('utf-8').decode('latin1'),
-+ 'hello=CF=85\r\n', eol='\r\n')
-+
- def test_encode_one_space(self):
- self._test_encode(' ', '=20')
-
diff --git a/external/python3/python-3.3.5-pyexpat-symbols.patch.1 b/external/python3/python-3.3.5-pyexpat-symbols.patch.1
new file mode 100644
index 0000000..c04c78c
--- /dev/null
+++ b/external/python3/python-3.3.5-pyexpat-symbols.patch.1
@@ -0,0 +1,28 @@
+HACK: Fix build breakage on MacOS:
+
+*** WARNING: renaming "pyexpat" since importing it failed: dlopen(build/lib.macosx-10.6-i386-3.3/pyexpat.so, 2): Symbol not found: _XML_ErrorString
+
+This reverts c242a8f30806 from the python hg repo:
+
+restore namespacing of pyexpat symbols (closes #19186)
+
+
+See http://bugs.python.org/issue19186#msg214069
+
+The recommendation to include Modules/inc at first broke the Linux build...
+
+So do it this way, as it was before. Needs some realignment later.
+
+--- python3/Modules/expat/expat_external.h
++++ python3/Modules/expat/expat_external.h
+@@ -7,10 +7,6 @@
+
+ /* External API definitions */
+
+-/* Namespace external symbols to allow multiple libexpat version to
+- co-exist. */
+-#include "pyexpatns.h"
+-
+ #if defined(_MSC_EXTENSIONS) && !defined(__BEOS__) && !defined(__CYGWIN__)
+ #define XML_USE_MSC_EXTENSIONS 1
+ #endif
commit 19979ae27055cb910bfc368bfc2899d211f56be1
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed May 21 02:09:11 2014 +0200
forgot to release the OpenGL resources
Change-Id: I2baefbe611f9ed28defc46ca3af332d13b32c561
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index cea7e0f..cf75ea6 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -110,6 +110,10 @@ OpenGL3DRenderer::~OpenGL3DRenderer()
glDeleteBuffers(1, &m_RenderVertexBuf);
glDeleteBuffers(1, &m_3DUBOBuffer);
glDeleteBuffers(1, &m_VertexBuffer);
+
+ glDeleteFramebuffers(1, &mnPickingFbo);
+ glDeleteRenderbuffers(1, &mnPickingRbo);
+ glDeleteTextures(1, &mnPickingTexture);
}
void OpenGL3DRenderer::ShaderResources::LoadShaders()
commit 61b2ae31c6642e09b3052599ae22077e8d41eabd
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed May 21 01:49:59 2014 +0200
use FBO for the picking
Change-Id: Ibab6daa1f76300d159ccd4cfbca061c8d8c1951f
diff --git a/chart2/source/view/charttypes/GL3DBarChart.cxx b/chart2/source/view/charttypes/GL3DBarChart.cxx
index 1653668..d36a008 100644
--- a/chart2/source/view/charttypes/GL3DBarChart.cxx
+++ b/chart2/source/view/charttypes/GL3DBarChart.cxx
@@ -217,14 +217,16 @@ public:
}
-void GL3DBarChart::clickedAt(const Point& )
+void GL3DBarChart::clickedAt(const Point& rPos)
{
+ sal_uInt32 nId = 1;
{
PickingModeSetter(mpRenderer.get());
render();
+ nId = mpRenderer->GetPixelColorFromPoint(rPos.X(), rPos.Y());
}
if (mpCamera)
- mpCamera->zoom(1);
+ mpCamera->zoom(nId);
}
}
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 52d341a..b08e90e 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -179,6 +179,8 @@ public:
void ProcessUnrenderedShape();
void SetPickingMode(bool bPickingMode);
+
+ sal_uInt32 GetPixelColorFromPoint(long nX, long nY);
private:
void MoveModelf(PosVecf3& trans,PosVecf3& angle,PosVecf3& scale);
@@ -362,6 +364,10 @@ private:
bool mbPickingMode;
SceneBox m_SenceBox;
+
+ GLuint mnPickingFbo;
+ GLuint mnPickingRbo;
+ GLuint mnPickingTexture;
};
}
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 92cf61d..cea7e0f 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -249,6 +249,8 @@ void OpenGL3DRenderer::init()
glBufferData(GL_ARRAY_BUFFER, sizeof(squareVertices), squareVertices, GL_STATIC_DRAW);
glBindBuffer(GL_ARRAY_BUFFER, 0);
+ OpenGLHelper::createFramebuffer(m_iWidth, m_iHeight, mnPickingFbo, mnPickingRbo, mnPickingTexture);
+
CHECK_GL_ERROR();
Init3DUniformBlock();
@@ -1580,6 +1582,22 @@ void OpenGL3DRenderer::MoveModelf(PosVecf3& trans,PosVecf3& angle,PosVecf3& scal
void OpenGL3DRenderer::SetPickingMode(bool bPickingMode)
{
mbPickingMode = bPickingMode;
+ if(mbPickingMode)
+ {
+ glBindFramebuffer(GL_FRAMEBUFFER, mnPickingFbo);
+ }
+ else
+ {
+ glBindFramebuffer(GL_FRAMEBUFFER, 0);
+ }
+}
+
+sal_uInt32 OpenGL3DRenderer::GetPixelColorFromPoint(long nX, long nY)
+{
+ boost::scoped_array<sal_uInt8> buf(new sal_uInt8[4]);
+ glReadPixels(nX, nY, 1, 1, GL_BGRA, GL_UNSIGNED_BYTE, buf.get());
+ Color aColor(buf[3], buf[2], buf[1], buf[0]);
+ return aColor.GetColor();
}
}
commit 8c39739a38237df6e8f39f312cf08fadae896ae4
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed May 21 00:41:37 2014 +0200
add method for creating framebuffer objects to OpenGLHelper
Change-Id: I08bd2e58ee98a68accae256fcbcc288a8c56ae0b
diff --git a/include/vcl/opengl/OpenGLHelper.hxx b/include/vcl/opengl/OpenGLHelper.hxx
index 3cb482b..70b1d2a 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -29,6 +29,13 @@ public:
static void renderToFile(long nWidth, long nHeight, const OUString& rFileName);
static const char* GLErrorString(GLenum errorCode);
+
+ /**
+ * The caller is responsible for deleting the buffer objects identified by
+ * nFramebufferId, nRenderbufferId and nTexturebufferId
+ */
+ static void createFramebuffer(long nWidth, long nHeight,
+ GLuint& nFramebufferId, GLuint& nRenderbufferId, GLuint& nTexturebufferId);
};
VCLOPENGL_DLLPUBLIC std::ostream& operator<<(std::ostream& rStrm, const glm::mat4& rMatrix);
diff --git a/vcl/source/opengl/OpenGLHelper.cxx b/vcl/source/opengl/OpenGLHelper.cxx
index 0e9d710..ad2506d 100644
--- a/vcl/source/opengl/OpenGLHelper.cxx
+++ b/vcl/source/opengl/OpenGLHelper.cxx
@@ -268,5 +268,41 @@ std::ostream& operator<<(std::ostream& rStrm, const glm::mat4& rMatrix)
return rStrm;
}
+void OpenGLHelper::createFramebuffer(long nWidth, long nHeight,
+ GLuint& nFramebufferId, GLuint& nRenderbufferId, GLuint& nTexturebufferId)
+{
+ // create a renderbuffer
+ glGenRenderbuffers(1, &nRenderbufferId);
+ glBindRenderbuffer(GL_RENDERBUFFER, nRenderbufferId);
+ glRenderbufferStorage(GL_RENDERBUFFER, GL_DEPTH_COMPONENT, nWidth, nHeight);
+ glBindRenderbuffer(GL_RENDERBUFFER, 0);
+
+ // create a texture
+ glGenTextures(1, &nTexturebufferId);
+ glBindTexture(GL_TEXTURE_2D, nTexturebufferId);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
+ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
+ glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, nWidth, nHeight, 0, GL_RGBA, GL_UNSIGNED_BYTE, NULL);
+ glBindTexture(GL_TEXTURE_2D, 0);
+
+ // create a framebuffer object and attach renderbuffer and texture
+ glGenFramebuffers(1, &nFramebufferId);
+ glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ glBindFramebuffer(GL_FRAMEBUFFER, nFramebufferId);
+ glBindTexture(GL_TEXTURE_2D, nTexturebufferId);
+ // attach a texture to FBO color attachement point
+ glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, nTexturebufferId, 0);
+ glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ glBindTexture(GL_TEXTURE_2D, 0);
+ // attach a renderbuffer to depth attachment point
+ glBindRenderbuffer(GL_RENDERBUFFER, nRenderbufferId);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_DEPTH_ATTACHMENT, GL_RENDERBUFFER, nRenderbufferId);
+ glCheckFramebufferStatus(GL_FRAMEBUFFER);
+ glBindRenderbuffer(GL_RENDERBUFFER, 0);
+ glBindFramebuffer(GL_FRAMEBUFFER, 0);
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit e634b0dcdd6286cef92dac83847af8b6fb08ce70
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Wed May 21 00:18:13 2014 +0200
set the color for the picking
Change-Id: If7b902b16626384440241d88937161cf327e14d5
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index f782140..52d341a 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -79,6 +79,7 @@ struct Polygon3DInfo
bool twoSidesLighting;
long fillStyle;
glm::vec4 polygonColor;
+ glm::vec4 id;
Vertices3D *vertices;
UVs3D *uvs;
Normals3D *normals;
@@ -93,6 +94,7 @@ struct Extrude3DInfo
bool rounded;
bool twoSidesLighting;
glm::vec4 extrudeColor;
+ glm::vec4 id;
float xScale;
float yScale;
float zScale;
@@ -136,6 +138,7 @@ struct PackedVertex{
struct TextInfo
{
+ glm::vec4 id;
GLuint texture;
float vertex[12];
};
@@ -159,20 +162,20 @@ public:
void Set3DSenceInfo(sal_uInt32 color = 255, bool twoSidesLighting = true);
void SetLightInfo(bool lightOn, sal_uInt32 color, const glm::vec4& direction);
void AddShapePolygon3DObject(sal_uInt32 color, bool lineOnly, sal_uInt32 lineColor,
- long fillStyle, sal_uInt32 specular);
+ long fillStyle, sal_uInt32 specular, sal_uInt32 nUniqueId);
void EndAddShapePolygon3DObject();
void AddPolygon3DObjectNormalPoint(float x, float y, float z);
void EndAddPolygon3DObjectNormalPoint();
void AddPolygon3DObjectPoint(float x, float y, float z);
void EndAddPolygon3DObjectPoint();
- void AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 color, sal_uInt32 specular, glm::mat4 modelMatrix);
+ void AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 color, sal_uInt32 specular, const glm::mat4& modelMatrix, sal_uInt32 nUniqueId);
void EndAddShape3DExtrudeObject();
double GetTime();
void SetFPS(float fps);
void RenderClickPos(Point aMPos);
void SetSize(const Size& rSize);
void SetCameraInfo(glm::vec3 pos, glm::vec3 direction, glm::vec3 up);
- void CreateTextTexture(const BitmapEx& rBitmapEx, glm::vec3 vTopLeft,glm::vec3 vTopRight, glm::vec3 vBottomRight, glm::vec3 vBottomLeft);
+ void CreateTextTexture(const BitmapEx& rBitmapEx, glm::vec3 vTopLeft,glm::vec3 vTopRight, glm::vec3 vBottomRight, glm::vec3 vBottomLeft, sal_uInt32 nUniqueId);
void ProcessUnrenderedShape();
void SetPickingMode(bool bPickingMode);
diff --git a/chart2/source/view/main/3DChartObjects.cxx b/chart2/source/view/main/3DChartObjects.cxx
index 4581d74..e67c25d 100644
--- a/chart2/source/view/main/3DChartObjects.cxx
+++ b/chart2/source/view/main/3DChartObjects.cxx
@@ -39,7 +39,7 @@ Bar::Bar(OpenGL3DRenderer* pRenderer, const glm::mat4& rPosition, sal_uInt32 aCo
void Bar::render()
{
- mpRenderer->AddShape3DExtrudeObject(mbRoundedCorners, maColor.GetColor(), 0xFFFFFF, maPos);
+ mpRenderer->AddShape3DExtrudeObject(mbRoundedCorners, maColor.GetColor(), 0xFFFFFF, maPos, mnUniqueId);
mpRenderer->EndAddShape3DExtrudeObject();
}
@@ -50,7 +50,7 @@ Line::Line(OpenGL3DRenderer* pRenderer, sal_uInt32 nId):
void Line::render()
{
- mpRenderer->AddShapePolygon3DObject(0, true, maLineColor.GetColor(), 0, 0);
+ mpRenderer->AddShapePolygon3DObject(0, true, maLineColor.GetColor(), 0, 0, mnUniqueId);
mpRenderer->AddPolygon3DObjectPoint(maPosBegin.x, maPosBegin.y, maPosBegin.z);
mpRenderer->AddPolygon3DObjectPoint(maPosEnd.x, maPosEnd.y, maPosEnd.z);
mpRenderer->EndAddShapePolygon3DObject();
@@ -87,7 +87,7 @@ void Text::render()
{
glm::vec3 dir2 = maTopRight - maTopLeft;
glm::vec3 bottomLeft = maBottomRight - dir2;
- mpRenderer->CreateTextTexture(maText, maTopLeft, maTopRight, maBottomRight, bottomLeft);
+ mpRenderer->CreateTextTexture(maText, maTopLeft, maTopRight, maBottomRight, bottomLeft, mnUniqueId);
}
Size Text::getSize() const
@@ -112,7 +112,7 @@ void Rectangle::render()
glm::vec3 dir1 = maBottomRight - maTopLeft;
glm::vec3 dir2 = maTopRight - maTopLeft;
glm::vec3 normal = glm::normalize(glm::cross(dir1, dir2));
- mpRenderer->AddShapePolygon3DObject(maColor.GetColor(), false, 0, 1, 0xFFFFFF);
+ mpRenderer->AddShapePolygon3DObject(maColor.GetColor(), false, 0, 1, 0xFFFFFF, mnUniqueId);
glm::vec3 bottomLeft = maBottomRight - dir2;
//set polygon points and normals
mpRenderer->AddPolygon3DObjectPoint(maBottomRight.x, maBottomRight.y, maBottomRight.z);
@@ -128,7 +128,7 @@ void Rectangle::render()
//we should render the edge if the edge color is different from the fill color
if (maColor.GetColor() != maLineColor.GetColor())
{
- mpRenderer->AddShapePolygon3DObject(0, true, maLineColor.GetColor(), 0, 0xFFFFFF);
+ mpRenderer->AddShapePolygon3DObject(0, true, maLineColor.GetColor(), 0, 0xFFFFFF, mnUniqueId);
mpRenderer->AddPolygon3DObjectPoint(maBottomRight.x, maBottomRight.y, maBottomRight.z);
mpRenderer->AddPolygon3DObjectPoint(maTopRight.x, maTopRight.y, maTopRight.z);
mpRenderer->AddPolygon3DObjectPoint(maTopLeft.x, maTopLeft.y, maTopLeft.z);
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index 07b652a..92cf61d 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -706,7 +706,10 @@ void OpenGL3DRenderer::RenderLine3D(Polygon3DInfo &polygon)
//fill vertex buffer
glBindBuffer(GL_ARRAY_BUFFER, m_VertexBuffer);
glBufferData(GL_ARRAY_BUFFER, pointList->size() * sizeof(glm::vec3), &pointList[0][0], GL_STATIC_DRAW);
- glUniform4fv(maResources.m_2DColorID, 1, &polygon.polygonColor[0]);
+ if(mbPickingMode)
+ glUniform4fv(maResources.m_2DColorID, 1, &polygon.id[0]);
+ else
+ glUniform4fv(maResources.m_2DColorID, 1, &polygon.polygonColor[0]);
glUniformMatrix4fv(maResources.m_MatrixID, 1, GL_FALSE, &m_3DMVP[0][0]);
// 1rst attribute buffer : vertices
@@ -786,6 +789,7 @@ void OpenGL3DRenderer::RenderPolygon3D(Polygon3DInfo &polygon)
{
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
+ glUniform4fv(maResources.m_2DColorID, 1, &polygon.id[0]);
}
GLint maVertexID = mbPickingMode ? maPickingResources.m_2DVertexID : maResources.m_3DVertexID;
@@ -878,9 +882,10 @@ void OpenGL3DRenderer::SetLightInfo(bool lightOn, sal_uInt32 nColor, const glm::
}
}
-void OpenGL3DRenderer::AddShapePolygon3DObject(sal_uInt32 nColor, bool lineOnly, sal_uInt32 nLineColor,long fillStyle, sal_uInt32 specular)
+void OpenGL3DRenderer::AddShapePolygon3DObject(sal_uInt32 nColor, bool lineOnly, sal_uInt32 nLineColor,long fillStyle, sal_uInt32 specular, sal_uInt32 nUniqueId)
{
m_Polygon3DInfo.polygonColor = getColorAsVector(nColor);
+ m_Polygon3DInfo.id = getColorAsVector(nUniqueId);
m_Polygon3DInfo.material.materialColor = m_Polygon3DInfo.polygonColor;//material color seems to be the same for all parts, so we use the polygon color
//line or Polygon
m_Polygon3DInfo.lineOnly = lineOnly;
@@ -960,8 +965,9 @@ void OpenGL3DRenderer::EndAddPolygon3DObjectPoint()
m_Polygon3DInfo.vertices = NULL;
}
-void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nColor, sal_uInt32 specular, glm::mat4 modelMatrix)
+void OpenGL3DRenderer::AddShape3DExtrudeObject(bool roundedCorner, sal_uInt32 nColor, sal_uInt32 specular, const glm::mat4& modelMatrix, sal_uInt32 nUniqueId)
{
+ m_Extrude3DInfo.id = getColorAsVector(nUniqueId);
glm::vec4 tranform = modelMatrix * glm::vec4(0.0, 0.0, 0.0, 1.0);
glm::vec4 DirX = modelMatrix * glm::vec4(1.0, 0.0, 0.0, 0.0);
glm::vec4 DirY = modelMatrix * glm::vec4(0.0, 1.0, 0.0, 0.0);
@@ -1091,6 +1097,7 @@ void OpenGL3DRenderer::RenderExtrudeFlatSurface(const Extrude3DInfo& extrude3D,
{
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
+ glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]);
}
glDrawElements(GL_TRIANGLES, extrude3D.size[surIndex], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[surIndex]));
@@ -1134,6 +1141,7 @@ void OpenGL3DRenderer::RenderExtrudeBottomSurface(const Extrude3DInfo& extrude3D
{
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
+ glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]);
}
glDrawElements(GL_TRIANGLES, extrude3D.size[BOTTOM_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[BOTTOM_SURFACE]));
}
@@ -1178,6 +1186,7 @@ void OpenGL3DRenderer::RenderExtrudeMiddleSurface(const Extrude3DInfo& extrude3D
{
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
+ glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]);
}
glDrawElements(GL_TRIANGLES, extrude3D.size[MIDDLE_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[MIDDLE_SURFACE]));
}
@@ -1223,6 +1232,7 @@ void OpenGL3DRenderer::RenderExtrudeTopSurface(const Extrude3DInfo& extrude3D)
{
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
+ glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]);
}
glDrawElements(GL_TRIANGLES, extrude3D.size[TOP_SURFACE], GL_UNSIGNED_SHORT, reinterpret_cast<GLvoid*>(extrude3D.startIndex[TOP_SURFACE]));
RenderExtrudeFlatSurface(extrude3D, FLAT_BOTTOM_SURFACE);
@@ -1253,6 +1263,7 @@ void OpenGL3DRenderer::RenderNonRoundedBar(const Extrude3DInfo& extrude3D)
{
glm::mat4 aMVP = m_3DProjection * m_3DView * m_Model;
glUniformMatrix4fv(maPickingResources.m_MatrixID, 1, GL_FALSE, &aMVP[0][0]);
+ glUniform4fv(maResources.m_2DColorID, 1, &extrude3D.id[0]);
}
glDrawArrays(GL_TRIANGLES, 0, 36);
}
@@ -1279,7 +1290,9 @@ void OpenGL3DRenderer::RenderExtrude3DObject()
glEnable(GL_CULL_FACE);
glCullFace(GL_BACK);
if(mbPickingMode)
+ {
glUseProgram(maPickingResources.m_CommonProID);
+ }
else
{
Update3DUniformBlock();
@@ -1294,6 +1307,9 @@ void OpenGL3DRenderer::RenderExtrude3DObject()
Extrude3DInfo extrude3DInfo = m_Extrude3DList[i];
GLuint vertexBuf = extrude3DInfo.rounded ? m_CubeVertexBuf : m_BoundBox;
GLuint normalBuf = extrude3DInfo.rounded ? m_CubeNormalBuf : m_BoundBoxNormal;
+
+ if(mbPickingMode)
+ glUniform4fv(maResources.m_2DColorID, 1, &extrude3DInfo.id[0]);
// 1st attribute buffer : vertices
GLint aVertexID = mbPickingMode ? maPickingResources.m_2DVertexID : maResources.m_3DVertexID;
@@ -1348,13 +1364,14 @@ void OpenGL3DRenderer::RenderExtrude3DObject()
glDisable(GL_CULL_FACE);
}
-void OpenGL3DRenderer::CreateTextTexture(const BitmapEx& rBitmapEx, glm::vec3 vTopLeft,glm::vec3 vTopRight, glm::vec3 vBottomRight, glm::vec3 vBottomLeft)
+void OpenGL3DRenderer::CreateTextTexture(const BitmapEx& rBitmapEx, glm::vec3 vTopLeft,glm::vec3 vTopRight, glm::vec3 vBottomRight, glm::vec3 vBottomLeft, sal_uInt32 nUniqueId)
{
long bmpWidth = rBitmapEx.GetSizePixel().Width();
long bmpHeight = rBitmapEx.GetSizePixel().Height();
boost::scoped_array<sal_uInt8> bitmapBuf(OpenGLHelper::ConvertBitmapExToRGBABuffer(rBitmapEx));
TextInfo aTextInfo;
+ aTextInfo.id = getColorAsVector(nUniqueId);
aTextInfo.vertex[0] = vBottomRight.x;
aTextInfo.vertex[1] = vBottomRight.y;
aTextInfo.vertex[2] = vBottomRight.z * m_fHeightWeight;
commit 1b8cfd5d1414da9127ff18e4701b40f5bceabb36
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue May 20 23:59:55 2014 +0200
remove unnecessary whitespaces
Change-Id: I4d93c0149aaf90e2477c1382aa51f8f08c967626
diff --git a/chart2/source/view/inc/GL3DRenderer.hxx b/chart2/source/view/inc/GL3DRenderer.hxx
index 8628bb8..f782140 100644
--- a/chart2/source/view/inc/GL3DRenderer.hxx
+++ b/chart2/source/view/inc/GL3DRenderer.hxx
@@ -106,7 +106,6 @@ struct Extrude3DInfo
int reverse;
};
-
struct CameraInfo
{
glm::vec3 cameraPos;
@@ -150,7 +149,6 @@ typedef struct SceneBox{
float minZCoord;
}SceneBox;
-
class OpenGL3DRenderer
{
public:
commit 5500a4fedc406fad218a2529c905f33008e453f3
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue May 20 23:47:28 2014 +0200
avoid division by zero that happens to me in some cases
Change-Id: Ifc80462e7826e7d717dc553f50dd00f2b771bf15
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index c98ef30..07b652a 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -1030,7 +1030,7 @@ void OpenGL3DRenderer::Init3DUniformBlock()
{
return;
}
- int nUniformBufferAlignSize = 0;
+ int nUniformBufferAlignSize = 1;
glGetIntegerv(GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &nUniformBufferAlignSize);
GLint nBlockDataSizeLight = 0, nBlockDataSizeMertrial = 0;
glGetActiveUniformBlockiv(maResources.m_3DProID, a3DLightBlockIndex, GL_UNIFORM_BLOCK_DATA_SIZE, &nBlockDataSizeLight);
commit 08bed8aa8a8615f85cea404cb7a859f3bccf78cc
Author: Markus Mohrhard <markus.mohrhard at collabora.co.uk>
Date: Tue May 20 23:46:57 2014 +0200
we need to create the buffer
Somehow this only crashes when I use gdb.
Change-Id: Ic18ffa3af931b80a7241e8fe711753db03da166e
diff --git a/chart2/source/view/main/GL3DRenderer.cxx b/chart2/source/view/main/GL3DRenderer.cxx
index f7867d5..c98ef30 100644
--- a/chart2/source/view/main/GL3DRenderer.cxx
+++ b/chart2/source/view/main/GL3DRenderer.cxx
@@ -109,6 +109,7 @@ OpenGL3DRenderer::~OpenGL3DRenderer()
glDeleteBuffers(1, &m_RenderTexCoordBuf);
glDeleteBuffers(1, &m_RenderVertexBuf);
glDeleteBuffers(1, &m_3DUBOBuffer);
+ glDeleteBuffers(1, &m_VertexBuffer);
}
void OpenGL3DRenderer::ShaderResources::LoadShaders()
@@ -216,6 +217,7 @@ void OpenGL3DRenderer::init()
glGenBuffers(1, &m_CubeVertexBuf);
glGenBuffers(1, &m_CubeNormalBuf);
glGenBuffers(1, &m_CubeElementBuf);
+ glGenBuffers(1, &m_VertexBuffer);
glGenBuffers(1, &m_BoundBox);
glBindBuffer(GL_ARRAY_BUFFER, m_BoundBox);
glBufferData(GL_ARRAY_BUFFER, sizeof(boundBox), boundBox, GL_STATIC_DRAW);
commit 227af32d8c6d5e3649c83fcdb274298bc7faa294
Author: Julien Nabet <serval2412 at yahoo.fr>
Date: Tue May 20 23:29:28 2014 +0200
Prefer cppu::UnoType<T>::get() to ::getCppuType((T*)0) part18
Change-Id: Ibf958dbfbf7cdbe6ad31d390138be8d4d468c225
diff --git a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
index 4633f2a..caccf12 100644
--- a/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
+++ b/chart2/source/controller/chartapiwrapper/ChartDocumentWrapper.cxx
@@ -195,7 +195,7 @@ void lcl_AddPropertiesToVector(
rOutProperties.push_back(
Property( "AddIn",
PROP_DOCUMENT_ADDIN,
- ::getCppuType( reinterpret_cast< Reference< util::XRefreshable > * >(0)),
+ cppu::UnoType<util::XRefreshable>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
rOutProperties.push_back(
@@ -207,7 +207,7 @@ void lcl_AddPropertiesToVector(
rOutProperties.push_back(
Property( "AdditionalShapes",
PROP_DOCUMENT_ADDITIONAL_SHAPES,
- ::getCppuType( reinterpret_cast< Reference< drawing::XShapes > * >(0)),
+ cppu::UnoType<drawing::XShapes>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID
| beans::PropertyAttribute::READONLY ));
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
index 796d755..c7d808c 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStatisticProperties.cxx
@@ -1059,21 +1059,21 @@ void WrappedStatisticProperties::addProperties( ::std::vector< Property > & rOut
rOutProperties.push_back(
Property( "DataRegressionProperties",
PROP_CHART_STATISTIC_REGRESSION_PROPERTIES,
- ::getCppuType( reinterpret_cast< const Reference< beans::XPropertySet > * >(0)),
+ cppu::UnoType<beans::XPropertySet>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
| beans::PropertyAttribute::MAYBEVOID ));
rOutProperties.push_back(
Property( "DataErrorProperties",
PROP_CHART_STATISTIC_ERROR_PROPERTIES,
- ::getCppuType( reinterpret_cast< const Reference< beans::XPropertySet > * >(0)),
+ cppu::UnoType<beans::XPropertySet>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
| beans::PropertyAttribute::MAYBEVOID ));
rOutProperties.push_back(
Property( "DataMeanValueProperties",
PROP_CHART_STATISTIC_MEAN_VALUE_PROPERTIES,
- ::getCppuType( reinterpret_cast< const Reference< beans::XPropertySet > * >(0)),
+ cppu::UnoType<beans::XPropertySet>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::READONLY
| beans::PropertyAttribute::MAYBEVOID ));
diff --git a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
index 9fef7da..2469312 100644
--- a/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
+++ b/chart2/source/controller/chartapiwrapper/WrappedStockProperties.cxx
@@ -266,14 +266,14 @@ void WrappedStockProperties::addProperties( ::std::vector< Property > & rOutProp
rOutProperties.push_back(
Property( "Volume",
PROP_CHART_STOCK_VOLUME,
- ::getCppuType( reinterpret_cast< sal_Bool * >(0)),
+ cppu::UnoType<sal_Bool>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT
| beans::PropertyAttribute::MAYBEVOID ));
rOutProperties.push_back(
Property( "UpDown",
PROP_CHART_STOCK_UPDOWN,
- ::getCppuType( reinterpret_cast< sal_Bool * >(0)),
+ cppu::UnoType<sal_Bool>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT
| beans::PropertyAttribute::MAYBEVOID ));
diff --git a/chart2/source/model/filter/XMLFilter.cxx b/chart2/source/model/filter/XMLFilter.cxx
index 32f0419..bc5f494 100644
--- a/chart2/source/model/filter/XMLFilter.cxx
+++ b/chart2/source/model/filter/XMLFilter.cxx
@@ -339,7 +339,7 @@ sal_Int32 XMLFilter::impl_Import(
{ OUString("ProgressMax"), 0, ::cppu::UnoType<sal_Int32>::get(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("ProgressCurrent"), 0, ::cppu::UnoType<sal_Int32>::get(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("PrivateData"), 0,
- ::getCppuType( (Reference<XInterface> *)0 ),
+ cppu::UnoType<XInterface>::get(),
::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("BaseURI"), 0,
::cppu::UnoType<OUString>::get(),
diff --git a/chart2/source/model/template/CandleStickChartType.cxx b/chart2/source/model/template/CandleStickChartType.cxx
index 57320b9..faf5f39 100644
--- a/chart2/source/model/template/CandleStickChartType.cxx
+++ b/chart2/source/model/template/CandleStickChartType.cxx
@@ -59,13 +59,13 @@ void lcl_AddPropertiesToVector(
rOutProperties.push_back(
Property( "WhiteDay",
PROP_CANDLESTICKCHARTTYPE_WHITE_DAY,
- ::getCppuType( reinterpret_cast< Reference< beans::XPropertySet > *>(0)),
+ cppu::UnoType<beans::XPropertySet>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
rOutProperties.push_back(
Property( "BlackDay",
PROP_CANDLESTICKCHARTTYPE_BLACK_DAY,
- ::getCppuType( reinterpret_cast< Reference< beans::XPropertySet > *>(0)),
+ cppu::UnoType<beans::XPropertySet>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEVOID ));
diff --git a/chart2/source/model/template/PieChartTypeTemplate.cxx b/chart2/source/model/template/PieChartTypeTemplate.cxx
index b30f633..e49decf 100644
--- a/chart2/source/model/template/PieChartTypeTemplate.cxx
+++ b/chart2/source/model/template/PieChartTypeTemplate.cxx
@@ -63,7 +63,7 @@ static void lcl_AddPropertiesToVector(
rOutProperties.push_back(
Property( "OffsetMode",
PROP_PIE_TEMPLATE_OFFSET_MODE,
- ::getCppuType( reinterpret_cast< const chart2::PieChartOffsetMode * >(0)),
+ cppu::UnoType<chart2::PieChartOffsetMode>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
rOutProperties.push_back(
diff --git a/chart2/source/tools/FillProperties.cxx b/chart2/source/tools/FillProperties.cxx
index a6177d6..5316984 100644
--- a/chart2/source/tools/FillProperties.cxx
+++ b/chart2/source/tools/FillProperties.cxx
@@ -94,7 +94,7 @@ void lcl_AddPropertiesToVector_without_BitmapProperties( ::std::vector< ::com::s
rOutProperties.push_back(
Property( "FillBackground",
FillProperties::PROP_FILL_BACKGROUND,
- ::getCppuType( reinterpret_cast< const sal_Bool * >(0)),
+ cppu::UnoType<sal_Bool>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
}
@@ -147,7 +147,7 @@ void lcl_AddPropertiesToVector_only_BitmapProperties( ::std::vector< ::com::sun:
rOutProperties.push_back(
Property( "FillBitmapLogicalSize",
FillProperties::PROP_FILL_BITMAP_LOGICALSIZE,
- ::getCppuType( reinterpret_cast< const sal_Bool * >(0)),
+ cppu::UnoType<sal_Bool>::get(),
beans::PropertyAttribute::BOUND
| beans::PropertyAttribute::MAYBEDEFAULT ));
diff --git a/chart2/source/tools/ModifyListenerHelper.cxx b/chart2/source/tools/ModifyListenerHelper.cxx
index 3245ca5..ae5e5d0 100644
--- a/chart2/source/tools/ModifyListenerHelper.cxx
+++ b/chart2/source/tools/ModifyListenerHelper.cxx
@@ -39,7 +39,7 @@ void lcl_fireModifyEvent(
const lang::EventObject * pEvent )
{
::cppu::OInterfaceContainerHelper * pCntHlp = rBroadcastHelper.getContainer(
- ::getCppuType( reinterpret_cast< Reference< util::XModifyListener > * >(0)));
+ cppu::UnoType<util::XModifyListener>::get());
if( pCntHlp )
{
lang::EventObject aEventToSend;
@@ -156,7 +156,7 @@ void ModifyEventForwarder::RemoveListener( const Reference< util::XModifyListene
void ModifyEventForwarder::DisposeAndClear( const Reference< uno::XWeak > & xSource )
{
::cppu::OInterfaceContainerHelper * pCntHlp = m_aModifyListeners.getContainer(
- ::getCppuType( reinterpret_cast< Reference< util::XModifyListener > * >(0)));
+ cppu::UnoType<util::XModifyListener>::get());
if( pCntHlp )
pCntHlp->disposeAndClear( lang::EventObject( xSource ) );
}
diff --git a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
index d3fb0ed..335d697 100644
--- a/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
+++ b/sc/source/ui/Accessibility/AccessibleCsvControl.cxx
@@ -736,7 +736,7 @@ OUString SAL_CALL ScAccessibleCsvRuler::getImplementationName() throw( RuntimeEx
Sequence< ::com::sun::star::uno::Type > SAL_CALL ScAccessibleCsvRuler::getTypes() throw( RuntimeException, std::exception )
{
Sequence< ::com::sun::star::uno::Type > aSeq( 1 );
- aSeq[ 0 ] = getCppuType( static_cast< const Reference< XAccessibleText >* >( NULL ) );
+ aSeq[ 0 ] = cppu::UnoType<XAccessibleText>::get();
return ::comphelper::concatSequences( ScAccessibleCsvControl::getTypes(), aSeq );
}
@@ -1234,8 +1234,8 @@ OUString SAL_CALL ScAccessibleCsvGrid::getImplementationName() throw( RuntimeExc
Sequence< ::com::sun::star::uno::Type > SAL_CALL ScAccessibleCsvGrid::getTypes() throw( RuntimeException, std::exception )
{
Sequence< ::com::sun::star::uno::Type > aSeq( 2 );
- aSeq[ 0 ] = getCppuType( static_cast< const Reference< XAccessibleTable >* >( NULL ) );
- aSeq[ 1 ] = getCppuType( static_cast< const Reference< XAccessibleSelection >* >( NULL ) );
+ aSeq[ 0 ] = cppu::UnoType<XAccessibleTable>::get();
+ aSeq[ 1 ] = cppu::UnoType<XAccessibleSelection>::get();
return ::comphelper::concatSequences( ScAccessibleCsvControl::getTypes(), aSeq );
}
diff --git a/sc/source/ui/unoobj/dapiuno.cxx b/sc/source/ui/unoobj/dapiuno.cxx
index 0ca5275..3ace2c4 100644
--- a/sc/source/ui/unoobj/dapiuno.cxx
+++ b/sc/source/ui/unoobj/dapiuno.cxx
@@ -493,7 +493,7 @@ Any SAL_CALL ScDataPilotTablesObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScDataPilotTablesObj::getElementType() throw(RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- return getCppuType((Reference<XDataPilotTable2>*)0);
+ return cppu::UnoType<XDataPilotTable2>::get();
}
sal_Bool SAL_CALL ScDataPilotTablesObj::hasElements() throw(RuntimeException, std::exception)
@@ -620,12 +620,12 @@ Sequence< uno::Type > SAL_CALL ScDataPilotDescriptorBase::getTypes()
{
aTypes.realloc( 6 );
uno::Type* pPtr = aTypes.getArray();
- pPtr[ 0 ] = getCppuType( (const Reference< XDataPilotDescriptor >*)0 );
- pPtr[ 1 ] = getCppuType( (const Reference< XPropertySet >*)0 );
- pPtr[ 2 ] = getCppuType( (const Reference< XDataPilotDataLayoutFieldSupplier >*)0 );
- pPtr[ 3 ] = getCppuType( (const Reference< lang::XUnoTunnel >*)0 );
- pPtr[ 4 ] = getCppuType( (const Reference< lang::XTypeProvider >*)0 );
- pPtr[ 5 ] = getCppuType( (const Reference< lang::XServiceInfo >*)0 );
+ pPtr[ 0 ] = cppu::UnoType<XDataPilotDescriptor>::get();
+ pPtr[ 1 ] = cppu::UnoType<XPropertySet>::get();
+ pPtr[ 2 ] = cppu::UnoType<XDataPilotDataLayoutFieldSupplier>::get();
+ pPtr[ 3 ] = cppu::UnoType<lang::XUnoTunnel>::get();
+ pPtr[ 4 ] = cppu::UnoType<lang::XTypeProvider>::get();
+ pPtr[ 5 ] = cppu::UnoType<lang::XServiceInfo>::get();
}
return aTypes;
}
@@ -1128,8 +1128,8 @@ Sequence< uno::Type > SAL_CALL ScDataPilotTableObj::getTypes() throw(RuntimeExce
for (sal_Int32 i = 0; i < nParentLen; ++i)
pPtr[ i ] = pParentPtr[ i ]; // parent types first
- pPtr[ nParentLen ] = getCppuType( (const Reference< XDataPilotTable2 >*)0 );
- pPtr[ nParentLen+1 ] = getCppuType( (const Reference< XModifyBroadcaster >*)0 );
+ pPtr[ nParentLen ] = cppu::UnoType<XDataPilotTable2>::get();
+ pPtr[ nParentLen+1 ] = cppu::UnoType<XModifyBroadcaster>::get();
}
return aTypes;
}
@@ -1737,7 +1737,7 @@ Any SAL_CALL ScDataPilotFieldsObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScDataPilotFieldsObj::getElementType() throw(RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- return getCppuType((Reference<XPropertySet>*)0);
+ return cppu::UnoType<XPropertySet>::get();
}
sal_Bool SAL_CALL ScDataPilotFieldsObj::hasElements() throw(RuntimeException, std::exception)
@@ -2969,7 +2969,7 @@ Reference<XEnumeration> SAL_CALL ScDataPilotFieldGroupsObj::createEnumeration()
uno::Type SAL_CALL ScDataPilotFieldGroupsObj::getElementType() throw(RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- return getCppuType( (Reference< XNameAccess >*)0 );
+ return cppu::UnoType<XNameAccess>::get();
}
sal_Bool SAL_CALL ScDataPilotFieldGroupsObj::hasElements() throw(RuntimeException, std::exception)
@@ -3153,7 +3153,7 @@ Reference< XEnumeration > SAL_CALL ScDataPilotFieldGroupObj::createEnumeration()
uno::Type SAL_CALL ScDataPilotFieldGroupObj::getElementType() throw(RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- return getCppuType( (Reference< XNamed >*)0 );
+ return cppu::UnoType<XNamed>::get();
}
sal_Bool SAL_CALL ScDataPilotFieldGroupObj::hasElements() throw(RuntimeException, std::exception)
@@ -3312,7 +3312,7 @@ Any SAL_CALL ScDataPilotItemsObj::getByIndex( sal_Int32 nIndex )
uno::Type SAL_CALL ScDataPilotItemsObj::getElementType() throw(RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- return getCppuType((Reference<XPropertySet>*)0);
+ return cppu::UnoType<XPropertySet>::get();
}
sal_Bool SAL_CALL ScDataPilotItemsObj::hasElements() throw(RuntimeException, std::exception)
diff --git a/sc/source/ui/unoobj/datauno.cxx b/sc/source/ui/unoobj/datauno.cxx
index fd160cf..09762b1 100644
--- a/sc/source/ui/unoobj/datauno.cxx
+++ b/sc/source/ui/unoobj/datauno.cxx
@@ -95,7 +95,7 @@ static const SfxItemPropertyMapEntry* lcl_GetFilterPropertyMap()
{OUString(SC_UNONAME_COPYOUT), 0, getBooleanCppuType(), 0, 0},
{OUString(SC_UNONAME_ISCASE), 0, getBooleanCppuType(), 0, 0},
{OUString(SC_UNONAME_MAXFLD), 0, cppu::UnoType<sal_Int32>::get(), beans::PropertyAttribute::READONLY, 0},
- {OUString(SC_UNONAME_ORIENT), 0, getCppuType((table::TableOrientation*)0), 0, 0},
+ {OUString(SC_UNONAME_ORIENT), 0, cppu::UnoType<table::TableOrientation>::get(), 0, 0},
{OUString(SC_UNONAME_OUTPOS), 0, cppu::UnoType<table::CellAddress>::get(), 0, 0},
{OUString(SC_UNONAME_SAVEOUT), 0, getBooleanCppuType(), 0, 0},
{OUString(SC_UNONAME_SKIPDUP), 0, getBooleanCppuType(), 0, 0},
diff --git a/sc/source/ui/unoobj/linkuno.cxx b/sc/source/ui/unoobj/linkuno.cxx
index 27cc395..86e7fc8 100644
--- a/sc/source/ui/unoobj/linkuno.cxx
+++ b/sc/source/ui/unoobj/linkuno.cxx
@@ -1675,7 +1675,7 @@ uno::Type SAL_CALL ScExternalDocLinkObj::getElementType()
throw (RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- return getCppuType(static_cast<Reference<sheet::XExternalDocLink>*>(0));
+ return cppu::UnoType<sheet::XExternalDocLink>::get();
}
sal_Bool SAL_CALL ScExternalDocLinkObj::hasElements()
@@ -1789,7 +1789,7 @@ uno::Type SAL_CALL ScExternalDocLinksObj::getElementType()
throw (RuntimeException, std::exception)
{
SolarMutexGuard aGuard;
- return getCppuType(static_cast<Reference<sheet::XExternalDocLinks>*>(0));
+ return cppu::UnoType<sheet::XExternalDocLinks>::get();
}
sal_Bool SAL_CALL ScExternalDocLinksObj::hasElements()
diff --git a/sd/source/core/text/textapi.cxx b/sd/source/core/text/textapi.cxx
index 0eedb57..b705e41 100644
--- a/sd/source/core/text/textapi.cxx
+++ b/sd/source/core/text/textapi.cxx
@@ -120,10 +120,10 @@ const SvxItemPropertySet* ImplGetSdTextPortionPropertyMap()
SVX_UNOEDIT_FONT_PROPERTIES,
SVX_UNOEDIT_OUTLINER_PROPERTIES,
SVX_UNOEDIT_PARA_PROPERTIES,
- {OUString("TextField"), EE_FEATURE_FIELD, ::getCppuType((const Reference< XTextField >*)0), PropertyAttribute::READONLY, 0 },
+ {OUString("TextField"), EE_FEATURE_FIELD, cppu::UnoType<XTextField>::get(), PropertyAttribute::READONLY, 0 },
{OUString("TextPortionType"), WID_PORTIONTYPE, ::cppu::UnoType<OUString>::get(), PropertyAttribute::READONLY, 0 },
- {OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, ::getCppuType((const Reference< XNameContainer >*)0) , 0, 0},
- {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, ::getCppuType((const Reference< XNameContainer >*)0) , 0, 0},
+ {OUString("TextUserDefinedAttributes"), EE_CHAR_XMLATTRIBS, cppu::UnoType<XNameContainer>::get(), 0, 0},
+ {OUString("ParaUserDefinedAttributes"), EE_PARA_XMLATTRIBS, cppu::UnoType<XNameContainer>::get(), 0, 0},
{ OUString(), 0, css::uno::Type(), 0, 0 }
};
static SvxItemPropertySet aSdTextPortionPropertyMap( aSdTextPortionPropertyEntries, SdrObject::GetGlobalDrawObjectItemPool() );
diff --git a/sd/source/filter/eppt/pptx-epptbase.cxx b/sd/source/filter/eppt/pptx-epptbase.cxx
index 4205bf9..411ffad 100644
--- a/sd/source/filter/eppt/pptx-epptbase.cxx
+++ b/sd/source/filter/eppt/pptx-epptbase.cxx
@@ -727,7 +727,7 @@ bool PPTWriterBase::GetShapeByIndex( sal_uInt32 nIndex, bool bGroup )
if ( !mXShape.is() )
break;
- Any aAny( mXShape->queryInterface( ::getCppuType( (const Reference< XPropertySet >*) 0 ) ));
+ Any aAny( mXShape->queryInterface( cppu::UnoType<XPropertySet>::get()));
aAny >>= mXPropSet;
if ( !mXPropSet.is() )
diff --git a/sd/source/filter/xml/sdxmlwrp.cxx b/sd/source/filter/xml/sdxmlwrp.cxx
index 1befad1..411e7b1 100644
--- a/sd/source/filter/xml/sdxmlwrp.cxx
+++ b/sd/source/filter/xml/sdxmlwrp.cxx
@@ -447,7 +447,7 @@ bool SdXMLFilter::Import( ErrCode& nError )
{ OUString("Preview"), 0, ::cppu::UnoType<sal_Bool>::get(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("PageLayouts"), 0, cppu::UnoType<container::XNameAccess>::get(), ::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0},
{ OUString("PrivateData"), 0,
- ::getCppuType( (Reference<XInterface> *)0 ),
+ cppu::UnoType<XInterface>::get(),
::com::sun::star::beans::PropertyAttribute::MAYBEVOID, 0 },
{ OUString("BaseURI"), 0,
::cppu::UnoType<OUString>::get(),
diff --git a/sd/source/ui/animations/CustomAnimationPane.cxx b/sd/source/ui/animations/CustomAnimationPane.cxx
index 8ccd117..2891489 100644
--- a/sd/source/ui/animations/CustomAnimationPane.cxx
+++ b/sd/source/ui/animations/CustomAnimationPane.cxx
@@ -1671,7 +1671,7 @@ void CustomAnimationPane::onChange( bool bCreate )
Reference< XSelectionSupplier > xSel( mxView, UNO_QUERY_THROW );
maViewSelection = xSel->getSelection();
- if( maViewSelection.getValueType() == ::getCppuType((const Reference< XShapes >*)0) )
+ if( maViewSelection.getValueType() == cppu::UnoType<XShapes>::get())
{
Reference< XIndexAccess > xShapes;
maViewSelection >>= xShapes;
@@ -1691,7 +1691,7 @@ void CustomAnimationPane::onChange( bool bCreate )
}
}
}
- else if ( maViewSelection.getValueType() == ::getCppuType((const Reference< XShape >*)0) )
+ else if ( maViewSelection.getValueType() == cppu::UnoType<XShape>::get())
{
aTargets.push_back( maViewSelection );
Reference< XText > xText;
@@ -1699,7 +1699,7 @@ void CustomAnimationPane::onChange( bool bCreate )
if( !xText.is() || xText->getString().isEmpty() )
bHasText = false;
}
- else if ( maViewSelection.getValueType() == ::getCppuType((const Reference< XTextCursor >*)0) )
+ else if ( maViewSelection.getValueType() == cppu::UnoType<XTextCursor>::get())
{
Reference< XShape > xShape;
std::list< sal_Int16 > aParaList;
diff --git a/sd/source/ui/unoidl/DrawController.cxx b/sd/source/ui/unoidl/DrawController.cxx
index f5ed766..380b69c 100644
--- a/sd/source/ui/unoidl/DrawController.cxx
+++ b/sd/source/ui/unoidl/DrawController.cxx
@@ -68,7 +68,7 @@ DrawController::DrawController (ViewShellBase& rBase) throw()
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list