[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - 645 commits - accessibility/source avmedia/source basctl/inc basctl/source basic/source bin/gbuild-to-ide bin/run bridges/source canvas/source chart2/Library_chartcontroller.mk chart2/qa chart2/source chart2/uiconfig comphelper/Library_comphelper.mk comphelper/source compilerplugins/clang config_host/config_python.h.in configmgr/source configure.ac connectivity/source cppcanvas/source cppuhelper/source cppu/source cui/Library_cui.mk cui/source dbaccess/source desktop/inc desktop/source desktop/uiconfig distro-configs/Jenkins download.lst drawinglayer/source dtrans/test editeng/source embeddedobj/source extensions/source external/apr external/boost external/libmwaw external/libwps external/neon extras/CustomTarget_autocorr.mk extras/CustomTarget_autotextshare.mk extras/CustomTarget_autotextuser.mk extras/source filter/CppunitTest_filter_msfilter.mk filter/CppunitTest_filter_utils.mk filter/Module_filter.mk filter/qa filter/source forms/inc forms/source formula/source fpicker/source fpicker/test fpicker/uiconfig framework/inc framework/source helpcontent2 hwpfilter/Library_hwp.mk hwpfilter/source i18nlangtag/source i18npool/inc i18npool/qa i18npool/source i18nutil/Library_i18nutil.mk i18nutil/source icon-themes/breeze idlc/source include/avmedia include/basegfx include/comphelper include/cppcanvas include/dbaccess include/editeng include/filter include/framework include/i18nlangtag include/LibreOfficeKit include/linguistic include/o3tl include/oox include/osl include/postmac.h include/postwin.h include/premac.h include/prewin.h include/salhelper include/sfx2 include/svl include/svtools include/svx include/toolkit include/tools include/ucbhelper include/unotools include/vcl include/xmloff instsetoo_native/CustomTarget_setup.mk io/qa io/source io/test jvmfwk/plugins jvmfwk/source l10ntools/inc l10ntools/source librelogo/source libreofficekit/qa libreofficekit/source lingucomponent/source linguist ic/inc linguistic/source linguistic/workben lotuswordpro/source o3tl/qa o3tl/README offapi/com offapi/UnoApi_offapi.mk officecfg/Configuration_officecfg.mk officecfg/registry onlineupdate/source oox/inc oox/source opencl/source package/inc package/source postprocess/CustomTarget_registry.mk pyuno/CustomTarget_python_shell.mk pyuno/CustomTarget_pyuno_pythonloader_ini.mk pyuno/Executable_python.mk pyuno/source pyuno/zipcore readlicense_oo/license registry/source reportdesign/inc reportdesign/source Repository.mk rsc/source sal/osl sal/qa sal/textenc sal/workben sax/qa sax/source sax/test sc/inc scp2/source sc/qa sc/source sc/uiconfig sdext/Library_pdfimport.mk sdext/source sd/inc sd/qa sd/source sfx2/inc sfx2/source shell/source slideshow/source solenv/bin solenv/gbuild sot/source starmath/inc starmath/source stoc/source store/source svgio/source svl/source svtools/Library_svt.mk svtools/qa svtools/source svtools/uiconfig svx/inc svx/Library_svxcore.mk svx/source svx/uiconfig sw/Cppun itTest_sw_odfexport.mk sw/inc sw/qa sw/sdi sw/source sw/uiconfig test/source toolkit/source tools/inc tools/qa tools/source ucbhelper/Library_ucbhelper.mk ucbhelper/source ucb/source unoidl/source unotest/source unotools/inc unotools/source uui/source vbahelper/source vcl/Executable_fftester.mk vcl/generic vcl/inc vcl/Library_vcl.mk vcl/Module_vcl.mk vcl/opengl vcl/osx vcl/Package_opengl.mk vcl/qa vcl/README.vars vcl/source vcl/unx vcl/win vcl/workben writerfilter/source writerperfect/inc writerperfect/qa writerperfect/source xmlhelp/source xmloff/inc xmloff/source xmlsecurity/inc xmlsecurity/source
Szymon Kłos
eszkadev at gmail.com
Sat Aug 29 04:13:02 PDT 2015
Rebased ref, commits from common ancestor:
commit 51c3a6421ecdb3443121c26e3bdeb21b07bd1fd8
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Wed Aug 26 13:48:59 2015 +0200
remember password for all types of service
Change-Id: I8620332ac5228eee1d7c16d0b0ff7920031be331
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 4d1cc15..c8ffde0 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -687,11 +687,16 @@ void RemoteFilesDialog::DisableControls()
m_pCancel_btn->Enable( true );
}
-void RemoteFilesDialog::SavePassword( const OUString& rURL, const OUString& rUser, const OUString& rPassword )
+void RemoteFilesDialog::SavePassword( const OUString& rURL, const OUString& rUser
+ , const OUString& rPassword, bool bPersistent )
{
+ if( rURL.isEmpty() || rUser.isEmpty() || rPassword.isEmpty() )
+ return;
+
try
{
- if( m_xMasterPasswd->isPersistentStoringAllowed() && m_xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) )
+ if( m_xMasterPasswd->isPersistentStoringAllowed() &&
+ ( !bPersistent || m_xMasterPasswd->authorizateWithMasterPassword( Reference< XInteractionHandler>() ) ) )
{
Reference< XInteractionHandler > xInteractionHandler(
InteractionHandler::createWithParent( m_xContext, 0 ),
@@ -700,8 +705,11 @@ void RemoteFilesDialog::SavePassword( const OUString& rURL, const OUString& rUse
Sequence< OUString > aPasswd( 1 );
aPasswd[0] = rPassword;
- m_xMasterPasswd->addPersistent(
- rURL, rUser, aPasswd, xInteractionHandler );
+ if( bPersistent )
+ m_xMasterPasswd->addPersistent(
+ rURL, rUser, aPasswd, xInteractionHandler );
+ else
+ m_xMasterPasswd->add( rURL, rUser, aPasswd, xInteractionHandler );
}
}
catch( const Exception& )
@@ -725,7 +733,8 @@ IMPL_LINK_NOARG_TYPED ( RemoteFilesDialog, AddServiceHdl, Button*, void )
OUString sUser = aDlg->GetUser();
if( !sUser.isEmpty() && !sPassword.isEmpty() )
{
- SavePassword( newService->GetUrl(), sUser, sPassword );
+ bool bPersistent = aDlg->IsRememberChecked();
+ SavePassword( newService->GetUrl(), sUser, sPassword, bPersistent );
}
OUString sPrefix = lcl_GetServiceType( newService );
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index 65ce6c2..a1ce0de 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -182,7 +182,8 @@ private:
void EnableControls();
void DisableControls();
- void SavePassword( const OUString& rURL, const OUString& rUser, const OUString& rPassword );
+ void SavePassword( const OUString& rURL, const OUString& rUser
+ , const OUString& rPassword, bool bPersistent );
DECL_LINK_TYPED ( AddServiceHdl, Button*, void );
DECL_LINK ( SelectServiceHdl, void * );
diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx
index 992c5e8..6acbf78 100644
--- a/include/svtools/PlaceEditDialog.hxx
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -73,6 +73,7 @@ public :
OUString GetServerUrl();
OUString GetPassword() { return m_pEDPassword->GetText(); };
OUString GetUser() { return m_pEDUsername->GetText(); };
+ bool IsRememberChecked() { return m_pCBPassword->IsChecked(); }
void ShowPasswordControl( bool bShow = true ) { m_bShowPassword = bShow; }
@@ -88,7 +89,6 @@ private:
DECL_LINK ( SelectTypeHdl, void * );
DECL_LINK ( EditLabelHdl, void * );
DECL_LINK ( EditUsernameHdl, void * );
- DECL_LINK ( ToggledPassHdl, CheckBox * );
};
diff --git a/include/svtools/ServerDetailsControls.hxx b/include/svtools/ServerDetailsControls.hxx
index 6fe3363..334778b 100644
--- a/include/svtools/ServerDetailsControls.hxx
+++ b/include/svtools/ServerDetailsControls.hxx
@@ -12,6 +12,8 @@
#include <map>
#include <com/sun/star/ucb/XCommandEnvironment.hpp>
+#include <com/sun/star/task/PasswordContainer.hpp>
+#include <com/sun/star/task/XPasswordContainer2.hpp>
#include <tools/urlobj.hxx>
#include <vcl/builder.hxx>
@@ -53,11 +55,10 @@ class DetailsContainer
virtual bool setUrl( const INetURLObject& rUrl );
virtual void setUsername( const OUString& /*rUsername*/ ) { };
+ virtual void setPassword( const OUString& ) { };
virtual void setActive( bool bActive = true );
- virtual bool hasPassEntry() { return true; }
-
protected:
void notifyChange( );
DECL_LINK ( ValueChangeHdl, void * );
@@ -124,6 +125,7 @@ class CmisDetailsContainer : public DetailsContainer
{
private:
OUString m_sUsername;
+ OUString m_sPassword;
com::sun::star::uno::Reference< com::sun::star::ucb::XCommandEnvironment > m_xCmdEnv;
std::vector< OUString > m_aRepoIds;
OUString m_sRepoId;
@@ -142,7 +144,7 @@ class CmisDetailsContainer : public DetailsContainer
virtual INetURLObject getUrl( ) SAL_OVERRIDE;
virtual bool setUrl( const INetURLObject& rUrl ) SAL_OVERRIDE;
virtual void setUsername( const OUString& rUsername ) SAL_OVERRIDE;
- virtual bool hasPassEntry() SAL_OVERRIDE { return false; }
+ virtual void setPassword( const OUString& rPass ) SAL_OVERRIDE;
private:
void selectRepository( );
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index b244494..68e5741b 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -23,7 +23,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
, m_xCurrentDetails()
, m_nCurrentType( 0 )
, bLabelChanged( false )
- , m_bShowPassword( false )
+ , m_bShowPassword( true )
{
get( m_pEDServerName, "name" );
get( m_pLBServerType, "type" );
@@ -36,11 +36,6 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
get( m_pEDPassword, "password" );
get( m_pFTPasswordLabel, "passwordLabel" );
- m_pEDPassword->Hide();
- m_pFTPasswordLabel->Hide();
- m_pCBPassword->Hide();
- m_pCBPassword->SetToggleHdl( LINK( this, PlaceEditDialog, ToggledPassHdl ) );
-
m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
m_pBTOk->Enable( false );
@@ -52,6 +47,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
m_pLBServerType->SetSelectHdl( LINK( this, PlaceEditDialog, SelectTypeHdl ) );
m_pEDUsername->SetModifyHdl( LINK( this, PlaceEditDialog, EditUsernameHdl ) );
+ m_pEDPassword->SetModifyHdl( LINK( this, PlaceEditDialog, EditUsernameHdl ) );
InitDetails( );
}
@@ -76,7 +72,6 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Pla
m_pEDPassword->Hide();
m_pFTPasswordLabel->Hide();
m_pCBPassword->Hide();
- m_pCBPassword->SetToggleHdl( LINK( this, PlaceEditDialog, ToggledPassHdl ) );
m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
m_pBTDelete->SetClickHdl ( LINK( this, PlaceEditDialog, DelHdl) );
@@ -149,19 +144,6 @@ std::shared_ptr<Place> PlaceEditDialog::GetPlace()
return std::make_shared<Place>(m_pEDServerName->GetText(), GetServerUrl(), true);
}
-IMPL_LINK( PlaceEditDialog, ToggledPassHdl, CheckBox*, pCheckBox )
-{
- bool bChecked = pCheckBox->IsEnabled() && pCheckBox->IsChecked();
-
- m_pEDPassword->Enable( bChecked );
- m_pFTPasswordLabel->Enable( bChecked );
-
- if ( !bChecked )
- m_pEDPassword->SetText( "" );
-
- return 0;
-}
-
void PlaceEditDialog::InitDetails( )
{
// Create CMIS controls for each server type
@@ -322,6 +304,7 @@ IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl )
it != m_aDetailsContainers.end( ); ++it )
{
( *it )->setUsername( OUString( m_pEDUsername->GetText() ) );
+ ( *it )->setPassword( m_pEDPassword->GetText() );
}
EditHdl(NULL);
@@ -350,12 +333,9 @@ IMPL_LINK_NOARG( PlaceEditDialog, SelectTypeHdl )
m_xCurrentDetails->show();
- bool bShowPass = m_xCurrentDetails->hasPassEntry();
- m_pCBPassword->Show( bShowPass );
- m_pEDPassword->Show( bShowPass );
- m_pFTPasswordLabel->Show( bShowPass );
-
- ToggledPassHdl( m_pCBPassword );
+ m_pCBPassword->Show( m_bShowPassword );
+ m_pEDPassword->Show( m_bShowPassword );
+ m_pFTPasswordLabel->Show( m_bShowPassword );
SetSizePixel(GetOptimalSize());
diff --git a/svtools/source/dialogs/ServerDetailsControls.cxx b/svtools/source/dialogs/ServerDetailsControls.cxx
index 96da591..5b5f083 100644
--- a/svtools/source/dialogs/ServerDetailsControls.cxx
+++ b/svtools/source/dialogs/ServerDetailsControls.cxx
@@ -382,6 +382,11 @@ void CmisDetailsContainer::setUsername( const OUString& rUsername )
m_sUsername = rUsername;
}
+void CmisDetailsContainer::setPassword( const OUString& rPass )
+{
+ m_sPassword = rPass;
+}
+
void CmisDetailsContainer::selectRepository( )
{
// Get the repo ID and call the Change listener
@@ -395,6 +400,10 @@ void CmisDetailsContainer::selectRepository( )
IMPL_LINK_NOARG_TYPED( CmisDetailsContainer, RefreshReposHdl, Button*, void )
{
+ Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ Reference< XPasswordContainer2 > xMasterPasswd = PasswordContainer::create( xContext );
+
+
OUString sBindingUrl = m_pEDHost->GetText().trim( );
OUString sEncodedUsername = "";
@@ -424,6 +433,25 @@ IMPL_LINK_NOARG_TYPED( CmisDetailsContainer, RefreshReposHdl, Button*, void )
sUrl = "vnd.libreoffice.cmis://" + sEncodedUsername + sEncodedBinding;
}
+ // temporary remember the password
+ try
+ {
+ if( xMasterPasswd->isPersistentStoringAllowed() && !sUrl.isEmpty() && !m_sUsername.isEmpty() && !m_sPassword.isEmpty() )
+ {
+ Reference< XInteractionHandler > xInteractionHandler(
+ InteractionHandler::createWithParent( xContext, 0 ),
+ UNO_QUERY );
+
+ Sequence< OUString > aPasswd( 1 );
+ aPasswd[0] = m_sPassword;
+
+ xMasterPasswd->add(
+ sUrl, m_sUsername, aPasswd, xInteractionHandler );
+ }
+ }
+ catch( const Exception& )
+ {}
+
// Get the Content
::ucbhelper::Content aCnt( sUrl, m_xCmdEnv, comphelper::getProcessComponentContext() );
Sequence< OUString > aProps( 1 );
@@ -456,6 +484,14 @@ IMPL_LINK_NOARG_TYPED( CmisDetailsContainer, RefreshReposHdl, Button*, void )
m_pLBRepository->SelectEntryPos( 0 );
selectRepository( );
}
+
+ // remove temporary password
+ try
+ {
+ xMasterPasswd->remove( sUrl, m_sUsername );
+ }
+ catch( const Exception& )
+ {}
}
IMPL_LINK_NOARG( CmisDetailsContainer, SelectRepoHdl )
diff --git a/svtools/uiconfig/ui/placeedit.ui b/svtools/uiconfig/ui/placeedit.ui
index 8f4e0e5..e3c0d3c 100644
--- a/svtools/uiconfig/ui/placeedit.ui
+++ b/svtools/uiconfig/ui/placeedit.ui
@@ -416,7 +416,7 @@
</object>
<packing>
<property name="left_attach">0</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
@@ -428,7 +428,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">5</property>
+ <property name="top_attach">4</property>
</packing>
</child>
<child>
@@ -442,7 +442,7 @@
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">4</property>
+ <property name="top_attach">5</property>
</packing>
</child>
<child>
commit c879fa8e5fd7779ca242fe368cbdd70084df049b
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Wed Aug 26 11:52:42 2015 +0200
Date modified column - no seconds
Change-Id: I443d0dd691d8030ab6a0bf5e4eeded5ad73750a5
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 1ce95e8..6f7b8c4 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1945,7 +1945,7 @@ void SvtFileView_Impl::CreateDisplayText_Impl()
const LocaleDataWrapper& rLocaleData = aSysLocale.GetLocaleData();
aValue += rLocaleData.getDate( (*aIt)->maModDate );
aValue += aDateSep;
- aValue += rLocaleData.getTime( (*aIt)->maModDate );
+ aValue += rLocaleData.getTime( (*aIt)->maModDate, false );
}
(*aIt)->maDisplayText = aValue;
commit 808f14886c08b7140ecff06c4d65d2db8286f0b1
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Aug 25 11:51:11 2015 +0200
Remove stored password if service is deleted
Change-Id: I500a8ee2874f7a9577e37fe25f5813e5821e9719
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 1b541ba..4d1cc15 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -822,6 +822,30 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
if( aBox->Execute() == RET_YES )
{
+ // remove password
+ try
+ {
+ if( m_xMasterPasswd->isPersistentStoringAllowed() )
+ {
+ OUString sUrl( m_aServices[nPos]->GetUrl() );
+
+ Reference< XInteractionHandler > xInteractionHandler(
+ InteractionHandler::createWithParent( m_xContext, 0 ),
+ UNO_QUERY );
+
+ UrlRecord aURLEntries = m_xMasterPasswd->find( sUrl, xInteractionHandler );
+
+ if( aURLEntries.Url == sUrl && aURLEntries.UserList.getLength() )
+ {
+ OUString sUserName = aURLEntries.UserList[0].UserName;
+
+ m_xMasterPasswd->removePersistent( sUrl, sUserName );
+ }
+ }
+ }
+ catch( const Exception& )
+ {}
+
m_aServices.erase( m_aServices.begin() + nPos );
m_pServices_lb->RemoveEntry( nSelected );
commit 6bf5bc98739c89537f7f3f1247f703943f907818
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Aug 24 12:51:21 2015 +0200
Remember window size
Change-Id: I4e9bd5e2516b66f47b560a388237b75059a7f142
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index b00f0db2..1b541ba 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -6,7 +6,6 @@
* 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/.
*/
-
#include "RemoteFilesDialog.hxx"
class FileViewContainer : public vcl::Window
@@ -172,6 +171,8 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
: SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" )
, m_xContext( comphelper::getProcessComponentContext() )
, m_xMasterPasswd( PasswordContainer::create( m_xContext ) )
+ , m_nWidth( 0 )
+ , m_nHeight( 0 )
, m_pCurrentAsyncAction( NULL )
, m_pFileNotifier( NULL )
, m_pSplitter( NULL )
@@ -297,9 +298,15 @@ void RemoteFilesDialog::dispose()
{
SvtViewOptions aDlgOpt( E_DIALOG, m_sIniKey );
aDlgOpt.SetWindowState( OStringToOUString( GetWindowState(), osl_getThreadTextEncoding() ) );
+
+ Size aSize( GetSizePixel() );
+
+ OUString sSize = OUString::number( aSize.Width() ) + "|";
+ sSize = sSize + OUString::number( aSize.Height() ) + "|";
+
OUString sUserData = m_pFileView->GetConfigString();
aDlgOpt.SetUserItem( OUString( "UserData" ),
- makeAny( sUserData ) );
+ makeAny( sSize + sUserData ) );
}
// save services
@@ -373,6 +380,17 @@ short RemoteFilesDialog::Execute()
return nRet;
}
+void RemoteFilesDialog::Show()
+{
+ SvtFileDialog_Base::Show();
+
+ if( m_nWidth > 0 && m_nHeight > 0 )
+ {
+ Size aSize( m_nWidth, m_nHeight );
+ SetSizePixel( aSize );
+ }
+}
+
OUString lcl_GetServiceType( ServicePtr pService )
{
INetProtocol aProtocol = pService->GetUrlObject().GetProtocol();
@@ -423,7 +441,21 @@ void RemoteFilesDialog::InitSize()
Any aUserData = aDlgOpt.GetUserItem( OUString( "UserData" ) );
OUString sCfgStr;
if( aUserData >>= sCfgStr )
- m_pFileView->SetConfigString( sCfgStr );
+ {
+ int nPos = sCfgStr.indexOf( "|" );
+ if( nPos != -1 )
+ {
+ nPos = sCfgStr.indexOf( "|", nPos + 1 );
+ if( nPos != -1 )
+ {
+ sal_Int32 nIdx = 0;
+ m_nWidth = sCfgStr.getToken( 0, '|', nIdx ).toInt32();
+ m_nHeight = sCfgStr.getToken( 0, '|', nIdx ).toInt32();
+
+ m_pFileView->SetConfigString( sCfgStr.copy( nPos + 1) );
+ }
+ }
+ }
}
}
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index ad1323c..65ce6c2 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -77,6 +77,7 @@ public:
virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
virtual short Execute() SAL_OVERRIDE;
+ virtual void Show();
// SvtFileDialog_Base
@@ -134,6 +135,8 @@ private:
bool m_bServiceChanged;
OUString m_sIniKey;
+ int m_nWidth;
+ int m_nHeight;
OUString m_sPath;
OUString m_sStdDir;
commit 470d6ab5d35045902c2d07815314df9b03b6326e
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Aug 21 12:10:07 2015 +0200
wider dialog
Change-Id: Ie90920c6fcd797b49cc16487cf4754822f771cf0
diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui
index 7859348..00e14da 100644
--- a/fpicker/uiconfig/ui/remotefilesdialog.ui
+++ b/fpicker/uiconfig/ui/remotefilesdialog.ui
@@ -186,7 +186,7 @@
</child>
<child>
<object class="GtkBox" id="container">
- <property name="width_request">500</property>
+ <property name="width_request">555</property>
<property name="height_request">200</property>
<property name="visible">True</property>
<property name="can_focus">False</property>
commit 16304077dcb1e7f50b25d147d59c4fa5c4b415ca
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Aug 21 12:04:27 2015 +0200
disable interface after service delete
Change-Id: Ia6706ba12154bab9b36da8582190db7ca6af1072
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index b29bd2b..b00f0db2 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -797,6 +797,9 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
m_pAddService_btn->SetPopupMenu( NULL );
m_bIsUpdated = true;
+
+ m_bIsConnected = false;
+ EnableControls();
}
}
}
commit 1d5f0716bf233bd468b8f271c2f45597dfc63bd2
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Aug 21 11:47:52 2015 +0200
focus for the file list after opening folder using a tree
Change-Id: I7cf75e3fb734b4bf0be9135c200130b8e86bf54f
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 1b2ec72..b29bd2b 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -975,7 +975,10 @@ IMPL_LINK ( RemoteFilesDialog, TreeSelectHdl, FolderTree *, pBox )
OUString* sURL = static_cast< OUString* >( pBox->GetHdlEntry()->GetUserData() );
if( sURL )
+ {
OpenURL( *sURL );
+ m_pFileView->GrabFocus();
+ }
return 1;
}
commit 1f557470fd003a67d7d497d48094c33aea5d7e57
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Aug 21 10:51:08 2015 +0200
Autocompletion should be case insensitive
Change-Id: I6f173590a94df6a04d5eee76653fa47ea8f71853
diff --git a/svtools/source/control/autocmpledit.cxx b/svtools/source/control/autocmpledit.cxx
index 14cf58b..8032b6e 100644
--- a/svtools/source/control/autocmpledit.cxx
+++ b/svtools/source/control/autocmpledit.cxx
@@ -70,7 +70,7 @@ bool AutocompleteEdit::Match( const OUString& rText )
for( std::vector< OUString >::size_type i = 0; i < m_aEntries.size(); ++i )
{
- if( m_aEntries[i].startsWith( rText ) )
+ if( m_aEntries[i].startsWithIgnoreAsciiCase( rText ) )
{
m_aMatching.push_back( m_aEntries[i] );
bRet = true;
commit d6ebf7f5ee4aa0684a9f219dc8a5831013b7feb3
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Aug 21 10:42:37 2015 +0200
clear file name field while changing dir
Change-Id: I46e9d9e7b56c09c65808fe231e5ba4eeddf90ad2
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index ab6159a..1b2ec72 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -541,6 +541,9 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
// -1 timeout - sync
m_pCurrentAsyncAction->execute( sURL, sFilter, -1, -1, GetBlackList() );
+
+ if( m_eMode != REMOTEDLG_MODE_SAVE )
+ m_pName_ed->SetText( "" );
}
else
{
commit 682c74f0dbb9bea3178e340c3f8cde69272829ad
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Aug 21 10:29:49 2015 +0200
Breadcrumb: mouseover effect
Change-Id: If38d799e0fa7506416082fb15f37b12267a9b5df
diff --git a/include/svtools/breadcrumb.hxx b/include/svtools/breadcrumb.hxx
index d749f27..d06e097 100644
--- a/include/svtools/breadcrumb.hxx
+++ b/include/svtools/breadcrumb.hxx
@@ -27,10 +27,12 @@ enum SvtBreadcrumbMode
ALL_VISITED = 1
};
+class CustomLink;
+
class SVT_DLLPUBLIC Breadcrumb : public VclHBox
{
private:
- std::vector< VclPtr< FixedHyperlink > > m_aLinks;
+ std::vector< VclPtr< CustomLink > > m_aLinks;
std::vector< VclPtr< FixedText > > m_aSeparators;
OUString m_sRootName;
diff --git a/svtools/source/control/breadcrumb.cxx b/svtools/source/control/breadcrumb.cxx
index 306d33f..8ccbd81 100644
--- a/svtools/source/control/breadcrumb.cxx
+++ b/svtools/source/control/breadcrumb.cxx
@@ -9,6 +9,38 @@
#include <svtools/breadcrumb.hxx>
+class CustomLink : public FixedHyperlink
+{
+public:
+ CustomLink( vcl::Window* pParent, WinBits nWinStyle )
+ : FixedHyperlink( pParent, nWinStyle )
+ {
+ vcl::Font aFont = GetControlFont( );
+ aFont.SetUnderline( UNDERLINE_NONE );
+ SetControlFont( aFont );
+ }
+
+protected:
+ virtual void MouseMove( const MouseEvent& rMEvt ) SAL_OVERRIDE
+ {
+ // changes the style if the control is enabled
+ if ( !rMEvt.IsLeaveWindow() && IsEnabled() )
+ {
+ vcl::Font aFont = GetControlFont( );
+ aFont.SetUnderline( UNDERLINE_SINGLE );
+ SetControlFont( aFont );
+ }
+ else
+ {
+ vcl::Font aFont = GetControlFont( );
+ aFont.SetUnderline( UNDERLINE_NONE );
+ SetControlFont( aFont );
+ }
+
+ FixedHyperlink::MouseMove( rMEvt );
+ }
+};
+
Breadcrumb::Breadcrumb( vcl::Window* pParent, WinBits nWinStyle ) : VclHBox( pParent, nWinStyle )
{
m_eMode = SvtBreadcrumbMode::ONLY_CURRENT_PATH;
@@ -112,6 +144,7 @@ void Breadcrumb::SetURL( const OUString& rURL )
m_aLinks[i]->SetURL( sRootPath + OUString( sPath.getStr(), nEnd ) );
m_aLinks[i]->Hide();
m_aLinks[i]->Enable( true );
+
m_aSeparators[i]->Hide();
nPos = nEnd;
@@ -208,7 +241,7 @@ void Breadcrumb::SetMode( SvtBreadcrumbMode eMode )
void Breadcrumb::appendField()
{
- m_aLinks.push_back( VclPtr< FixedHyperlink >::Create( this, WB_TABSTOP ) );
+ m_aLinks.push_back( VclPtr< CustomLink >::Create( this, WB_TABSTOP ) );
m_aLinks[m_aLinks.size() - 1]->Hide();
m_aLinks[m_aLinks.size() - 1]->SetClickHdl( LINK( this, Breadcrumb, ClickLinkHdl ) );
commit 495285ee3a00d6c14e3d5a8df2e5715fb7edb233
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Aug 18 10:42:41 2015 +0200
RemoteFilesDialog: file name autocompletion
Change-Id: Iab051ccaf075cc91acce67e01863e8d7ecac820c
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index e87f6cb..ab6159a 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -183,7 +183,6 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
get( m_pAddService_btn, "add_service_btn" );
get( m_pServices_lb, "services_lb" );
get( m_pFilter_lb, "filter_lb" );
- get( m_pName_ed, "name_ed" );
get( m_pNewFolder, "new_folder" );
m_eMode = ( nBits & WB_SAVEAS ) ? REMOTEDLG_MODE_SAVE : REMOTEDLG_MODE_OPEN;
@@ -194,6 +193,9 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
m_bServiceChanged = false;
m_nCurrentFilter = LISTBOX_ENTRY_NOTFOUND;
+ m_pName_ed = VclPtr< AutocompleteEdit >::Create( get< vcl::Window >( "filename_container" ) );
+ m_pName_ed->Show();
+
m_pFilter_lb->Enable( false );
m_pName_ed->Enable( false );
@@ -1252,8 +1254,31 @@ void RemoteFilesDialog::UpdateControls( const OUString& rURL )
m_pTreeView->SetSelectHdl( Link<>() );
// read cached data for this url and fill the tree
- const ::std::vector< std::pair< OUString, OUString > >& rFolders = m_pFileView->GetSubFolders();
- m_pTreeView->FillTreeEntry( rURL, rFolders );
+ const ::std::vector< SvtContentEntry >& rFolders = m_pFileView->GetContent();
+ ::std::vector< std::pair< OUString, OUString > > aFolders;
+
+ m_pName_ed->ClearEntries();
+
+ for( ::std::vector< SvtContentEntry >::size_type i = 0; i < rFolders.size(); i++ )
+ {
+ int nTitleStart = rFolders[i].maURL.lastIndexOf( '/' );
+ if( nTitleStart != -1 )
+ {
+ OUString sTitle( INetURLObject::decode(
+ rFolders[i].maURL.copy( nTitleStart + 1 ),
+ INetURLObject::DECODE_WITH_CHARSET ) );
+
+ if( rFolders[i].mbIsFolder )
+ {
+ aFolders.push_back( std::pair< OUString, OUString > ( sTitle, rFolders[i].maURL ) );
+ }
+
+ // add entries to the autocompletion mechanism
+ m_pName_ed->AddEntry( sTitle );
+ }
+ }
+
+ m_pTreeView->FillTreeEntry( rURL, aFolders );
m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index 4fef385..ad1323c 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -12,6 +12,7 @@
#include <comphelper/docpasswordrequest.hxx>
+#include <svtools/autocmpledit.hxx>
#include <svtools/foldertree.hxx>
#include <svtools/place.hxx>
#include <svtools/PlaceEditDialog.hxx>
@@ -156,7 +157,7 @@ private:
VclPtr< SvtFileView > m_pFileView;
VclPtr< FileViewContainer > m_pContainer;
VclPtr< ListBox > m_pFilter_lb;
- VclPtr< Edit > m_pName_ed;
+ VclPtr< AutocompleteEdit > m_pName_ed;
PopupMenu* m_pAddMenu;
ImageList m_aImages;
diff --git a/fpicker/uiconfig/ui/remotefilesdialog.ui b/fpicker/uiconfig/ui/remotefilesdialog.ui
index e0699a5..7859348 100644
--- a/fpicker/uiconfig/ui/remotefilesdialog.ui
+++ b/fpicker/uiconfig/ui/remotefilesdialog.ui
@@ -234,26 +234,29 @@
</packing>
</child>
<child>
- <object class="GtkEntry" id="name_ed">
+ <object class="GtkComboBox" id="filter_lb">
+ <property name="width_request">200</property>
<property name="visible">True</property>
- <property name="can_focus">True</property>
+ <property name="can_focus">False</property>
<property name="hexpand">True</property>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">1</property>
+ <property name="top_attach">0</property>
</packing>
</child>
<child>
- <object class="GtkComboBox" id="filter_lb">
- <property name="width_request">200</property>
+ <object class="GtkBox" id="filename_container">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <property name="hexpand">True</property>
+ <property name="orientation">vertical</property>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
<property name="left_attach">1</property>
- <property name="top_attach">0</property>
+ <property name="top_attach">1</property>
</packing>
</child>
</object>
diff --git a/include/svtools/fileview.hxx b/include/svtools/fileview.hxx
index db6d491..afc7dab 100644
--- a/include/svtools/fileview.hxx
+++ b/include/svtools/fileview.hxx
@@ -36,6 +36,7 @@ class ViewTabListBox_Impl;
class SvtFileView_Impl;
class SvTreeListEntry;
class HeaderBar;
+struct SvtContentEntry;
/// the result of an action in the FileView
enum FileViewResult
@@ -173,7 +174,7 @@ public:
void EndInplaceEditing( bool _bCancel );
- ::std::vector< std::pair< OUString, OUString > > GetSubFolders();
+ ::std::vector< SvtContentEntry > GetContent();
protected:
virtual void StateChanged( StateChangedType nStateChange ) SAL_OVERRIDE;
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 81e7f5e..1ce95e8 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -1393,17 +1393,14 @@ OUString SvtFileView::GetConfigString() const
return sRet;
}
-::std::vector< std::pair< OUString, OUString > > SvtFileView::GetSubFolders()
+::std::vector< SvtContentEntry > SvtFileView::GetContent()
{
- ::std::vector< std::pair< OUString, OUString > > aContent;
+ ::std::vector< SvtContentEntry > aContent;
for( ::std::vector< SortingData_Impl* >::size_type i = 0; i < mpImp->maContent.size(); i++ )
{
- if( mpImp->maContent[i]->mbIsFolder )
- {
- std::pair< OUString, OUString > aEntry( mpImp->maContent[i]->GetTitle(), mpImp->maContent[i]->maTargetURL );
- aContent.push_back( aEntry );
- }
+ SvtContentEntry aEntry( mpImp->maContent[i]->maTargetURL, mpImp->maContent[i]->mbIsFolder );
+ aContent.push_back( aEntry );
}
return aContent;
commit 5f2f8343927a447b5005ba7f49fb84603b92ea6c
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Aug 17 23:01:53 2015 +0200
Edit control with autocompletion
Change-Id: Id3aefbffa6b36b475ca78856c9e103cef433f88c
diff --git a/include/svtools/autocmpledit.hxx b/include/svtools/autocmpledit.hxx
new file mode 100644
index 0000000..49407d44
--- /dev/null
+++ b/include/svtools/autocmpledit.hxx
@@ -0,0 +1,39 @@
+/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
+/*
+ * This file is part of the LibreOffice project.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+#ifndef INCLUDED_SVTOOLS_AUTOCMPLEDIT_HXX
+#define INCLUDED_SVTOOLS_AUTOCMPLEDIT_HXX
+
+#include <svtools/svtdllapi.h>
+
+#include <vcl/edit.hxx>
+
+#include <vector>
+
+class SVT_DLLPUBLIC AutocompleteEdit : public Edit
+{
+private:
+ std::vector< OUString > m_aEntries;
+ std::vector< OUString > m_aMatching;
+ std::vector< OUString >::size_type m_nCurrent;
+
+ void AutoCompleteHandler( Edit* );
+ bool Match( const OUString& rText );
+ bool PreNotify( NotifyEvent& rNEvt );
+
+public:
+ AutocompleteEdit( vcl::Window* pParent );
+
+ void AddEntry( const OUString& rEntry );
+ void ClearEntries();
+};
+
+#endif
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/svtools/Library_svt.mk b/svtools/Library_svt.mk
index f6c834d..b877d46 100644
--- a/svtools/Library_svt.mk
+++ b/svtools/Library_svt.mk
@@ -107,6 +107,7 @@ $(eval $(call gb_Library_add_exception_objects,svt,\
svtools/source/contnr/viewdataentry \
svtools/source/control/accessibleruler \
svtools/source/control/asynclink \
+ svtools/source/control/autocmpledit \
svtools/source/control/breadcrumb \
svtools/source/control/calendar \
svtools/source/control/collatorres \
diff --git a/svtools/source/control/autocmpledit.cxx b/svtools/source/control/autocmpledit.cxx
new file mode 100644
index 0000000..14cf58b
--- /dev/null
+++ b/svtools/source/control/autocmpledit.cxx
@@ -0,0 +1,110 @@
+/* -*- 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/.
+ */
+
+#include <svtools/autocmpledit.hxx>
+#include <vcl/svapp.hxx>
+
+AutocompleteEdit::AutocompleteEdit( vcl::Window* pParent )
+ : Edit( pParent )
+ , m_nCurrent( 0 )
+{
+ SignalConnectAutocomplete( nullptr,
+ [this] ( Edit *const pEdit ) { this->AutoCompleteHandler( pEdit ); } );
+}
+
+void AutocompleteEdit::AddEntry( const OUString& rEntry )
+{
+ m_aEntries.push_back( rEntry );
+}
+
+void AutocompleteEdit::ClearEntries()
+{
+ m_aEntries.clear();
+ m_aMatching.clear();
+}
+
+void AutocompleteEdit::AutoCompleteHandler( Edit* )
+{
+ if( GetAutocompleteAction() != AUTOCOMPLETE_KEYINPUT )
+ return;
+
+ if( Application::AnyInput( VclInputFlags::KEYBOARD ) )
+ return;
+
+ OUString aCurText = GetText();
+ Selection aSelection( GetSelection() );
+
+ if( aSelection.Max() != aCurText.getLength() )
+ return;
+
+ sal_uInt16 nLen = ( sal_uInt16 )aSelection.Min();
+ aCurText = aCurText.copy( 0, nLen );
+ if( !aCurText.isEmpty() )
+ {
+ if( m_aEntries.size() )
+ {
+ if( Match( aCurText ) )
+ {
+ m_nCurrent = 0;
+ SetText( m_aMatching[0] );
+ sal_uInt16 nNewLen = m_aMatching[0].getLength();
+
+ Selection aSel( nLen, nNewLen );
+ SetSelection( aSel );
+ }
+ }
+ }
+}
+
+bool AutocompleteEdit::Match( const OUString& rText )
+{
+ bool bRet = false;
+
+ m_aMatching.clear();
+
+ for( std::vector< OUString >::size_type i = 0; i < m_aEntries.size(); ++i )
+ {
+ if( m_aEntries[i].startsWith( rText ) )
+ {
+ m_aMatching.push_back( m_aEntries[i] );
+ bRet = true;
+ }
+ }
+
+ return bRet;
+}
+
+bool AutocompleteEdit::PreNotify( NotifyEvent& rNEvt )
+{
+ if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
+ {
+ const KeyEvent& rEvent = *rNEvt.GetKeyEvent();
+ const vcl::KeyCode& rKey = rEvent.GetKeyCode();
+ vcl::KeyCode aCode( rKey.GetCode() );
+
+ if( ( aCode == KEY_UP || aCode == KEY_DOWN ) && !rKey.IsMod2() )
+ {
+ Selection aSelection( GetSelection() );
+ sal_uInt16 nLen = ( sal_uInt16 )aSelection.Min();
+
+ if( m_aMatching.size() &&
+ ( ( aCode == KEY_DOWN && m_nCurrent + 1 < m_aMatching.size() )
+ || ( aCode == KEY_UP && m_nCurrent > 0 ) ) )
+ {
+ SetText( m_aMatching[ aCode == KEY_DOWN ? ++m_nCurrent : --m_nCurrent ] );
+ SetSelection( Selection( nLen, GetText().getLength() ) );
+ return true;
+ }
+ }
+ }
+
+ return Edit::PreNotify( rNEvt );
+}
+
+/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit fb82388b3c3bc7b2e1e4c2b51b9c3165c5ac14da
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Aug 17 17:54:13 2015 +0200
don't show type column in the RemoteFilesDialog
Change-Id: I103bf8dabe3a513da65c6d21b9c9199aefb0bebe
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index c0f3a49..e87f6cb 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -232,7 +232,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
m_pFileView = VclPtr< SvtFileView >::Create( m_pContainer, WB_BORDER | WB_TABSTOP,
REMOTEDLG_TYPE_PATHDLG == m_eType,
- m_bMultiselection );
+ m_bMultiselection, false );
m_pFileView->Show();
m_pFileView->EnableAutoResize();
diff --git a/include/svtools/fileview.hxx b/include/svtools/fileview.hxx
index 0621dd77..db6d491 100644
--- a/include/svtools/fileview.hxx
+++ b/include/svtools/fileview.hxx
@@ -74,7 +74,7 @@ protected:
virtual void GetFocus() SAL_OVERRIDE;
public:
- SvtFileView( vcl::Window* pParent, WinBits nBits, bool bOnlyFolder, bool bMultiSelection );
+ SvtFileView( vcl::Window* pParent, WinBits nBits, bool bOnlyFolder, bool bMultiSelection, bool bShowType = true );
virtual ~SvtFileView();
virtual void dispose() SAL_OVERRIDE;
diff --git a/svtools/source/contnr/fileview.cxx b/svtools/source/contnr/fileview.cxx
index 3c3f6d9..81e7f5e 100644
--- a/svtools/source/contnr/fileview.cxx
+++ b/svtools/source/contnr/fileview.cxx
@@ -101,6 +101,7 @@ enum class FileViewFlags
NONE = 0x00,
ONLYFOLDER = 0x01,
MULTISELECTION = 0x02,
+ SHOW_TYPE = 0x04,
SHOW_ONLYTITLE = 0x10,
SHOW_NONE = 0x20,
};
@@ -531,7 +532,10 @@ ViewTabListBox_Impl::ViewTabListBox_Impl( vcl::Window* pParentWin,
SetTabJustify(2, AdjustRight); // column "Size"
mpHeaderBar->InsertItem(COLUMN_TITLE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_TITLE), 180, nBits | HeaderBarItemBits::UPARROW);
- mpHeaderBar->InsertItem(COLUMN_TYPE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_TYPE), 140, nBits);
+ if (nFlags & FileViewFlags::SHOW_TYPE)
+ {
+ mpHeaderBar->InsertItem(COLUMN_TYPE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_TYPE), 140, nBits);
+ }
mpHeaderBar->InsertItem(COLUMN_SIZE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_SIZE), 80, nBits);
mpHeaderBar->InsertItem(COLUMN_DATE, SVT_RESSTR(STR_SVT_FILEVIEW_COLUMN_DATE), 500, nBits);
}
@@ -998,7 +1002,7 @@ bool ViewTabListBox_Impl::Kill( const OUString& rContent )
// class SvtFileView -----------------------------------------------------
SvtFileView::SvtFileView( vcl::Window* pParent, WinBits nBits,
- bool bOnlyFolder, bool bMultiSelection ) :
+ bool bOnlyFolder, bool bMultiSelection, bool bShowType ) :
Control( pParent, nBits )
{
@@ -1007,6 +1011,8 @@ SvtFileView::SvtFileView( vcl::Window* pParent, WinBits nBits,
nFlags |= FileViewFlags::ONLYFOLDER;
if ( bMultiSelection )
nFlags |= FileViewFlags::MULTISELECTION;
+ if ( bShowType )
+ nFlags |= FileViewFlags::SHOW_TYPE;
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xInteractionHandler(
commit 9a6cdce37e601b1406c71fef16ad9b315045c9da
Author: David Ostrovsky <david at ostrovsky.org>
Date: Thu Aug 27 10:18:19 2015 +0200
Bump boost to 1.59 final release
Change-Id: Id71e098dd2356043d2b5fee0736ebfedb5c8c1cd
Reviewed-on: https://gerrit.libreoffice.org/18050
Reviewed-by: David Ostrovsky <david at ostrovsky.org>
Tested-by: David Ostrovsky <david at ostrovsky.org>
diff --git a/download.lst b/download.lst
index 8b1d7d2..9382aef 100644
--- a/download.lst
+++ b/download.lst
@@ -15,7 +15,8 @@ export APR_MD5SUM := eff9d741b0999a9bbab96862dd2a2a3d
export APR_TARBALL := apr-1.4.8.tar.gz
export APR_UTIL_MD5SUM := 71a11d037240b292f824ba1eb537b4e3
export APR_UTIL_TARBALL := apr-util-1.5.3.tar.gz
-export BOOST_TARBALL := 9804305aae0c9de9f8cfc02e3de75167-boost_1_59_0_b1_rc1.tar.bz2
+export BOOST_MD5SUM := 6aa9a5c6a4ca1016edd0ed1178e3cb87
+export BOOST_TARBALL := boost_1_59_0.tar.bz2
export BSH_TARBALL := ec1941a74d3ef513c4ce57a9092b74e1-bsh-2.0b5-src.zip
export BZIP2_TARBALL := 00b516f4704d4a7cb50a1d97e6e8e15b-bzip2-1.0.6.tar.gz
export CAIRO_TARBALL := f101a9e88b783337b20b2e26dfd26d5f-cairo-1.10.2.tar.gz
diff --git a/external/boost/UnpackedTarball_boost.mk b/external/boost/UnpackedTarball_boost.mk
index 732b564..54899c4 100644
--- a/external/boost/UnpackedTarball_boost.mk
+++ b/external/boost/UnpackedTarball_boost.mk
@@ -70,8 +70,6 @@ boost_patches += rtti.patch.0
# https://svn.boost.org/trac/boost/ticket/11505
boost_patches += boost_1_59_0.mpl.config.wundef.patch
-# https://svn.boost.org/trac/boost/ticket/11503
-boost_patches += boost_1_59_0.type_index.wshadow.patch
# https://svn.boost.org/trac/boost/ticket/11502
boost_patches += boost_1_59_0.property_tree.wtype-limits.patch
# https://svn.boost.org/trac/boost/ticket/11507
@@ -82,19 +80,12 @@ boost_patches += boost_1_59_0.iostreams.wshadow.patch
boost_patches += boost_1_59_0.iostreams.wunused.patch
# https://svn.boost.org/trac/boost/ticket/11506
boost_patches += boost_1_59_0.rational.wshadow.patch
-# https://svn.boost.org/trac/boost/ticket/11510
-boost_patches += boost_1_59_0.unique_ptr.wshadow.patch
-# fixed upstream
-# https://svn.boost.org/trac/boost/ticket/11500
-boost_patches += boost_1_59_0.move.Bool-type-collision.4f9c2b62fbdcf5995ecf50a2ecf2494048a6696d.patch
# https://svn.boost.org/trac/boost/ticket/11511
boost_patches += boost_1_59_0.multi_array.wshadow.patch
-# https://svn.boost.org/trac/boost/ticket/11512
-boost_patches += boost_1_59_0.signal2.wshadow.patch
# https://svn.boost.org/trac/boost/ticket/11501
boost_patches += boost_1_59_0.property_tree.wreturn-type.patch
-# fixed upstream by bdcd06c4cc1971d763e528b8cb1d0f16fcc5ecf4
-boost_patches += boost.concept_check.Wunused-local-typedefs.warnings.patch.1
+# https://svn.boost.org/trac/boost/ticket/11597
+boost_patches += boost_1_59_0.system.no.deprecated.patch
$(eval $(call gb_UnpackedTarball_UnpackedTarball,boost))
diff --git a/external/boost/boost.concept_check.Wunused-local-typedefs.warnings.patch.1 b/external/boost/boost.concept_check.Wunused-local-typedefs.warnings.patch.1
deleted file mode 100644
index c85fc7e..0000000
--- a/external/boost/boost.concept_check.Wunused-local-typedefs.warnings.patch.1
+++ /dev/null
@@ -1,13 +0,0 @@
-Fixed differently upstream by commit bdcd06c4cc1971d763e528b8cb1d0f16fcc5ecf4
-
---- boost/boost/concept/detail/general.hpp.orig 2015-07-31 14:03:08.184447736 +0200
-+++ boost/boost/concept/detail/general.hpp 2015-07-31 14:03:10.048447591 +0200
-@@ -67,7 +67,7 @@
-
- // Version check from https://svn.boost.org/trac/boost/changeset/82886
- // (boost/static_assert.hpp)
--#if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
-+#if defined(__GNUC__) && (((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) || defined(__clang__))
- #define BOOST_CONCEPT_UNUSED_TYPEDEF __attribute__((unused))
- #else
- #define BOOST_CONCEPT_UNUSED_TYPEDEF /**/
diff --git a/external/boost/boost.preprocessor.Wundef.warnings.patch b/external/boost/boost.preprocessor.Wundef.warnings.patch
index 1dc9888..26d2845 100644
--- a/external/boost/boost.preprocessor.Wundef.warnings.patch
+++ b/external/boost/boost.preprocessor.Wundef.warnings.patch
@@ -1,15 +1,3 @@
-diff -ur boost.orig/boost/preprocessor/config/config.hpp boost/boost/preprocessor/config/config.hpp
---- foo/misc/boost.orig/boost/preprocessor/config/config.hpp 2015-03-28 09:19:20.000000000 +0100
-+++ foo/misc/boost/boost/preprocessor/config/config.hpp 2015-07-16 07:47:54.969987660 +0200
-@@ -79,7 +79,7 @@
- # define BOOST_PP_VARIADICS 1
- # define BOOST_PP_VARIADICS_MSVC 1
- # /* Wave (C/C++), GCC (C++) */
--# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && __GXX_EXPERIMENTAL_CXX0X__
-+# elif defined __WAVE__ && __WAVE_HAS_VARIADICS__ || defined __GNUC__ && defined(__GXX_EXPERIMENTAL_CXX0X__) && __GXX_EXPERIMENTAL_CXX0X__
- # define BOOST_PP_VARIADICS 1
- # /* EDG-based (C/C++), GCC (C), and unknown (C/C++) */
- # elif !defined __cplusplus && __STDC_VERSION__ >= 199901L || __cplusplus >= 201103L
diff -ur boost.orig/boost/preprocessor/tuple/detail/is_single_return.hpp boost/boost/preprocessor/tuple/detail/is_single_return.hpp
--- foo/misc/boost.orig/boost/preprocessor/tuple/detail/is_single_return.hpp 2015-03-28 09:19:20.000000000 +0100
+++ foo/misc/boost/boost/preprocessor/tuple/detail/is_single_return.hpp 2015-07-16 07:57:29.881981198 +0200
diff --git a/external/boost/boost.spirit.Wunused-local-typedefs.warnings.patch b/external/boost/boost.spirit.Wunused-local-typedefs.warnings.patch
index 5551080..78a4cb0 100644
--- a/external/boost/boost.spirit.Wunused-local-typedefs.warnings.patch
+++ b/external/boost/boost.spirit.Wunused-local-typedefs.warnings.patch
@@ -15,17 +15,6 @@ diff -ru boost.orig/boost/spirit/home/classic/core/non_terminal/impl/grammar.ipp
for (iterator_t i = helpers.rbegin(); i != helpers.rend(); ++i)
(*i)->undefine(self);
# else
-diff -ru boost.orig/boost/spirit/home/classic/core/primitives/primitives.hpp boost/boost/spirit/home/classic/core/primitives/primitives.hpp
---- foo/misc/boost.orig/boost/spirit/home/classic/core/primitives/primitives.hpp 2015-07-18 21:46:45.775978491 +0200
-+++ foo/misc/boost/boost/spirit/home/classic/core/primitives/primitives.hpp 2015-07-18 22:03:35.695967140 +0200
-@@ -47,7 +47,6 @@
- typename parser_result<self_t, ScannerT>::type
- parse(ScannerT const& scan) const
- {
-- typedef typename parser_result<self_t, ScannerT>::type result_t;
- typedef typename ScannerT::value_t value_t;
- typedef typename ScannerT::iterator_t iterator_t;
-
diff -ru boost.orig/boost/spirit/home/classic/error_handling/exceptions.hpp boost/boost/spirit/home/classic/error_handling/exceptions.hpp
--- foo/misc/boost.orig/boost/spirit/home/classic/error_handling/exceptions.hpp 2015-07-18 21:46:45.768978491 +0200
+++ foo/misc/boost/boost/spirit/home/classic/error_handling/exceptions.hpp 2015-07-18 22:00:33.396969189 +0200
diff --git a/external/boost/boost_1_44_0-unused-parameters.patch b/external/boost/boost_1_44_0-unused-parameters.patch
index d3341bf..174513b 100644
--- a/external/boost/boost_1_44_0-unused-parameters.patch
+++ b/external/boost/boost_1_44_0-unused-parameters.patch
@@ -671,44 +671,44 @@ diff -ru boost.orig/boost/foreach.hpp boost/boost/foreach.hpp
typedef BOOST_DEDUCED_TYPENAME type2type<T, C>::type type;
typedef BOOST_DEDUCED_TYPENAME foreach_reverse_iterator<T, C>::type iterator;
diff -ru boost.orig/boost/function/function_template.hpp boost/boost/function/function_template.hpp
---- foo/misc/boost.orig/boost/function/function_template.hpp 2015-01-18 18:32:44.000000000 +0100
-+++ foo/misc/boost/boost/function/function_template.hpp 2015-07-16 22:03:43.157979869 +0200
+--- foo/misc/boost.orig/boost/function/function_template.hpp 2015-07-22 19:33:01.000000000 +0200
++++ foo/misc/boost/boost/function/function_template.hpp 2015-08-27 10:14:49.023960640 +0200
@@ -717,7 +717,7 @@
template<typename Functor>
BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f
#ifndef BOOST_NO_SFINAE
-- ,typename enable_if_c<
-+ ,__attribute__ ((unused)) typename enable_if_c<
- (boost::type_traits::ice_not<
- (is_integral<Functor>::value)>::value),
+- ,typename boost::enable_if_c<
++ ,__attribute__ ((unused)) typename boost::enable_if_c<
+ !(is_integral<Functor>::value),
int>::type = 0
-@@ -730,7 +730,7 @@
+ #endif // BOOST_NO_SFINAE
+@@ -729,7 +729,7 @@
template<typename Functor,typename Allocator>
BOOST_FUNCTION_FUNCTION(Functor BOOST_FUNCTION_TARGET_FIX(const &) f, Allocator a
#ifndef BOOST_NO_SFINAE
-- ,typename enable_if_c<
-+ ,__attribute__ ((unused)) typename enable_if_c<
- (boost::type_traits::ice_not<
- (is_integral<Functor>::value)>::value),
+- ,typename boost::enable_if_c<
++ ,__attribute__ ((unused)) typename boost::enable_if_c<
+ !(is_integral<Functor>::value),
int>::type = 0
-@@ -1068,7 +1068,7 @@
+ #endif // BOOST_NO_SFINAE
+@@ -1065,7 +1065,7 @@
template<typename Functor>
function(Functor f
#ifndef BOOST_NO_SFINAE
-- ,typename enable_if_c<
-+ ,__attribute__ ((unused)) typename enable_if_c<
- (boost::type_traits::ice_not<
- (is_integral<Functor>::value)>::value),
+- ,typename boost::enable_if_c<
++ ,__attribute__ ((unused)) typename boost::enable_if_c<
+ !(is_integral<Functor>::value),
int>::type = 0
-@@ -1080,7 +1080,7 @@
+ #endif
+@@ -1076,7 +1076,7 @@
template<typename Functor,typename Allocator>
function(Functor f, Allocator a
#ifndef BOOST_NO_SFINAE
-- ,typename enable_if_c<
-+ ,__attribute__ ((unused)) typename enable_if_c<
- (boost::type_traits::ice_not<
- (is_integral<Functor>::value)>::value),
+- ,typename boost::enable_if_c<
++ ,__attribute__ ((unused)) typename boost::enable_if_c<
+ !(is_integral<Functor>::value),
int>::type = 0
+ #endif
diff -ru boost.orig/boost/iterator/reverse_iterator.hpp boost/boost/iterator/reverse_iterator.hpp
--- foo/misc/boost.orig/boost/iterator/reverse_iterator.hpp 2014-09-06 19:18:28.000000000 +0200
+++ foo/misc/boost/boost/iterator/reverse_iterator.hpp 2015-07-16 22:04:18.012979478 +0200
diff --git a/external/boost/boost_1_59_0.move.Bool-type-collision.4f9c2b62fbdcf5995ecf50a2ecf2494048a6696d.patch b/external/boost/boost_1_59_0.move.Bool-type-collision.4f9c2b62fbdcf5995ecf50a2ecf2494048a6696d.patch
deleted file mode 100644
index 4974127..0000000
--- a/external/boost/boost_1_59_0.move.Bool-type-collision.4f9c2b62fbdcf5995ecf50a2ecf2494048a6696d.patch
+++ /dev/null
@@ -1,44 +0,0 @@
-This patch is needed to avoid type collision between Bool type
-defined in XLib with non used non class template parameter
-name introduced in this commit in move library:
-
- 4f9c2b62fbdcf5995ecf50a2ecf2494048a6696d.
-
-The obscure error message was issued on both Clang 3.8 and GCC 4.8.1:
-
- In file included from /home/davido/projects/libo/include/prex.h:32:0,
- from /home/davido/projects/libo/include/vcl/opengl/OpenGLHelper.hxx:20,
- from /home/davido/projects/libo/vcl/source/opengl/OpenGLHelper.cxx:11:
-/home/davido/projects/libo/workdir/UnpackedTarball/boost/boost/move/detail/meta_utils.hpp:350:15: error: two or more data types in declaration of ‘parameter’
- template<bool Bool, class B = true_, class C = true_, class D = true_>
- ^
-In file included from /home/davido/projects/libo/workdir/UnpackedTarball/boost/boost/move/utility_core.hpp:30:0,
- from /home/davido/projects/libo/workdir/UnpackedTarball/boost/boost/move/utility.hpp:28,
- from /home/davido/projects/libo/workdir/UnpackedTarball/boost/boost/optional/optional.hpp:50,
- from /home/davido/projects/libo/workdir/UnpackedTarball/boost/boost/optional.hpp:15,
- from /home/davido/projects/libo/workdir/CustomTarget/officecfg/registry/officecfg/Office/Common.hxx:7,
- from /home/davido/projects/libo/vcl/source/opengl/OpenGLHelper.cxx:22:
-/home/davido/projects/libo/workdir/UnpackedTarball/boost/boost/move/detail/meta_utils.hpp:352:29: note: invalid template non-type parameter
- : and_impl<B::value, C, D>
-
-diff -ru boost.orig/boost/move/detail/meta_utils.hpp boost/boost/move/detail/meta_utils.hpp
---- foo/misc/boost.orig/boost/move/detail/meta_utils.hpp 2015-07-19 14:16:13.764836630 +0200
-+++ foo/misc/boost/boost/move/detail/meta_utils.hpp 2015-07-19 21:04:15.960985030 +0200
-@@ -347,7 +347,7 @@
- // and_
- //
- //////////////////////////////////////////////////////////////////////////////
--template<bool Bool, class B = true_, class C = true_, class D = true_>
-+template<bool, class B = true_, class C = true_, class D = true_>
- struct and_impl
- : and_impl<B::value, C, D>
- {};
-@@ -374,7 +374,7 @@
- // or_
- //
- //////////////////////////////////////////////////////////////////////////////
--template<bool Bool, class B = false_, class C = false_, class D = false_>
-+template<bool, class B = false_, class C = false_, class D = false_>
- struct or_impl
- : or_impl<B::value, C, D>
- {};
diff --git a/external/boost/boost_1_59_0.signal2.wshadow.patch b/external/boost/boost_1_59_0.signal2.wshadow.patch
deleted file mode 100644
index 1c13e94..0000000
--- a/external/boost/boost_1_59_0.signal2.wshadow.patch
+++ /dev/null
@@ -1,63 +0,0 @@
-diff -ru boost.orig/boost/signals2/connection.hpp boost/boost/signals2/connection.hpp
---- foo/misc/boost.orig/boost/signals2/connection.hpp 2015-07-09 20:06:58.000000000 +0200
-+++ foo/misc/boost/boost/signals2/connection.hpp 2015-07-19 21:54:54.491994554 +0200
-@@ -68,12 +68,12 @@
- nolock_disconnect(local_lock);
- }
- template<typename Mutex>
-- void nolock_disconnect(garbage_collecting_lock<Mutex> &lock) const
-+ void nolock_disconnect(garbage_collecting_lock<Mutex> &lock_) const
- {
- if(_connected)
- {
- _connected = false;
-- dec_slot_refcount(lock);
-+ dec_slot_refcount(lock_);
- }
- }
- virtual bool connected() const = 0;
-@@ -118,12 +118,12 @@
- // shared_ptr to the slot in the garbage collecting lock,
- // which will destroy the slot only after it unlocks.
- template<typename Mutex>
-- void dec_slot_refcount(garbage_collecting_lock<Mutex> &lock) const
-+ void dec_slot_refcount(garbage_collecting_lock<Mutex> &lock_arg) const
- {
- BOOST_ASSERT(m_slot_refcount != 0);
- if(--m_slot_refcount == 0)
- {
-- lock.add_trash(release_slot());
-+ lock_arg.add_trash(release_slot());
- }
- }
-
-@@ -155,17 +155,17 @@
- const GroupKey& group_key() const {return _group_key;}
- void set_group_key(const GroupKey &key) {_group_key = key;}
- template<typename M>
-- void disconnect_expired_slot(garbage_collecting_lock<M> &lock)
-+ void disconnect_expired_slot(garbage_collecting_lock<M> &lock_arg)
- {
- if(!m_slot) return;
- bool expired = slot().expired();
- if(expired == true)
- {
-- nolock_disconnect(lock);
-+ nolock_disconnect(lock_arg);
- }
- }
- template<typename M, typename OutputIterator>
-- void nolock_grab_tracked_objects(garbage_collecting_lock<M> &lock,
-+ void nolock_grab_tracked_objects(garbage_collecting_lock<M> &lock_arg,
- OutputIterator inserter) const
- {
- if(!m_slot) return;
-@@ -184,7 +184,7 @@
- );
- if(apply_visitor(detail::expired_weak_ptr_visitor(), *it))
- {
-- nolock_disconnect(lock);
-+ nolock_disconnect(lock_arg);
- return;
- }
- *inserter++ = locked_object;
diff --git a/external/boost/boost_1_59_0.system.no.deprecated.patch b/external/boost/boost_1_59_0.system.no.deprecated.patch
new file mode 100644
index 0000000..867811f
--- /dev/null
+++ b/external/boost/boost_1_59_0.system.no.deprecated.patch
@@ -0,0 +1,74 @@
+Starting from 1.59.0 final release, there are undefined generic_category()
+errors in internal and external modules: [1].
+
+Instead of defining the -DBOOST_SYSTEM_NO_DEPRECATED in internal and external
+modules, patch the boost to not define the deprecated stuff per default.
+
+[1] http://paste.openstack.org/show/430509
+
+diff -ru boost.orig/boost/system/detail/error_code.ipp boost/boost/system/detail/error_code.ipp
+--- foo/misc/boost.orig/boost/system/detail/error_code.ipp 2015-01-06 17:08:27.000000000 +0100
++++ foo/misc/boost/boost/system/detail/error_code.ipp 2015-08-28 21:47:00.941340365 +0200
+@@ -437,7 +437,7 @@
+ } // unnamed namespace
+
+
+-# ifndef BOOST_SYSTEM_NO_DEPRECATED
++# ifdef BOOST_SYSTEM_DEPRECATED
+ BOOST_SYSTEM_DECL error_code throws; // "throw on error" special error_code;
+ // note that it doesn't matter if this
+ // isn't initialized before use since
+diff -ru boost.orig/boost/system/error_code.hpp boost/boost/system/error_code.hpp
+--- foo/misc/boost.orig/boost/system/error_code.hpp 2015-01-06 17:08:27.000000000 +0100
++++ foo/misc/boost/boost/system/error_code.hpp 2015-08-28 21:47:58.318344217 +0200
+@@ -139,7 +139,7 @@
+
+ } // namespace errc
+
+-# ifndef BOOST_SYSTEM_NO_DEPRECATED
++# ifdef BOOST_SYSTEM_DEPRECATED
+ namespace posix = errc;
+ namespace posix_error = errc;
+ # endif
+@@ -214,7 +214,7 @@
+ #endif
+ // deprecated synonyms --------------------------------------------------//
+
+-# ifndef BOOST_SYSTEM_NO_DEPRECATED
++# ifdef BOOST_SYSTEM_DEPRECATED
+ inline const error_category & get_system_category() { return system_category(); }
+ inline const error_category & get_generic_category() { return generic_category(); }
+ inline const error_category & get_posix_category() { return generic_category(); }
+@@ -394,7 +394,7 @@
+ };
+
+ // predefined error_code object used as "throw on error" tag
+-# ifndef BOOST_SYSTEM_NO_DEPRECATED
++# ifdef BOOST_SYSTEM_DEPRECATED
+ BOOST_SYSTEM_DECL extern error_code throws;
+ # endif
+
+diff -ru boost.orig/boost/system/linux_error.hpp boost/boost/system/linux_error.hpp
+--- foo/misc/boost.orig/boost/system/linux_error.hpp 2015-01-06 17:08:27.000000000 +0100
++++ foo/misc/boost/boost/system/linux_error.hpp 2015-08-28 21:47:17.172341455 +0200
+@@ -89,7 +89,7 @@
+ };
+ } // namespace linux_error
+
+-# ifndef BOOST_SYSTEM_NO_DEPRECATED
++# ifdef BOOST_SYSTEM_DEPRECATED
+ namespace Linux = linux_error;
+ # endif
+
+diff -ru boost.orig/boost/system/windows_error.hpp boost/boost/system/windows_error.hpp
+--- foo/misc/boost.orig/boost/system/windows_error.hpp 2015-01-06 17:08:27.000000000 +0100
++++ foo/misc/boost/boost/system/windows_error.hpp 2015-08-28 21:46:39.802338946 +0200
+@@ -105,7 +105,7 @@
+
+ } // namespace windows
+
+-# ifndef BOOST_SYSTEM_NO_DEPRECATED
++# ifdef BOOST_SYSTEM_DEPRECATED
+ namespace windows = windows_error;
+ # endif
+
diff --git a/external/boost/boost_1_59_0.type_index.wshadow.patch b/external/boost/boost_1_59_0.type_index.wshadow.patch
deleted file mode 100644
index e9be940..0000000
--- a/external/boost/boost_1_59_0.type_index.wshadow.patch
+++ /dev/null
@@ -1,15 +0,0 @@
-diff -ru boost.orig/boost/type_index/type_index_facade.hpp boost/boost/type_index/type_index_facade.hpp
---- foo/misc/boost.orig/boost/type_index/type_index_facade.hpp 2015-07-19 11:39:38.476942225 +0200
-+++ foo/misc/boost/boost/type_index/type_index_facade.hpp 2015-07-19 11:41:13.032941163 +0200
-@@ -105,8 +105,8 @@
- /// \return Hash code of a type. By default hashes types by raw_name().
- /// \note <boost/functional/hash.hpp> has to be included if this function is used.
- inline std::size_t hash_code() const BOOST_NOEXCEPT {
-- const char* const name = derived().raw_name();
-- return boost::hash_range(name, name + std::strlen(name));
-+ const char* const name_ = derived().raw_name();
-+ return boost::hash_range(name_, name_ + std::strlen(name_));
- }
-
- #if defined(BOOST_TYPE_INDEX_DOXYGEN_INVOKED)
-
diff --git a/external/boost/boost_1_59_0.unique_ptr.wshadow.patch b/external/boost/boost_1_59_0.unique_ptr.wshadow.patch
deleted file mode 100644
index 2121d0d..0000000
--- a/external/boost/boost_1_59_0.unique_ptr.wshadow.patch
+++ /dev/null
@@ -1,14 +0,0 @@
-diff -ru boost.orig/boost/move/unique_ptr.hpp boost/boost/move/unique_ptr.hpp
---- foo/misc/boost.orig/boost/move/unique_ptr.hpp 2015-07-19 13:02:01.788886667 +0200
-+++ foo/misc/boost/boost/move/unique_ptr.hpp 2015-07-19 13:02:34.385886300 +0200
-@@ -105,8 +105,8 @@
- {}
-
- template <class U>
-- unique_ptr_data(P p, BOOST_FWD_REF(U) d) BOOST_NOEXCEPT
-- : m_p(p), d(::boost::forward<U>(d))
-+ unique_ptr_data(P p, BOOST_FWD_REF(U) d_) BOOST_NOEXCEPT
-+ : m_p(p), d(::boost::forward<U>(d_))
- {}
-
- del_ref deleter() { return d; }
commit 0e59d6c337531a3cb51e0c5b8c43ae1fc3d927f0
Author: Tor Lillqvist <tml at collabora.com>
Date: Sat Aug 29 09:18:44 2015 +0300
WaE: 'rChunk' : unreferenced formal parameter
Change-Id: I1491ea35af3b8237a9b8f6357e6452b323139e99
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 7bf8a8f..056c48a 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -119,7 +119,7 @@ char ColorFor(COLORREF aColor)
return '0' + (10*(GetRValue(aColor) + GetGValue(aColor) + GetBValue(aColor))) / (0xFF*3);
}
-void DumpGlyphBitmap(OpenGLGlyphCacheChunk& rChunk, HDC hDC)
+void DumpGlyphBitmap(HDC hDC)
{
HBITMAP hBitmap = static_cast<HBITMAP>(GetCurrentObject(hDC, OBJ_BITMAP));
if (hBitmap == NULL)
@@ -430,7 +430,7 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou
#ifdef SAL_DETAIL_ENABLE_LOG_INFO
SAL_INFO("vcl.gdi.opengl", "this=" << this << " now: " << maOpenGLGlyphCache);
- DumpGlyphBitmap(aChunk, aDC.getCompatibleHDC());
+ DumpGlyphBitmap(aDC.getCompatibleHDC());
#endif
return true;
commit 15943416240e29a052e3a6e4d338932e8c1ffb06
Author: Tor Lillqvist <tml at collabora.com>
Date: Sat Aug 29 09:02:31 2015 +0300
Avoid unintended unconditional std::cerr debug output
Can't call a function that as a side effect prints to std::cerr in
SAL_INFO. It will be called even if the log area doesn't match
$SAL_LOG. Just use only SAL_INFO and no plain std::cerr output. It's
fine to output a string with embedded newlines in SAL_INFO.
Also drop the debug output line with the glyph start positions, it was
less than useful.
Change-Id: I9fb5ed068aae1b835e20cf1ec1097bcd55deb05d
diff --git a/vcl/win/source/gdi/winlayout.cxx b/vcl/win/source/gdi/winlayout.cxx
index 8d5d8bd..7bf8a8f 100644
--- a/vcl/win/source/gdi/winlayout.cxx
+++ b/vcl/win/source/gdi/winlayout.cxx
@@ -105,6 +105,10 @@ public:
const OpenGLGlyphCacheChunk& GetCachedGlyphChunkFor(int nGlyphIndex) const;
};
+#ifdef SAL_DETAIL_ENABLE_LOG_INFO
+
+namespace {
+
char ColorFor(COLORREF aColor)
{
if (aColor == RGB(0xFF, 0xFF, 0xFF))
@@ -115,47 +119,39 @@ char ColorFor(COLORREF aColor)
return '0' + (10*(GetRValue(aColor) + GetGValue(aColor) + GetBValue(aColor))) / (0xFF*3);
}
-OUString DumpGlyphBitmap(OpenGLGlyphCacheChunk& rChunk, HDC hDC)
+void DumpGlyphBitmap(OpenGLGlyphCacheChunk& rChunk, HDC hDC)
{
HBITMAP hBitmap = static_cast<HBITMAP>(GetCurrentObject(hDC, OBJ_BITMAP));
if (hBitmap == NULL)
{
SAL_WARN("vcl.gdi", "GetCurrentObject failed: " << WindowsErrorString(GetLastError()));
- return "";
+ return;
}
BITMAP aBitmap;
if (!GetObjectW(hBitmap, sizeof(aBitmap), &aBitmap))
{
SAL_WARN("vcl.gdi", "GetObjectW failed: " << WindowsErrorString(GetLastError()));
- return "";
+ return;
}
- std::cerr << "Bitmap " << hBitmap << ": " << aBitmap.bmWidth << "x" << aBitmap.bmHeight << ":" << std::endl;
-
- // Print out start pos of each glyph only in the horizontal font case
- int nPos = 0;
- if (rChunk.mnGlyphCount > 1 && rChunk.maLocation[1].Left() > rChunk.maLocation[0].Left())
- {
- for (int i = 1; i < rChunk.mnGlyphCount && nPos < 75; i++)
- {
- for (int j = nPos; j < rChunk.maLocation[i].Left(); j++)
- std::cerr << " ";
- std::cerr << "!";
- nPos = rChunk.maLocation[i].Left() + 1;
- }
- }
- std::cerr << std::endl;
+ SAL_INFO("vcl.gdi.opengl", "Bitmap " << hBitmap << ": " << aBitmap.bmWidth << "x" << aBitmap.bmHeight << ":");
+ std::ostringstream sLine("\n");
for (long y = 0; y < aBitmap.bmHeight; y++)
{
for (long x = 0; x < std::min(75l, aBitmap.bmWidth); x++)
- std::cerr << ColorFor(GetPixel(hDC, x, y));
- std::cerr << std::endl;
+ sLine << ColorFor(GetPixel(hDC, x, y));
+ if (y < aBitmap.bmHeight - 1)
+ sLine << "\n";
}
- return "";
+ SAL_INFO("vcl.gdi.opengl", sLine.str());
}
+} // anonymous namespace
+
+#endif // SAL_DETAIL_ENABLE_LOG_INFO
+
template< typename charT, typename traits >
inline std::basic_ostream<charT, traits> & operator <<(
std::basic_ostream<charT, traits> & stream, const std::vector<OpenGLGlyphCacheChunk>& rCache )
@@ -432,7 +428,10 @@ bool ImplWinFontEntry::AddChunkOfGlyphs(int nGlyphIndex, const WinLayout& rLayou
if (hNonAntialiasedFont != NULL)
DeleteObject(hNonAntialiasedFont);
- SAL_INFO("vcl.gdi.opengl", "this=" << this << " now: " << maOpenGLGlyphCache << DumpGlyphBitmap(aChunk, aDC.getCompatibleHDC()));
+#ifdef SAL_DETAIL_ENABLE_LOG_INFO
+ SAL_INFO("vcl.gdi.opengl", "this=" << this << " now: " << maOpenGLGlyphCache);
+ DumpGlyphBitmap(aChunk, aDC.getCompatibleHDC());
+#endif
return true;
}
commit 091fde623d33a21162658d9f2338ab0b23e82a90
Author: Tor Lillqvist <tml at collabora.com>
Date: Sat Aug 29 08:02:57 2015 +0300
Bin include file with unused stuff
Change-Id: I6c4b78a673183252604da0fe2deff6e4a2fa60d6
diff --git a/sw/source/filter/ww8/needed_cast.hxx b/sw/source/filter/ww8/needed_cast.hxx
index 2280f77..a7a6a04 100644
--- a/sw/source/filter/ww8/needed_cast.hxx
+++ b/sw/source/filter/ww8/needed_cast.hxx
@@ -20,8 +20,6 @@
#ifndef INCLUDED_SW_SOURCE_FILTER_WW8_NEEDED_CAST_HXX
#define INCLUDED_SW_SOURCE_FILTER_WW8_NEEDED_CAST_HXX
-#include "staticassert.hxx"
-
namespace ww
{
template<typename Ret, typename Param> Ret checking_cast(Param in, Ret)
diff --git a/sw/source/filter/ww8/staticassert.hxx b/sw/source/filter/ww8/staticassert.hxx
deleted file mode 100644
index 274b5ee..0000000
--- a/sw/source/filter/ww8/staticassert.hxx
+++ /dev/null
@@ -1,63 +0,0 @@
-/* -*- 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 .
- */
-
-#ifndef INCLUDED_SW_SOURCE_FILTER_WW8_STATICASSERT_HXX
-#define INCLUDED_SW_SOURCE_FILTER_WW8_STATICASSERT_HXX
-
-/*
- Lifted direct from:
- Modern C++ Design: Generic Programming and Design Patterns Applied
- Section 2.1
- by Andrei Alexandrescu
-*/
-namespace ww
-{
- template<bool> class compile_time_check
- {
- public:
- compile_time_check(...) {}
- };
-
- template<> class compile_time_check<false>
- {
- };
-}
-
- /*
- Similar to assert, StaticAssert is only in operation when NDEBUG is not
- defined. It will test its first argument at compile time and on failure
- report the error message of the second argument, which must be a valid c++
- classname. i.e. no spaces, punctuation or reserved keywords.
- */
-#ifndef NDEBUG
-# define StaticAssert(test, errormsg) \
- do { \
- struct ERROR_##errormsg {}; \
- typedef ww::compile_time_check< (test) != 0 > tmplimpl; \
- tmplimpl aTemp = tmplimpl(ERROR_##errormsg()); \
- sizeof(aTemp); \
- } while (0)
-#else
-# define StaticAssert(test, errormsg) \
- do {} while (0)
-#endif
-
-#endif
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sw/source/filter/ww8/styles.cxx b/sw/source/filter/ww8/styles.cxx
index 2297c1b..3f74cf5 100644
--- a/sw/source/filter/ww8/styles.cxx
+++ b/sw/source/filter/ww8/styles.cxx
@@ -23,7 +23,6 @@
#include <algorithm>
#include <rtl/ustring.hxx>
#include <osl/diagnose.h>
-#include "staticassert.hxx"
namespace
{
commit be662ff54c24b245baf7526ff13a06350679d0f5
Author: Tor Lillqvist <tml at collabora.com>
Date: Sat Aug 29 07:55:29 2015 +0300
This is C++, we have booleans
diff --git a/include/vcl/opengl/OpenGLHelper.hxx b/include/vcl/opengl/OpenGLHelper.hxx
index fd9c2de..646a2d3 100644
--- a/include/vcl/opengl/OpenGLHelper.hxx
+++ b/include/vcl/opengl/OpenGLHelper.hxx
@@ -32,7 +32,7 @@
detail_stream << stream; \
OpenGLHelper::debugMsgStream((area),detail_stream); \
} \
- } while (0)
+ } while (false)
class VCL_DLLPUBLIC OpenGLHelper
{
commit cec9e1176cf667bf8fafe1752c93e45176c92d42
Author: Norbert Thiebaud <nthiebaud at gmail.com>
Date: Fri Aug 28 20:32:53 2015 -0500
Add PerfSuite.conf Jenkins pseudo distro-config
Change-Id: I0fecd634930629c7de65f11ce5190a9a95f98e52
diff --git a/distro-configs/Jenkins/PerfSuite_Linux.conf b/distro-configs/Jenkins/PerfSuite_Linux.conf
new file mode 100644
index 0000000..fcb6009
--- /dev/null
+++ b/distro-configs/Jenkins/PerfSuite_Linux.conf
@@ -0,0 +1,8 @@
+--with-distro=LibreOfficeLinux
+--without-help
+--disable-epm
+--disable-online-update
+--without-junit
+--disable-ccache
+--enable-symbols
+--enable-mergelibs
commit dc1be62d75e654e17c2f4c02804b7fd48d5a2515
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 28 16:14:07 2015 +0100
check stream status
Change-Id: I609c8c4f4e843601361b61f55e0325ad99db3c23
diff --git a/sd/qa/unit/data/ppt/pass/hang-20.ppt b/sd/qa/unit/data/ppt/pass/hang-20.ppt
new file mode 100644
index 0000000..7bfe75d
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-20.ppt differ
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 530be9c..76f331d 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -280,7 +280,6 @@ bool ImplSdPPTImport::Import()
if ( nSlideCount && pSection->GetProperty( PID_HEADINGPAIR, aPropItem ) )
{
sal_uInt32 nSlideTitleIndex = 0, nSlideTitleCount = 0;
- sal_uInt32 i, nTemp;
OUString aUString;
@@ -291,13 +290,14 @@ bool ImplSdPPTImport::Import()
{
nVecCount >>= 1;
sal_uInt32 nEntryCount = 0;
- for ( i = 0; i < nVecCount; i++ )
+ for (sal_uInt32 i = 0; i < nVecCount; ++i)
{
if ( !aPropItem.Read( aUString, VT_EMPTY, false ) )
break;
aPropItem.ReadUInt32( nType );
if ( ( nType != VT_I4 ) && ( nType != VT_UI4 ) )
break;
+ sal_uInt32 nTemp(0);
aPropItem.ReadUInt32( nTemp );
if ( aUString == "Slide Titles" || aUString == "Folientitel" )
{
@@ -312,17 +312,33 @@ bool ImplSdPPTImport::Import()
aPropItem.ReadUInt32( nType )
.ReadUInt32( nVecCount );
- if ( ( nVecCount >= ( nSlideTitleIndex + nSlideTitleCount ) )
- && ( nType == ( VT_LPSTR | VT_VECTOR ) ) )
+ bool bVecOk = ( ( nVecCount >= (nSlideTitleIndex + nSlideTitleCount) )
+ && ( nType == ( VT_LPSTR | VT_VECTOR ) ) );
+
+ if (bVecOk)
{
- for ( i = 0; i != nSlideTitleIndex; i++ )
+ for (sal_uInt32 i = 0; i != nSlideTitleIndex; ++i)
{
- aPropItem.ReadUInt32( nTemp );
- aPropItem.SeekRel( nTemp );
+ sal_uInt32 nTemp(0);
+ aPropItem.ReadUInt32(nTemp);
+ if (!aPropItem.good())
+ {
+ bVecOk = false;
+ break;
+ }
+ auto nPos = aPropItem.Tell() + nTemp;
+ if (nPos != aPropItem.Seek(nPos))
+ {
+ bVecOk = false;
+ break;
+ }
}
- for ( i = 0; i < nSlideTitleCount; i++ )
+ }
+ if (bVecOk)
+ {
+ for (sal_uInt32 i = 0; i < nSlideTitleCount; ++i)
{
- if ( !aPropItem.Read( aUString, nType, false ) )
+ if (!aPropItem.Read(aUString, nType, false))
break;
OUString aString( aUString );
commit 078235028a8c4ea36b6b366348016e19759c456a
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 28 15:33:44 2015 +0100
eof isn't a Error, so use good not GetError
Change-Id: Ie1df87c7eb9d391d0fa4a579f744051a1f1b2ae1
diff --git a/filter/source/msfilter/msdffimp.cxx b/filter/source/msfilter/msdffimp.cxx
index 011624a..a7f1ec7 100644
--- a/filter/source/msfilter/msdffimp.cxx
+++ b/filter/source/msfilter/msdffimp.cxx
@@ -4170,17 +4170,17 @@ SdrObject* SvxMSDffManager::ImportShape( const DffRecordHeader& rHd, SvStream& r
SEEK_FROM_BEGINNING ) )
{
sal_uInt32 nBytesLeft = maShapeRecords.Current()->nRecLen;
- sal_uInt32 nUDData;
- sal_uInt16 nPID;
while( 5 < nBytesLeft )
{
- rSt.ReadUInt16( nPID );
- if ( rSt.GetError() != 0 )
+ sal_uInt16 nPID(0);
+ rSt.ReadUInt16(nPID);
+ if (!rSt.good())
break;
- rSt.ReadUInt32( nUDData );
- if ( rSt.GetError() != 0 )
+ sal_uInt32 nUDData(0);
+ rSt.ReadUInt32(nUDData);
+ if (!rSt.good())
break;
- if ( nPID == 447 )
+ if (nPID == 447)
{
mbRotateGranientFillWithAngle = nUDData & 0x20;
break;
@@ -5009,15 +5009,15 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
&& maShapeRecords.Current()->nRecLen )
{
sal_uInt32 nBytesLeft = maShapeRecords.Current()->nRecLen;
- sal_uInt32 nUDData;
- sal_uInt16 nPID;
while( 5 < nBytesLeft )
{
- rSt.ReadUInt16( nPID );
- if ( rSt.GetError() != 0 )
+ sal_uInt16 nPID(0);
+ rSt.ReadUInt16(nPID);
+ if (!rSt.good())
break;
- rSt.ReadUInt32( nUDData );
- switch( nPID )
+ sal_uInt32 nUDData(0);
+ rSt.ReadUInt32(nUDData);
+ switch (nPID)
{
case 0x038F: pImpRec->nXAlign = nUDData; break;
case 0x0390:
@@ -5045,7 +5045,7 @@ SdrObject* SvxMSDffManager::ProcessObj(SvStream& rSt,
pImpRec->isHorizontalRule = true;
break;
}
- if ( rSt.GetError() != 0 )
+ if (!rSt.good())
break;
nBytesLeft -= 6;
}
diff --git a/sd/qa/unit/data/ppt/pass/hang-19.ppt b/sd/qa/unit/data/ppt/pass/hang-19.ppt
new file mode 100644
index 0000000..942a58a
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-19.ppt differ
commit 8c2b2d63eed861e8cfe847c4b3757b307e9d389e
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 28 15:13:41 2015 +0100
time stamp object selections and use newest as ref for equalization
Change-Id: I1bf22ddbaf263b240288f70d03d6949611f86b69
diff --git a/include/svx/svdmark.hxx b/include/svx/svdmark.hxx
index cba0a75..aee9dd7 100644
--- a/include/svx/svdmark.hxx
+++ b/include/svx/svdmark.hxx
@@ -42,7 +42,10 @@ typedef std::set<sal_uInt16> SdrUShortCont;
*/
class SVX_DLLPUBLIC SdrMark : public sdr::ObjectUser
{
+private:
+ void setTime();
protected:
+ sal_Int64 mnTimeStamp;
SdrObject* mpSelectedSdrObject; // the selected object
SdrPageView* mpPageView;
SdrUShortCont* mpPoints; // Selected Points
@@ -145,6 +148,11 @@ public:
return mpGluePoints;
}
+
+ sal_Int64 getTimeStamp() const
+ {
+ return mnTimeStamp;
+ }
};
class SVX_DLLPUBLIC SdrMarkList
diff --git a/svx/source/svdraw/svdedtv2.cxx b/svx/source/svdraw/svdedtv2.cxx
index 719355d..090efa7 100644
--- a/svx/source/svdraw/svdedtv2.cxx
+++ b/svx/source/svdraw/svdedtv2.cxx
@@ -1181,7 +1181,19 @@ void SdrEditView::EqualizeMarkedObjects(bool bWidth)
if (nMarked < 2)
return;
- SdrObject* pLastSelectedObj = rMarkList.GetMark(nMarked-1)->GetMarkedSdrObj();
+ size_t nLastSelected = 0;
+ sal_Int64 nLastSelectedTime = rMarkList.GetMark(0)->getTimeStamp();
+ for (size_t a = 1; a < nMarked; ++a)
+ {
+ sal_Int64 nCandidateTime = rMarkList.GetMark(a)->getTimeStamp();
+ if (nCandidateTime > nLastSelectedTime)
+ {
+ nLastSelectedTime = nCandidateTime;
+ nLastSelected = a;
+ }
+ }
+
+ SdrObject* pLastSelectedObj = rMarkList.GetMark(nLastSelected)->GetMarkedSdrObj();
Size aLastRectSize(pLastSelectedObj->GetLogicRect().GetSize());
const bool bUndo = IsUndoEnabled();
@@ -1189,8 +1201,10 @@ void SdrEditView::EqualizeMarkedObjects(bool bWidth)
if (bUndo)
BegUndo();
- for (size_t a = 0; a < nMarked-1; ++a)
+ for (size_t a = 0; a < nMarked; ++a)
{
+ if (a == nLastSelected)
+ continue;
SdrMark* pM = rMarkList.GetMark(a);
SdrObject* pObj = pM->GetMarkedSdrObj();
Rectangle aLogicRect(pObj->GetLogicRect());
diff --git a/svx/source/svdraw/svdmark.cxx b/svx/source/svdraw/svdmark.cxx
index 7ddde61..8b7f3e09c 100644
--- a/svx/source/svdraw/svdmark.cxx
+++ b/svx/source/svdraw/svdmark.cxx
@@ -38,8 +38,12 @@
#include <svl/SfxBroadcaster.hxx>
#include <svx/svdoedge.hxx>
-
-
+void SdrMark::setTime()
+{
+ TimeValue aNow;
+ osl_getSystemTime(&aNow);
+ mnTimeStamp = sal_Int64(aNow.Seconds) * 1000000000L + aNow.Nanosec;
+}
SdrMark::SdrMark(SdrObject* pNewObj, SdrPageView* pNewPageView)
: mpSelectedSdrObject(pNewObj),
@@ -55,10 +59,12 @@ SdrMark::SdrMark(SdrObject* pNewObj, SdrPageView* pNewPageView)
{
mpSelectedSdrObject->AddObjectUser( *this );
}
+ setTime();
}
SdrMark::SdrMark(const SdrMark& rMark)
: ObjectUser(),
+ mnTimeStamp(0),
mpSelectedSdrObject(0L),
mpPageView(0L),
mpPoints(0L),
@@ -117,10 +123,10 @@ void SdrMark::SetMarkedSdrObj(SdrObject* pNewObj)
}
}
-
SdrMark& SdrMark::operator=(const SdrMark& rMark)
{
SetMarkedSdrObj(rMark.mpSelectedSdrObject);
+ mnTimeStamp = rMark.mnTimeStamp;
mpPageView = rMark.mpPageView;
mbCon1 = rMark.mbCon1;
mbCon2 = rMark.mbCon2;
commit 2aadad1e89e96cb80c15fe1069cb6365f0cade1d
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 28 14:33:05 2015 +0100
guard against 0 item size
Change-Id: I9c4c2f0fe2d892615b3c70e08da0cab6da13338a
diff --git a/sd/qa/unit/data/ppt/pass/crash-2.ppt b/sd/qa/unit/data/ppt/pass/crash-2.ppt
new file mode 100644
index 0000000..78a4da4
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/crash-2.ppt differ
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 286c61f..18f3450 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -93,7 +93,7 @@ bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, bool bAlign )
{
case VT_LPSTR :
{
- if ( nItemSize )
+ if (nItemSize)
{
auto nMaxSizePossible = remainingSize();
if (nItemSize > nMaxSizePossible)
@@ -101,6 +101,10 @@ bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, bool bAlign )
SAL_WARN("sd.filter", "String of Len " << nItemSize << " claimed, only " << nMaxSizePossible << " possible");
nItemSize = nMaxSizePossible;
}
+ }
+
+ if (nItemSize)
+ {
try
{
sal_Char* pString = new sal_Char[ nItemSize ];
@@ -144,7 +148,7 @@ bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, bool bAlign )
case VT_LPWSTR :
{
- if ( nItemSize )
+ if (nItemSize)
{
auto nMaxSizePossible = remainingSize() / sizeof(sal_Unicode);
if (nItemSize > nMaxSizePossible)
@@ -152,7 +156,10 @@ bool PropItem::Read( OUString& rString, sal_uInt32 nStringType, bool bAlign )
SAL_WARN("sd.filter", "String of Len " << nItemSize << " claimed, only " << nMaxSizePossible << " possible");
nItemSize = nMaxSizePossible;
}
+ }
+ if (nItemSize)
+ {
try
{
sal_Unicode* pString = new sal_Unicode[ nItemSize ];
commit 1847753ab135f522df6a293a8539155437f0129f
Author: Caolán McNamara <caolanm at redhat.com>
Date: Fri Aug 28 08:28:51 2015 +0100
check seeks and reads
Change-Id: I0c5c4784713376e0762bfbd197640f8d31b65562
diff --git a/filter/source/msfilter/svdfppt.cxx b/filter/source/msfilter/svdfppt.cxx
index b025b79..ad20a86 100644
--- a/filter/source/msfilter/svdfppt.cxx
+++ b/filter/source/msfilter/svdfppt.cxx
@@ -786,7 +786,8 @@ SdrObject* SdrEscherImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
break;
}
- aClientDataHd.SeekToEndOfRecord( rSt );
+ if (!aClientDataHd.SeekToEndOfRecord(rSt))
+ break;
}
}
if ( ( aPlaceholderAtom.nPlaceholderId == PptPlaceholder::NOTESSLIDEIMAGE ) && !rPersistEntry.bNotesMaster )
@@ -1810,7 +1811,10 @@ SdrObject* SdrPowerPointImport::ImportOLE( long nOLEId,
break;
}
else
- aPlaceHd.SeekToEndOfRecord( rStCtrl );
+ {
+ if (!aPlaceHd.SeekToEndOfRecord(rStCtrl))
+ break;
+ }
}
}
@@ -2402,7 +2406,8 @@ bool SdrPowerPointImport::SeekToContentOfProgTag( sal_Int32 nVersion, SvStream&
}
}
}
- aProgTagBinaryDataHd.SeekToEndOfRecord( rSt );
+ if (!aProgTagBinaryDataHd.SeekToEndOfRecord(rSt))
+ break;
}
}
if ( !bRetValue )
@@ -2703,7 +2708,8 @@ void ImportComment10( SvxMSDffManager& rMan, SvStream& rStCtrl, SdrPage* pPage,
}
break;
}
- aCommentHd.SeekToEndOfRecord( rStCtrl );
+ if (!aCommentHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
Point aPosition( nPosX, nPosY );
rMan.Scale( aPosition );
@@ -2763,7 +2769,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
while( ( rStCtrl.GetError() == 0 ) && SeekToRec( rStCtrl, PPT_PST_Comment10, aContentDataHd.GetRecEndFilePos(), &aComment10Hd ) )
{
ImportComment10( *this, rStCtrl, pRet, aComment10Hd );
- aComment10Hd.SeekToEndOfRecord( rStCtrl );
+ if (!aComment10Hd.SeekToEndOfRecord(rStCtrl))
+ break;
}
}
}
@@ -2841,7 +2848,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
}
if ( aEscherObjListHd.nRecType == DFF_msofbtSpContainer )
break;
- aEscherObjListHd.SeekToEndOfRecord( rStCtrl );
+ if (!aEscherObjListHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
// now importing page
@@ -2891,7 +2899,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
}
if ( aEscherObjListHd.nRecType == DFF_msofbtSpgrContainer )
break;
- aEscherObjListHd.SeekToEndOfRecord( rStCtrl );
+ if (!aEscherObjListHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
if ( rSlidePersist.pBObj )
@@ -2907,7 +2916,8 @@ void SdrPowerPointImport::ImportPage( SdrPage* pRet, const PptSlidePersistEntry*
}
break;
}
- aHd.SeekToEndOfRecord( rStCtrl );
+ if (!aHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
if ( rSlidePersist.pSolverContainer )
SolveSolver( *rSlidePersist.pSolverContainer );
@@ -3116,7 +3126,8 @@ void SdrEscherImport::ImportHeaderFooterContainer( DffRecordHeader& rHd, HeaderF
}
break;
}
- aHd.SeekToEndOfRecord( rStCtrl );
+ if (!aHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
}
@@ -3246,7 +3257,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
#ifdef DBG_UTIL
else OSL_FAIL( "PPTExParaProv::PPTExParaProv - unknown atom interpreting the PPT_PST_ExtendedBuGraContainer (SJ)" );
#endif
- aBuGraAtomHd.SeekToEndOfRecord( rSt );
+ if (!aBuGraAtomHd.SeekToEndOfRecord(rSt))
+ break;
}
if ( !aBuGraList.empty() )
bGraphics = true;
@@ -3270,7 +3282,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
break;
#endif
}
- aHd.SeekToEndOfRecord( rSt );
+ if (!aHd.SeekToEndOfRecord(rSt))
+ break;
}
}
@@ -3319,7 +3332,8 @@ PPTExtParaProv::PPTExtParaProv( SdrPowerPointImport& rMan, SvStream& rSt, const
case 0xf144 :
break;
}
- aHd.SeekToEndOfRecord( rSt );
+ if (!aHd.SeekToEndOfRecord(rSt))
+ break;
}
}
rSt.Seek( nOldPos );
@@ -4096,7 +4110,10 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
break;
}
else
- aTxMasterStyleHd.SeekToEndOfRecord( rIn );
+ {
+ if (!aTxMasterStyleHd.SeekToEndOfRecord(rIn))
+ break;
+ }
}
}
@@ -4110,7 +4127,10 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
if ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom )
break;
else
- aTxMasterStyleHd.SeekToEndOfRecord( rIn );
+ {
+ if (!aTxMasterStyleHd.SeekToEndOfRecord(rIn))
+ break;
+ }
}
while ( ( aTxMasterStyleHd.nRecType == PPT_PST_TxMasterStyleAtom ) && ( rIn.Tell() < nEndRecPos ) ) //TODO: aTxMasterStyleHd may be used without having been properly initialized
{
@@ -4212,7 +4232,8 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
}
#endif
}
- aTxMasterStyleHd.SeekToEndOfRecord( rIn );
+ if (!aTxMasterStyleHd.SeekToEndOfRecord(rIn))
+ break;
ReadDffRecordHeader( rIn, aTxMasterStyleHd );
}
if ( !mpCharSheet[ TSS_TYPE_SUBTITLE ] )
@@ -4285,7 +4306,10 @@ PPTStyleSheet::PPTStyleSheet( const DffRecordHeader& rSlideHd, SvStream& rIn, Sd
break;
}
else
- aTxMasterStyleHd2.SeekToEndOfRecord( rIn );
+ {
+ if (!aTxMasterStyleHd2.SeekToEndOfRecord(rIn))
+ break;
+ }
}
}
}
@@ -6480,7 +6504,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
if ( ( nTmpSlideId == nSlideId ) && ( pHd->nRecInstance == nRefNum ) )
{
- pHd->SeekToEndOfRecord( rIn );
+ if (!pHd->SeekToEndOfRecord(rIn))
+ break;
ReadDffRecordHeader( rIn, aPresRuleHd );
if ( aPresRuleHd.nRecType == PPT_PST_ExtendedParagraphAtom )
{
@@ -6810,7 +6835,8 @@ PPTTextObj::PPTTextObj( SvStream& rIn, SdrPowerPointImport& rSdrPowerPointImport
}
break;
}
- aTextHd.SeekToEndOfRecord( rIn );
+ if (!aTextHd.SeekToEndOfRecord(rIn))
+ break;
if ( pEntry )
{
// sorting fields ( hi >> lo )
diff --git a/sd/qa/unit/data/ppt/pass/hang-15.ppt b/sd/qa/unit/data/ppt/pass/hang-15.ppt
new file mode 100644
index 0000000..b93255a
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-15.ppt differ
diff --git a/sd/qa/unit/data/ppt/pass/hang-16.ppt b/sd/qa/unit/data/ppt/pass/hang-16.ppt
new file mode 100644
index 0000000..c398d2b
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-16.ppt differ
diff --git a/sd/qa/unit/data/ppt/pass/hang-17.ppt b/sd/qa/unit/data/ppt/pass/hang-17.ppt
new file mode 100644
index 0000000..de876ff
Binary files /dev/null and b/sd/qa/unit/data/ppt/pass/hang-17.ppt differ
diff --git a/sd/source/filter/ppt/pptin.cxx b/sd/source/filter/ppt/pptin.cxx
index 31fe108..530be9c 100644
--- a/sd/source/filter/ppt/pptin.cxx
+++ b/sd/source/filter/ppt/pptin.cxx
@@ -521,7 +521,8 @@ bool ImplSdPPTImport::Import()
break;
rStCtrl.SeekRel( 8 );
rStCtrl.ReadUInt32( pPtr->nIndex );
- aHyperE.SeekToEndOfRecord( rStCtrl );
+ if (!aHyperE.SeekToEndOfRecord(rStCtrl))
+ break;
}
}
}
@@ -826,7 +827,8 @@ bool ImplSdPPTImport::Import()
}
break;
}
- aProgTagContentHd.SeekToEndOfRecord( rStCtrl );
+ if (!aProgTagContentHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
}
}
@@ -953,7 +955,8 @@ bool ImplSdPPTImport::Import()
case PPT_PST_SlideTime10Atom : // ??? don't know, this atom is always 8 bytes big
break; // and is appearing in nearly every l10 progtag
}
- aProgTagContentHd.SeekToEndOfRecord( rStCtrl );
+ if (!aProgTagContentHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
}
}
@@ -965,7 +968,8 @@ bool ImplSdPPTImport::Import()
break;
}
- aHd.SeekToEndOfRecord( rStCtrl );
+ if (!aHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
ImportPageEffect( pPage, bNewAnimationsUsed );
}
@@ -1786,7 +1790,8 @@ void ImplSdPPTImport::ImportPageEffect( SdPage* pPage, const bool bNewAnimations
}
}
}
- aHd.SeekToEndOfRecord( rStCtrl );
+ if (!aHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
if ( bTryTwice && !bSSSlideInfoAtom )
{
@@ -1948,7 +1953,10 @@ OUString ImplSdPPTImport::ReadSound(sal_uInt32 nSoundRef) const
}
}
if ( !bDone )
- aSoundRecHd.SeekToEndOfRecord( rStCtrl );
+ {
+ if (!aSoundRecHd.SeekToEndOfRecord(rStCtrl))
+ break;
+ }
}
}
}
@@ -2009,7 +2017,8 @@ OUString ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
}
break;
}
- aHd.SeekToEndOfRecord( rStCtrl );
+ if (!aHd.SeekToEndOfRecord(rStCtrl))
+ break;
}
break;
}
@@ -2018,7 +2027,8 @@ OUString ImplSdPPTImport::ReadMedia( sal_uInt32 nMediaRef ) const
}
break;
}
- aHdMovie.SeekToEndOfRecord( rStCtrl );
+ if (!aHdMovie.SeekToEndOfRecord(rStCtrl))
+ break;
}
}
return aRetVal;
@@ -2676,7 +2686,8 @@ SdrObject* ImplSdPPTImport::ProcessObj( SvStream& rSt, DffObjData& rObjData, voi
}
break;
}
- aHd.SeekToEndOfRecord( rSt );
+ if (!aHd.SeekToEndOfRecord(rSt))
+ break;
}
while( ( rSt.GetError() == 0 ) && ( rSt.Tell() < nClientDataLen ) );
diff --git a/sd/source/filter/ppt/propread.cxx b/sd/source/filter/ppt/propread.cxx
index 64e3725..286c61f 100644
--- a/sd/source/filter/ppt/propread.cxx
+++ b/sd/source/filter/ppt/propread.cxx
@@ -319,7 +319,7 @@ bool Section::GetDictionary( Dictionary& rDict )
void Section::Read( SotStorageStream *pStrm )
{
- sal_uInt32 i, nSecOfs, nPropSize, nStrmSize;
+ sal_uInt32 nSecOfs, nPropSize, nStrmSize;
nSecOfs = pStrm->Tell();
pStrm->Seek( STREAM_SEEK_TO_END );
@@ -357,7 +357,7 @@ void Section::Read( SotStorageStream *pStrm )
bool bVariant = ( nPropType == VT_VARIANT );
- for ( i = 0; nPropSize && ( i < nVectorCount ); i++ )
+ for (sal_uInt32 i = 0; nPropSize && ( i < nVectorCount ); ++i)
{
if ( bVariant )
{
@@ -453,7 +453,7 @@ void Section::Read( SotStorageStream *pStrm )
if( nPropSize > nSecSize - nSecOfs )
nPropSize = nSecSize - nSecOfs;
sal_uInt8* pBuf = new sal_uInt8[ nPropSize ];
- pStrm->Read( pBuf, nPropSize );
+ nPropSize = pStrm->Read(pBuf, nPropSize);
AddProperty( nPropId, pBuf, nPropSize );
delete[] pBuf;
}
@@ -488,14 +488,17 @@ void Section::Read( SotStorageStream *pStrm )
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list