[Libreoffice-commits] core.git: Branch 'feature/gsoc15-open-remote-files-dialog' - 55 commits - accessibility/source bin/find-unused-defines.awk comphelper/source configure.ac dbaccess/source desktop/source desktop/test desktop/win32 distro-configs/LibreOfficeLinux.conf extensions/source fpicker/source framework/source i18npool/inc icon-themes/breeze icon-themes/galaxy icon-themes/hicontrast icon-themes/human icon-themes/tango include/comphelper include/rtl include/svtools include/svx include/unotools include/vcl offapi/com officecfg/registry oox/source readlicense_oo/license registry/source sal/osl sc/inc sc/source sc/uiconfig sd/source sd/uiconfig sfx2/source shell/inc sot/qa sot/source stoc/source svtools/source svx/source sw/qa sw/uiconfig ucb/source unotools/source vcl/unx writerfilter/source
Szymon Kłos
eszkadev at gmail.com
Fri Jul 24 01:05:34 PDT 2015
Rebased ref, commits from common ancestor:
commit 2c33d7ed71172609fabe692166d95ec850c8d0ce
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 24 09:47:18 2015 +0200
handle the delete button from PlaceEditDialog
Change-Id: Idb3257d1c106821a6e86182bca79c1aff8bfaea3
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index a810ff8..a263c3f 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -658,6 +658,9 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
m_bIsUpdated = true;
break;
}
+ case RET_NO:
+ sIdent = "delete_service";
+ break;
case RET_CANCEL :
default :
// Do Nothing
@@ -665,7 +668,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
};
}
}
- else if( sIdent == "delete_service" && m_pServices_lb->GetEntryCount() > 0 )
+ if( sIdent == "delete_service" && m_pServices_lb->GetEntryCount() > 0 )
{
unsigned int nSelected = m_pServices_lb->GetSelectEntryPos();
int nPos = GetSelectedServicePos();
commit 7b7873261f7cc66ef63ba4f1103dd9792574b54f
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 24 09:39:09 2015 +0200
don't show edit/delete menu when there is no service
Change-Id: Ia53c9e3f6a4bcaab5e68fbbff6d2ec8cfe5cd702
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index ab11f2f..a810ff8 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -176,6 +176,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
, m_pSplitter( NULL )
, m_pFileView( NULL )
, m_pContainer( NULL )
+ , m_pAddMenu( NULL )
{
get( m_pCancel_btn, "cancel" );
get( m_pAddService_btn, "add_service_btn" );
@@ -252,6 +253,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
m_pName_ed->SetModifyHdl( LINK( this, RemoteFilesDialog, FileNameModifyHdl ) );
m_pAddService_btn->SetMenuMode( MENUBUTTON_MENUMODE_TIMED );
+ m_pAddMenu = m_pAddService_btn->GetPopupMenu();
m_pAddService_btn->SetClickHdl( LINK( this, RemoteFilesDialog, AddServiceHdl ) );
m_pAddService_btn->SetSelectHdl( LINK( this, RemoteFilesDialog, EditServiceMenuHdl ) );
@@ -413,7 +415,10 @@ void RemoteFilesDialog::FillServicesListbox()
if( m_pServices_lb->GetEntryCount() > 0 )
{
m_pServices_lb->SelectEntryPos( nPos );
+ m_pAddService_btn->SetPopupMenu( m_pAddMenu );
}
+ else
+ m_pAddService_btn->SetPopupMenu( NULL );
EnableControls();
}
@@ -588,6 +593,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl )
m_pServices_lb->InsertEntry( sPrefix + newService->GetName() );
m_pServices_lb->SelectEntryPos( m_pServices_lb->GetEntryCount() - 1 );
+ m_pAddService_btn->SetPopupMenu( m_pAddMenu );
SelectServiceHdl( NULL );
m_bIsUpdated = true;
@@ -682,6 +688,7 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
else
{
m_pServices_lb->SetNoSelection();
+ m_pAddService_btn->SetPopupMenu( NULL );
}
m_bIsUpdated = true;
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index a62b4cf..63fbd94 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -144,6 +144,7 @@ private:
VclPtr< FileViewContainer > m_pContainer;
VclPtr< ListBox > m_pFilter_lb;
VclPtr< Edit > m_pName_ed;
+ PopupMenu* m_pAddMenu;
std::vector< ServicePtr > m_aServices;
std::vector< std::pair< OUString, OUString > > m_aFilters;
commit 16ccf865fcd75448ff3d85a43d75db6e53e5ddfa
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 24 09:18:17 2015 +0200
working busy pointer
Change-Id: I8c5e9e155a1854a670961fa67aa2aa6944604177
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 7106366..ab11f2f 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -470,6 +470,7 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
EnableChildPointerOverwrite( true );
SetPointer( PointerStyle::Wait );
+ Invalidate(InvalidateFlags::Update);
if( !sURL.isEmpty() )
{
commit 70952076827a5e270d3c6fc375f3d9abecf88c9e
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Thu Jul 23 16:22:33 2015 +0200
RemoteFilesDialog integration with AsyncPickerAction
Change-Id: If6ded1c2f2b056ce864589649b08ed19a73dc5dd
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 4e69c9d..7106366 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -171,6 +171,7 @@ class FileViewContainer : public vcl::Window
RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
: SvtFileDialog_Base( pParent, "RemoteFilesDialog", "fps/ui/remotefilesdialog.ui" )
, m_context( comphelper::getProcessComponentContext() )
+ , m_pCurrentAsyncAction( NULL )
, m_pFileNotifier( NULL )
, m_pSplitter( NULL )
, m_pFileView( NULL )
@@ -187,6 +188,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
m_bMultiselection = ( nBits & SFXWB_MULTISELECTION ) != 0;
m_bIsUpdated = false;
m_bIsConnected = false;
+ m_bServiceChanged = false;
m_nCurrentFilter = LISTBOX_ENTRY_NOTFOUND;
m_pFilter_lb->Enable( false );
@@ -201,6 +203,7 @@ RemoteFilesDialog::RemoteFilesDialog( vcl::Window* pParent, WinBits nBits )
m_pOk_btn->Enable( false );
m_pOk_btn->SetClickHdl( LINK( this, RemoteFilesDialog, OkHdl ) );
+ m_pCancel_btn->SetClickHdl( LINK( this, RemoteFilesDialog, CancelHdl ) );
m_pPath = VclPtr<Breadcrumb>::Create( get< vcl::Window >( "breadcrumb_container" ) );
m_pPath->set_hexpand( true );
@@ -462,7 +465,13 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
if( m_pFileView )
{
- if( !sURL.isEmpty() && ContentIsFolder( sURL ) )
+ m_pTreeView->EndSelection();
+ DisableControls();
+
+ EnableChildPointerOverwrite( true );
+ SetPointer( PointerStyle::Wait );
+
+ if( !sURL.isEmpty() )
{
OUString sFilter = FILEDIALOG_FILTER_ALL;
@@ -473,33 +482,27 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
m_pFileView->EndInplaceEditing( false );
- EnableChildPointerOverwrite( true );
- SetPointer( PointerStyle::Wait );
-
- eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
+ DBG_ASSERT( !m_pCurrentAsyncAction.is(), "SvtFileDialog::executeAsync: previous async action not yet finished!" );
- if( eResult == eSuccess )
- {
- m_pPath->SetURL( sURL );
-
- m_pTreeView->SetSelectHdl( Link<>() );
- m_pTreeView->SetTreePath( sURL );
- m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
+ m_pCurrentAsyncAction = new AsyncPickerAction( this, m_pFileView, AsyncPickerAction::Action::eOpenURL );
- m_bIsConnected = true;
- EnableControls();
- }
-
- SetPointer( PointerStyle::Arrow );
- EnableChildPointerOverwrite( false );
+ // -1 timeout - sync
+ m_pCurrentAsyncAction->execute( sURL, sFilter, -1, -1, GetBlackList() );
}
else
{
+ SetPointer( PointerStyle::Arrow );
+ EnableChildPointerOverwrite( false );
+
// content doesn't exist
- m_pTreeView->EndSelection();
ErrorHandler::HandleError( ERRCODE_IO_NOTEXISTS );
+
+ EnableControls();
return eFailure;
}
+
+ SetPointer( PointerStyle::Arrow );
+ EnableChildPointerOverwrite( false );
}
return eResult;
@@ -547,6 +550,22 @@ void RemoteFilesDialog::EnableControls()
m_pContainer->Enable( false );
m_pOk_btn->Enable( false );
}
+
+ m_pPath->EnableFields( true );
+ m_pAddService_btn->Enable( true );
+}
+
+void RemoteFilesDialog::DisableControls()
+{
+ m_pServices_lb->Enable( false );
+ m_pFilter_lb->Enable( false );
+ m_pAddService_btn->Enable( false );
+ m_pName_ed->Enable( false );
+ m_pContainer->Enable( false );
+ m_pOk_btn->Enable( false );
+ m_pPath->EnableFields( false );
+
+ m_pCancel_btn->Enable( true );
}
IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl )
@@ -591,23 +610,9 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectServiceHdl )
if( nPos >= 0 )
{
OUString sURL = m_aServices[nPos]->GetUrl();
- OUString sName = m_aServices[nPos]->GetName();
-
- if( OpenURL( sURL ) == eSuccess )
- {
- m_pPath->SetRootName( sName );
- m_pTreeView->Clear();
-
- SvTreeListEntry* pRoot = m_pTreeView->InsertEntry( sName, NULL, true );
- OUString* sData = new OUString( sURL );
- pRoot->SetUserData( static_cast< void* >( sData ) );
- m_pTreeView->Expand( pRoot );
-
- m_pName_ed->GrabFocus();
-
- m_sLastServiceUrl = sURL;
- }
+ m_bServiceChanged = true;
+ OpenURL( sURL );
}
return 1;
@@ -690,15 +695,23 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
{
if( m_pFileView->GetSelectionCount() )
{
- OUString sURL = m_pFileView->GetCurrentURL();
+ SvTreeListEntry* pEntry = m_pFileView->FirstSelected();
- if( ContentIsDocument( sURL ) )
- {
- EndDialog( RET_OK );
- }
- else
+ if( pEntry )
{
- OpenURL( sURL );
+ SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
+
+ if( pData )
+ {
+ if( !pData->mbIsFolder )
+ {
+ EndDialog( RET_OK );
+ }
+ else
+ {
+ OpenURL( pData->maURL );
+ }
+ }
}
}
@@ -789,7 +802,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectFilterHdl )
OUString sCurrentURL = m_pFileView->GetViewURL();
- if( !sCurrentURL.isEmpty() )
+ if( !sCurrentURL.isEmpty() && m_bIsConnected )
OpenURL( sCurrentURL );
}
@@ -896,6 +909,20 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
return 1;
}
+IMPL_LINK_NOARG ( RemoteFilesDialog, CancelHdl )
+{
+ if( m_pCurrentAsyncAction.is() )
+ {
+ m_pCurrentAsyncAction->cancel();
+ onAsyncOperationFinished();
+ }
+ else
+ {
+ EndDialog( RET_CANCEL );
+ }
+ return 1;
+}
+
// SvtFileDialog_Base
SvtFileView* RemoteFilesDialog::GetView()
@@ -941,6 +968,24 @@ void RemoteFilesDialog::SetPath( const OUString& rNewURL )
}
}
+OUString RemoteFilesDialog::getCurrentFileText() const
+{
+ OUString sReturn;
+ if( m_pName_ed )
+ sReturn = m_pName_ed->GetText();
+ return sReturn;
+}
+
+void RemoteFilesDialog::setCurrentFileText( const OUString& rText, bool bSelectAll )
+{
+ if( m_pName_ed )
+ {
+ m_pName_ed->SetText( rText );
+ if( bSelectAll )
+ m_pName_ed->SetSelection( Selection( 0, rText.getLength() ) );
+ }
+}
+
void RemoteFilesDialog::AddFilterGroup(
const OUString& rFilter,
const com::sun::star::uno::Sequence< com::sun::star::beans::StringPair >& rFilters )
@@ -987,11 +1032,60 @@ void RemoteFilesDialog::SetCurFilter( const OUString& rFilter )
}
}
+void RemoteFilesDialog::FilterSelect()
+{
+}
+
void RemoteFilesDialog::SetFileCallback( ::svt::IFilePickerListener *pNotifier )
{
m_pFileNotifier = pNotifier;
}
+void RemoteFilesDialog::onAsyncOperationStarted()
+{
+ DisableControls();
+}
+
+void RemoteFilesDialog::onAsyncOperationFinished()
+{
+ m_pCurrentAsyncAction = NULL;
+ EnableControls();
+}
+
+void RemoteFilesDialog::UpdateControls( const OUString& rURL )
+{
+ int nPos = GetSelectedServicePos();
+
+ if( nPos >= 0 && m_bServiceChanged && rURL == m_aServices[nPos]->GetUrl() )
+ {
+ OUString sURL = m_aServices[nPos]->GetUrl();
+ OUString sName = m_aServices[nPos]->GetName();
+
+ m_pPath->SetRootName( sName );
+ m_pTreeView->Clear();
+
+ SvTreeListEntry* pRoot = m_pTreeView->InsertEntry( sName, NULL, true );
+ OUString* sData = new OUString( rURL );
+ pRoot->SetUserData( static_cast< void* >( sData ) );
+
+ m_pTreeView->Expand( pRoot );
+
+ m_pName_ed->GrabFocus();
+
+ m_sLastServiceUrl = sURL;
+
+ m_bServiceChanged = false;
+ }
+
+ m_pPath->SetURL( rURL );
+ m_pTreeView->SetSelectHdl( Link<>() );
+ m_pTreeView->SetTreePath( rURL );
+ m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
+
+ m_bIsConnected = true;
+ EnableControls();
+}
+
void RemoteFilesDialog::EnableAutocompletion( bool )
{
// This dialog contains Breadcrumb, not Edit
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index b0f151e..a62b4cf 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -84,13 +84,20 @@ public:
virtual bool ContentIsFolder( const OUString& rURL ) SAL_OVERRIDE;
virtual bool ContentIsDocument( const OUString& rURL );
+ virtual OUString getCurrentFileText() const SAL_OVERRIDE;
+ virtual void setCurrentFileText( const OUString& rText, bool bSelectAll = false ) SAL_OVERRIDE;
+
virtual void AddFilter( const OUString& rFilter, const OUString& rType ) SAL_OVERRIDE;
virtual void AddFilterGroup( const OUString& _rFilter,
const com::sun::star::uno::Sequence< com::sun::star::beans::StringPair >& rFilters ) SAL_OVERRIDE;
virtual OUString GetCurFilter() const SAL_OVERRIDE;
virtual void SetCurFilter( const OUString& rFilter ) SAL_OVERRIDE;
+ virtual void FilterSelect() SAL_OVERRIDE;
virtual void SetFileCallback( ::svt::IFilePickerListener *pNotifier ) SAL_OVERRIDE;
+ virtual void onAsyncOperationStarted() SAL_OVERRIDE;
+ virtual void onAsyncOperationFinished() SAL_OVERRIDE;
+ virtual void UpdateControls( const OUString& rURL ) SAL_OVERRIDE;
virtual void EnableAutocompletion( bool ) SAL_OVERRIDE;
@@ -114,12 +121,15 @@ private:
bool m_bMultiselection;
bool m_bIsUpdated;
bool m_bIsConnected;
+ bool m_bServiceChanged;
OUString m_sPath;
OUString m_sStdDir;
OUString m_sLastServiceUrl;
unsigned int m_nCurrentFilter;
+ ::rtl::Reference< ::svt::AsyncPickerAction > m_pCurrentAsyncAction;
+
::com::sun::star::uno::Sequence< OUString > m_aBlackList;
::svt::IFilePickerListener* m_pFileNotifier;
@@ -148,6 +158,7 @@ private:
void AddFileExtension();
void EnableControls();
+ void DisableControls();
DECL_LINK ( AddServiceHdl, void * );
DECL_LINK ( SelectServiceHdl, void * );
@@ -168,6 +179,7 @@ private:
DECL_LINK( SelectBreadcrumbHdl, Breadcrumb * );
DECL_LINK( OkHdl, void * );
+ DECL_LINK( CancelHdl, void * );
};
#endif // INCLUDED_SVTOOLS_REMOTEFILESDIALOG_HXX
diff --git a/fpicker/source/office/asyncfilepicker.cxx b/fpicker/source/office/asyncfilepicker.cxx
index cf6b17b..8e4c9e3 100644
--- a/fpicker/source/office/asyncfilepicker.cxx
+++ b/fpicker/source/office/asyncfilepicker.cxx
@@ -28,7 +28,7 @@
namespace svt
{
- AsyncPickerAction::AsyncPickerAction( SvtFileDialog* _pDialog, SvtFileView* _pView, const Action _eAction )
+ AsyncPickerAction::AsyncPickerAction( SvtFileDialog_Base* _pDialog, SvtFileView* _pView, const Action _eAction )
:m_eAction ( _eAction )
,m_pView ( _pView )
,m_pDialog ( _pDialog )
diff --git a/fpicker/source/office/asyncfilepicker.hxx b/fpicker/source/office/asyncfilepicker.hxx
index 2174eb5..bd40153 100644
--- a/fpicker/source/office/asyncfilepicker.hxx
+++ b/fpicker/source/office/asyncfilepicker.hxx
@@ -28,7 +28,7 @@
#include <vcl/vclptr.hxx>
class SvtFileView;
-class SvtFileDialog;
+class SvtFileDialog_Base;
typedef ::com::sun::star::uno::Sequence< OUString > OUStringList;
@@ -54,13 +54,13 @@ namespace svt
private:
Action m_eAction;
VclPtr<SvtFileView> m_pView;
- VclPtr<SvtFileDialog> m_pDialog;
+ VclPtr<SvtFileDialog_Base> m_pDialog;
OUString m_sURL;
OUString m_sFileName;
bool m_bRunning;
public:
- AsyncPickerAction( SvtFileDialog* _pDialog, SvtFileView* _pView, const Action _eAction );
+ AsyncPickerAction( SvtFileDialog_Base* _pDialog, SvtFileView* _pView, const Action _eAction );
/** executes the action
diff --git a/fpicker/source/office/fpdialogbase.hxx b/fpicker/source/office/fpdialogbase.hxx
index 7812737..19a26a4 100644
--- a/fpicker/source/office/fpdialogbase.hxx
+++ b/fpicker/source/office/fpdialogbase.hxx
@@ -82,13 +82,20 @@ public:
virtual std::vector<OUString> GetPathList() const = 0;
virtual bool ContentIsFolder( const OUString& rURL ) = 0;
+ virtual OUString getCurrentFileText() const = 0;
+ virtual void setCurrentFileText( const OUString& rText, bool bSelectAll = false ) = 0;
+
virtual void AddFilter( const OUString& rFilter, const OUString& rType ) = 0;
virtual void AddFilterGroup( const OUString& _rFilter,
const com::sun::star::uno::Sequence< com::sun::star::beans::StringPair >& rFilters ) = 0;
virtual OUString GetCurFilter() const = 0;
virtual void SetCurFilter( const OUString& rFilter ) = 0;
+ virtual void FilterSelect() = 0;
virtual void SetFileCallback( ::svt::IFilePickerListener *pNotifier ) = 0;
+ virtual void onAsyncOperationStarted() = 0;
+ virtual void onAsyncOperationFinished() = 0;
+ virtual void UpdateControls( const OUString& rURL ) = 0;
virtual void EnableAutocompletion( bool _bEnable = true ) = 0;
diff --git a/fpicker/source/office/iodlg.hxx b/fpicker/source/office/iodlg.hxx
index 5748210..3856139 100644
--- a/fpicker/source/office/iodlg.hxx
+++ b/fpicker/source/office/iodlg.hxx
@@ -178,7 +178,7 @@ public:
virtual void StartExecuteModal( const Link<>& rEndDialogHdl ) SAL_OVERRIDE;
void FileSelect();
- void FilterSelect();
+ void FilterSelect() SAL_OVERRIDE;
void SetBlackList( const ::com::sun::star::uno::Sequence< OUString >& rBlackList ) SAL_OVERRIDE;
const ::com::sun::star::uno::Sequence< OUString >& GetBlackList() const SAL_OVERRIDE;
@@ -207,7 +207,7 @@ public:
SvtFileView* GetView() SAL_OVERRIDE;
void InitSize();
- void UpdateControls( const OUString& rURL );
+ void UpdateControls( const OUString& rURL ) SAL_OVERRIDE;
void EnableAutocompletion( bool _bEnable = true ) SAL_OVERRIDE;
void SetFileCallback( ::svt::IFilePickerListener *pNotifier ) SAL_OVERRIDE { _pFileNotifier = pNotifier; }
@@ -219,11 +219,11 @@ public:
bool getShowState() SAL_OVERRIDE;
bool isAutoExtensionEnabled();
- OUString getCurrentFileText( ) const;
- void setCurrentFileText( const OUString& _rText, bool _bSelectAll = false );
+ OUString getCurrentFileText( ) const SAL_OVERRIDE;
+ void setCurrentFileText( const OUString& _rText, bool _bSelectAll = false ) SAL_OVERRIDE;
- void onAsyncOperationStarted();
- void onAsyncOperationFinished();
+ void onAsyncOperationStarted() SAL_OVERRIDE;
+ void onAsyncOperationFinished() SAL_OVERRIDE;
void RemovablePlaceSelected(bool enable = true);
diff --git a/include/svtools/breadcrumb.hxx b/include/svtools/breadcrumb.hxx
index 6e6ac5f..ddd377d 100644
--- a/include/svtools/breadcrumb.hxx
+++ b/include/svtools/breadcrumb.hxx
@@ -35,6 +35,7 @@ class SVT_DLLPUBLIC Breadcrumb : public VclHBox
OUString m_sRootName;
OUString m_sClickedURL;
+ OUString m_aCurrentURL;
SvtBreadcrumbMode m_eMode;
@@ -50,6 +51,7 @@ class SVT_DLLPUBLIC Breadcrumb : public VclHBox
virtual ~Breadcrumb();
void dispose() SAL_OVERRIDE;
+ void EnableFields( bool bEnable );
void SetClickHdl( const Link<>& rLink );
OUString GetHdlURL();
diff --git a/svtools/source/control/breadcrumb.cxx b/svtools/source/control/breadcrumb.cxx
index f1725e9..5ae725d 100644
--- a/svtools/source/control/breadcrumb.cxx
+++ b/svtools/source/control/breadcrumb.cxx
@@ -32,6 +32,17 @@ void Breadcrumb::dispose()
VclHBox::dispose();
}
+void Breadcrumb::EnableFields( bool bEnable )
+{
+ VclHBox::Enable( bEnable, true );
+ if( bEnable )
+ {
+ INetURLObject aURL( m_aCurrentURL );
+ int nSegments = aURL.getSegmentCount();
+ m_aLinks[nSegments]->Enable( false );
+ }
+}
+
void Breadcrumb::SetClickHdl( const Link<>& rLink )
{
m_aClickHdl = rLink;
@@ -59,6 +70,7 @@ void Breadcrumb::SetRootName( const OUString& rURL )
void Breadcrumb::SetURL( const OUString& rURL )
{
+ m_aCurrentURL = rURL;
INetURLObject aURL( rURL );
aURL.setFinalSlash();
commit b2a3ba4019e7e4ae696ecbe9920dc8f8e59a31fa
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Thu Jul 23 10:54:44 2015 +0200
fixed crash
While opening folders in SvtFileView using doubleclick,
sometimes GtkSalFrame::gestureLongPress method is
executed with a null frame pointer and LO crashes.
I noticed this only with remote dirs, probably this
bug occurs only when the doubleclick handler routine
takes a lot of time.
Change-Id: I432046994b3e1662bd7e499681bd20e9696b2d52
diff --git a/vcl/unx/gtk/window/gtksalframe.cxx b/vcl/unx/gtk/window/gtksalframe.cxx
index 5944b6b..6280d37 100644
--- a/vcl/unx/gtk/window/gtksalframe.cxx
+++ b/vcl/unx/gtk/window/gtksalframe.cxx
@@ -3540,15 +3540,18 @@ void GtkSalFrame::gestureLongPress(GtkGestureLongPress* gesture, gpointer frame)
{
GtkSalFrame* pThis = static_cast<GtkSalFrame*>(frame);
- SalLongPressEvent aEvent;
+ if(pThis)
+ {
+ SalLongPressEvent aEvent;
- gdouble x, y;
- GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
- gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y);
- aEvent.mnX = x;
- aEvent.mnY = y;
+ gdouble x, y;
+ GdkEventSequence *sequence = gtk_gesture_single_get_current_sequence(GTK_GESTURE_SINGLE(gesture));
+ gtk_gesture_get_point(GTK_GESTURE(gesture), sequence, &x, &y);
+ aEvent.mnX = x;
+ aEvent.mnY = y;
- pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent);
+ pThis->CallCallback(SALEVENT_LONGPRESS, &aEvent);
+ }
}
#endif
commit 2761a2b6d355634a25411cdb081b9ad97fadc97c
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Wed Jul 22 17:20:26 2015 +0200
show error when directory doesn't exist
Change-Id: I1c8ca1a509c9187687079d86f0e637b26490a7a3
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index bd35802..4e69c9d 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -462,7 +462,7 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
if( m_pFileView )
{
- if( ContentIsFolder( sURL ) )
+ if( !sURL.isEmpty() && ContentIsFolder( sURL ) )
{
OUString sFilter = FILEDIALOG_FILTER_ALL;
@@ -496,6 +496,9 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
else
{
// content doesn't exist
+ m_pTreeView->EndSelection();
+ ErrorHandler::HandleError( ERRCODE_IO_NOTEXISTS );
+ return eFailure;
}
}
@@ -689,13 +692,13 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
{
OUString sURL = m_pFileView->GetCurrentURL();
- if( ContentIsFolder( sURL ) )
+ if( ContentIsDocument( sURL ) )
{
- OpenURL( sURL );
+ EndDialog( RET_OK );
}
else
{
- EndDialog( RET_OK );
+ OpenURL( sURL );
}
}
@@ -1043,6 +1046,26 @@ bool RemoteFilesDialog::ContentIsFolder( const OUString& rURL )
return false;
}
+bool RemoteFilesDialog::ContentIsDocument( const OUString& rURL )
+{
+ try
+ {
+ Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
+ Reference< XInteractionHandler > xInteractionHandler(
+ InteractionHandler::createWithParent( xContext, 0 ), UNO_QUERY_THROW );
+ Reference< XCommandEnvironment > xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
+ ::ucbhelper::Content aContent( rURL, xEnv, xContext );
+
+ return aContent.isDocument();
+ }
+ catch( const Exception& )
+ {
+ // a content doesn't exist
+ }
+
+ return false;
+}
+
sal_Int32 RemoteFilesDialog::getTargetColorDepth()
{
// This dialog doesn't contain preview
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index ede30c7..b0f151e 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -16,6 +16,7 @@
#include <svtools/breadcrumb.hxx>
#include <svtools/fileview.hxx>
+#include <tools/errinf.hxx>
#include <tools/resid.hxx>
#include <vcl/button.hxx>
@@ -81,6 +82,7 @@ public:
virtual const OUString& GetPath() SAL_OVERRIDE;
virtual std::vector<OUString> GetPathList() const SAL_OVERRIDE;
virtual bool ContentIsFolder( const OUString& rURL ) SAL_OVERRIDE;
+ virtual bool ContentIsDocument( const OUString& rURL );
virtual void AddFilter( const OUString& rFilter, const OUString& rType ) SAL_OVERRIDE;
virtual void AddFilterGroup( const OUString& _rFilter,
commit fa99875715f0ee3e69a3c66e31625e1ed4aa4d18
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Wed Jul 22 16:42:47 2015 +0200
reload content while expanding node
Change-Id: I7ce281ea4e2d5c5c9fc0b2b3f315defc14364df3
diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index 63cc7e0..d597168 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -32,9 +32,14 @@ void FolderTree::RequestingChildren( SvTreeListEntry* pEntry )
void FolderTree::FillTreeEntry( SvTreeListEntry* pEntry )
{
- // fill only empty entries
- if( pEntry && GetChildCount( pEntry ) == 0 )
+ if( pEntry )
{
+ while( GetChildCount( pEntry ) > 0 )
+ {
+ SvTreeListEntry* pChild = FirstChild( pEntry );
+ GetModel()->Remove( pChild );
+ }
+
::std::vector< SortingData_Impl* > aContent;
::rtl::Reference< ::svt::FileViewContentEnumerator >
commit 366631f0ab87cac013189c6cff09a8130e427e1d
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Wed Jul 22 15:19:37 2015 +0200
check if path exist before init of the fileview
Change-Id: I0c9384644cf5aabf83512c341d3ffff5d4847f36
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 75615d1..bd35802 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -462,34 +462,41 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
if( m_pFileView )
{
- OUString sFilter = FILEDIALOG_FILTER_ALL;
-
- if( m_nCurrentFilter != LISTBOX_ENTRY_NOTFOUND )
+ if( ContentIsFolder( sURL ) )
{
- sFilter = m_aFilters[m_nCurrentFilter].second;
- }
+ OUString sFilter = FILEDIALOG_FILTER_ALL;
- m_pFileView->EndInplaceEditing( false );
+ if( m_nCurrentFilter != LISTBOX_ENTRY_NOTFOUND )
+ {
+ sFilter = m_aFilters[m_nCurrentFilter].second;
+ }
- EnableChildPointerOverwrite( true );
- SetPointer( PointerStyle::Wait );
+ m_pFileView->EndInplaceEditing( false );
- eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
+ EnableChildPointerOverwrite( true );
+ SetPointer( PointerStyle::Wait );
- if( eResult == eSuccess )
- {
- m_pPath->SetURL( sURL );
+ eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
- m_pTreeView->SetSelectHdl( Link<>() );
- m_pTreeView->SetTreePath( sURL );
- m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
+ if( eResult == eSuccess )
+ {
+ m_pPath->SetURL( sURL );
- m_bIsConnected = true;
- EnableControls();
- }
+ m_pTreeView->SetSelectHdl( Link<>() );
+ m_pTreeView->SetTreePath( sURL );
+ m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
+
+ m_bIsConnected = true;
+ EnableControls();
+ }
- SetPointer( PointerStyle::Arrow );
- EnableChildPointerOverwrite( false );
+ SetPointer( PointerStyle::Arrow );
+ EnableChildPointerOverwrite( false );
+ }
+ else
+ {
+ // content doesn't exist
+ }
}
return eResult;
commit 8a34ac372be8be379d71c5ae2490d34c07f6152d
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Wed Jul 22 14:06:52 2015 +0200
Breadcrumb: clear all fields after changing root
Change-Id: I8cefc8f755234cb4b63ca3a414402469df0394e1
diff --git a/svtools/source/control/breadcrumb.cxx b/svtools/source/control/breadcrumb.cxx
index 564c968..f1725e9 100644
--- a/svtools/source/control/breadcrumb.cxx
+++ b/svtools/source/control/breadcrumb.cxx
@@ -45,6 +45,16 @@ OUString Breadcrumb::GetHdlURL()
void Breadcrumb::SetRootName( const OUString& rURL )
{
m_sRootName = rURL;
+
+ // we changed root - clear all fields
+ for( std::vector<VclPtr<FixedHyperlink>>::size_type i = 1; i < m_aLinks.size(); i++ )
+ {
+ m_aLinks[i]->SetText( "" );
+
+ m_aLinks[i]->Hide();
+ m_aSeparators[i]->Hide();
+ m_aLinks[i]->Enable( true );
+ }
}
void Breadcrumb::SetURL( const OUString& rURL )
commit 5492f7b480656849f9c6d31dd841e9f993260338
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Jul 21 17:21:57 2015 +0200
Open/Save Remote File in Impress/Draw toolbars and menu
Change-Id: I9503f5beaa8b5a6afc213747a691265acd5903f7
diff --git a/sd/source/ui/app/sddll.cxx b/sd/source/ui/app/sddll.cxx
index fe9e58a5..1564f37 100644
--- a/sd/source/ui/app/sddll.cxx
+++ b/sd/source/ui/app/sddll.cxx
@@ -243,6 +243,8 @@ void SdDLL::RegisterControllers()
SvxFrameLineStyleToolBoxControl::RegisterControl(SID_FRAME_LINESTYLE, pMod );
SvxColorToolBoxControl::RegisterControl(SID_FRAME_LINECOLOR, pMod );
SvxFrameToolBoxControl::RegisterControl(SID_ATTR_BORDER, pMod );
+
+ SfxSaveAsToolBoxControl::RegisterControl(SID_SAVEASDOC, pMod );
}
void SdDLL::Init()
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml b/sd/uiconfig/sdraw/menubar/menubar.xml
index bc8cfee..c1a9be9 100644
--- a/sd/uiconfig/sdraw/menubar/menubar.xml
+++ b/sd/uiconfig/sdraw/menubar/menubar.xml
@@ -21,6 +21,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:AddDirect"/>
<menu:menuitem menu:id=".uno:Open"/>
+ <menu:menuitem menu:id=".uno:OpenRemote"/>
<menu:menuitem menu:id=".uno:RecentFileList"/>
<menu:menuseparator/>
<menu:menuitem menu:id=".uno:AutoPilotMenu"/>
@@ -36,6 +37,7 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveACopy"/>
+ <menu:menuitem menu:id=".uno:SaveAsRemote"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuitem menu:id=".uno:CancelCheckOut"/>
diff --git a/sd/uiconfig/sdraw/toolbar/standardbar.xml b/sd/uiconfig/sdraw/toolbar/standardbar.xml
index 06c7d5d..6e2d1fa 100644
--- a/sd/uiconfig/sdraw/toolbar/standardbar.xml
+++ b/sd/uiconfig/sdraw/toolbar/standardbar.xml
@@ -22,8 +22,9 @@
<toolbar:toolbaritem xlink:href=".uno:AddDirect" toolbar:helpid="5537"/>
<toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false" toolbar:helpid="5500"/>
<toolbar:toolbaritem xlink:href=".uno:Open" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:OpenRemote"/>
<toolbar:toolbaritem xlink:href=".uno:Save" toolbar:helpid="5505"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:helpid="5502"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:style="dropdown" toolbar:helpid="5502"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false" toolbar:helpid="5331"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:helpid="6312" toolbar:visible="false"/>
diff --git a/sd/uiconfig/simpress/menubar/menubar.xml b/sd/uiconfig/simpress/menubar/menubar.xml
index 3eb5156..71146c2 100644
--- a/sd/uiconfig/simpress/menubar/menubar.xml
+++ b/sd/uiconfig/simpress/menubar/menubar.xml
@@ -21,6 +21,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:AddDirect"/>
<menu:menuitem menu:id=".uno:Open"/>
+ <menu:menuitem menu:id=".uno:OpenRemote"/>
<menu:menuitem menu:id=".uno:RecentFileList"/>
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuseparator/>
@@ -38,6 +39,7 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveACopy"/>
+ <menu:menuitem menu:id=".uno:SaveAsRemote"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuitem menu:id=".uno:CancelCheckOut"/>
diff --git a/sd/uiconfig/simpress/toolbar/standardbar.xml b/sd/uiconfig/simpress/toolbar/standardbar.xml
index c82ad6a..a83b414 100644
--- a/sd/uiconfig/simpress/toolbar/standardbar.xml
+++ b/sd/uiconfig/simpress/toolbar/standardbar.xml
@@ -22,8 +22,9 @@
<toolbar:toolbaritem xlink:href=".uno:AddDirect" toolbar:style="dropdown"/>
<toolbar:toolbaritem xlink:href=".uno:NewDoc" toolbar:visible="false"/>
<toolbar:toolbaritem xlink:href=".uno:Open" toolbar:style="dropdown"/>
+ <toolbar:toolbaritem xlink:href=".uno:OpenRemote"/>
<toolbar:toolbaritem xlink:href=".uno:Save"/>
- <toolbar:toolbaritem xlink:href=".uno:SaveAs"/>
+ <toolbar:toolbaritem xlink:href=".uno:SaveAs" toolbar:style="dropdown"/>
<toolbar:toolbaritem xlink:href=".uno:SendMail" toolbar:visible="false"/>
<toolbar:toolbarseparator/>
<toolbar:toolbaritem xlink:href=".uno:EditDoc" toolbar:visible="false"/>
commit 92034cd5b0551f708a6231dac0f23b046a10faed
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Jul 21 16:45:00 2015 +0200
set pointer to Wait while reading url
Change-Id: I3c0786f8fb20df368cc7c03e35deba51d7ebbecd
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index f618965..75615d1 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -470,6 +470,10 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
}
m_pFileView->EndInplaceEditing( false );
+
+ EnableChildPointerOverwrite( true );
+ SetPointer( PointerStyle::Wait );
+
eResult = m_pFileView->Initialize( sURL, sFilter, NULL, GetBlackList() );
if( eResult == eSuccess )
@@ -483,6 +487,9 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
m_bIsConnected = true;
EnableControls();
}
+
+ SetPointer( PointerStyle::Arrow );
+ EnableChildPointerOverwrite( false );
}
return eResult;
commit e991a738ba97db387f60ef80b3fbbdee7c4d9db9
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Jul 21 15:50:09 2015 +0200
select recently added service
Change-Id: I55a32eef4a5eb3b9f57cf6d1b8f3cba5a9a14c55
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 47d2ddf..f618965 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -551,6 +551,7 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, AddServiceHdl )
m_pServices_lb->InsertEntry( sPrefix + newService->GetName() );
m_pServices_lb->SelectEntryPos( m_pServices_lb->GetEntryCount() - 1 );
+ SelectServiceHdl( NULL );
m_bIsUpdated = true;
commit d9f7d928704711289fb6079669a0a9994b1b432a
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Jul 21 15:39:08 2015 +0200
automatically select last used service
Change-Id: Ic66517cd65c28bd7e62e38796cf8580ed31305f7
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index d2e3cc5..47d2ddf 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -325,6 +325,11 @@ short RemoteFilesDialog::Execute()
Show();
AddServiceHdl( NULL );
}
+ if( m_pServices_lb->GetEntryCount() > 0 )
+ {
+ Show();
+ SelectServiceHdl( NULL );
+ }
short nRet = SvtFileDialog_Base::Execute();
commit 55d15a37be90dde071abb4fd351eaf32ea3f34c0
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Jul 21 13:28:46 2015 +0200
avoid multiple recursive opening the same url, cleaning
Change-Id: I8a3ae75a64ffcc4879af3e3591b3b433cee1678d
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 7f0447a..d2e3cc5 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -470,7 +470,10 @@ FileViewResult RemoteFilesDialog::OpenURL( OUString const & sURL )
if( eResult == eSuccess )
{
m_pPath->SetURL( sURL );
+
+ m_pTreeView->SetSelectHdl( Link<>() );
m_pTreeView->SetTreePath( sURL );
+ m_pTreeView->SetSelectHdl( LINK( this, RemoteFilesDialog, TreeSelectHdl ) );
m_bIsConnected = true;
EnableControls();
@@ -662,24 +665,17 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
{
- SvTreeListEntry* pEntry = m_pFileView->FirstSelected();
-
- if( pEntry )
+ if( m_pFileView->GetSelectionCount() )
{
- SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
+ OUString sURL = m_pFileView->GetCurrentURL();
- if( pData )
+ if( ContentIsFolder( sURL ) )
{
- if( pData->mbIsFolder )
- {
- OUString sURL = m_pFileView->GetCurrentURL();
-
- OpenURL( sURL );
- }
- else
- {
- EndDialog( RET_OK );
- }
+ OpenURL( sURL );
+ }
+ else
+ {
+ EndDialog( RET_OK );
}
}
commit 20f952aff45e8678d7e374b8b523c47d24414eb8
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Jul 21 12:35:19 2015 +0200
don't take full email address as a username
Change-Id: Ibc8f951dc3281b0b1d0f4b6783af0dbe2fb75da0
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index cb90be7..125a817 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -198,7 +198,13 @@ void PlaceEditDialog::UpdateLabel( )
if( !m_pEDUsername->GetText().isEmpty( ) )
{
OUString sLabel = SvtResId( STR_SVT_DEFAULT_SERVICE_LABEL );
- sLabel = sLabel.replaceFirst( "$user$", m_pEDUsername->GetText() );
+ OUString sUser = m_pEDUsername->GetText();
+
+ int nLength = sUser.indexOf( '@' );
+ if( nLength < 0 )
+ nLength = sUser.getLength();
+
+ sLabel = sLabel.replaceFirst( "$user$", sUser.copy( 0, nLength ) );
sLabel = sLabel.replaceFirst( "$service$", m_pLBServerType->GetSelectEntry() );
m_pEDServerName->SetText( sLabel );
commit 853354d4e0a7b4f317f07c3ede2961bd307eabec
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Jul 21 11:59:45 2015 +0200
FolderTree: expanded folder icon
Change-Id: If5956b61dec2f00f9233e8f4906bdb9b6f22571d
diff --git a/icon-themes/breeze/links.txt b/icon-themes/breeze/links.txt
index 7ba9f85..9475368 100644
--- a/icon-themes/breeze/links.txt
+++ b/icon-themes/breeze/links.txt
@@ -126,3 +126,6 @@ cmd/sc_showgraphics.png cmd/sc_graphic.png
# split cells duplicates
svx/res/zetlhor2.png /sw/res/zetlhor2.png
svx/res/zetlver2.png /sw/res/zetlver2.png
+
+# FolderTree expanded icon
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/galaxy/links.txt b/icon-themes/galaxy/links.txt
index 2e42f11..6a68faf 100644
--- a/icon-themes/galaxy/links.txt
+++ b/icon-themes/galaxy/links.txt
@@ -81,3 +81,6 @@ cmd/lc_charbackcolor.png cmd/lc_backcolor.png
# Toggle graphics visibility in Writer
cmd/sc_showgraphics.png cmd/sc_graphic.png
+
+# FolderTree expanded icon
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/hicontrast/links.txt b/icon-themes/hicontrast/links.txt
index 3c9fd17..ea11b2a 100644
--- a/icon-themes/hicontrast/links.txt
+++ b/icon-themes/hicontrast/links.txt
@@ -5,3 +5,7 @@ cmd/sc_linespacing.png cmd/sc_spacepara15.png
# text background colour Impress/Draw
cmd/sc_charbackcolor.png cmd/sc_backcolor.png
cmd/lc_charbackcolor.png cmd/lc_backcolor.png
+
+# FolderTree icons
+svtools/res/folder.png formula/res/fapclose.png
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/human/links.txt b/icon-themes/human/links.txt
index 3e7c8a7..5b1aca0 100644
--- a/icon-themes/human/links.txt
+++ b/icon-themes/human/links.txt
@@ -8,3 +8,6 @@ cmd/sc_linespacing.png cmd/sc_spacepara15.png
# text background colour Impress/Draw
cmd/sc_charbackcolor.png cmd/sc_backcolor.png
cmd/lc_charbackcolor.png cmd/lc_backcolor.png
+
+# FolderTree expanded icon
+svtools/res/folderop.png formula/res/fapopen.png
diff --git a/icon-themes/tango/links.txt b/icon-themes/tango/links.txt
index 2fc1b96..672e153 100644
--- a/icon-themes/tango/links.txt
+++ b/icon-themes/tango/links.txt
@@ -383,6 +383,7 @@ res/sc10712.png cmd/sc_sortdescending.png
res/reload.png cmd/sc_reload.png
res/sc05501.png cmd/sc_open.png
svtools/res/folder.png formula/res/fapclose.png
+svtools/res/folderop.png formula/res/fapopen.png
fpicker/res/fp011.png res/sc06303.png
sfx2/res/styfam1.png sw/imglst/sf01.png
sfx2/res/styfam2.png sw/imglst/sf02.png
diff --git a/include/svtools/foldertree.hxx b/include/svtools/foldertree.hxx
index e430072..4be22b9 100644
--- a/include/svtools/foldertree.hxx
+++ b/include/svtools/foldertree.hxx
@@ -40,6 +40,7 @@ private:
::osl::Mutex m_aMutex;
Sequence< OUString > m_aBlackList;
Image m_aFolderImage;
+ Image m_aFolderExpandedImage;
public:
FolderTree( vcl::Window* pParent, WinBits nBits );
diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index 5ddb4dd..570809b 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -263,6 +263,7 @@
#define IMG_TRIANGLE_DOWN (RID_SVTOOLS_START + 20)
#define IMG_SVT_FOLDER (RID_SVTOOLS_START + 42)
+#define IMG_SVT_FOLDER_OPEN (RID_SVTOOLS_START + 43)
#define RID_IMG_PRNDLG_NOCOLLATE (STR_SVT_PRNDLG_START + 30)
diff --git a/svtools/source/contnr/fileview.src b/svtools/source/contnr/fileview.src
index c645737..54119f3 100644
--- a/svtools/source/contnr/fileview.src
+++ b/svtools/source/contnr/fileview.src
@@ -76,6 +76,12 @@ Image IMG_SVT_FOLDER
MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
};
+Image IMG_SVT_FOLDER_OPEN
+{
+ ImageBitmap = Bitmap { File = "folderop.png" ; };
+ MaskColor = Color { Red = 0xFFFF ; Green = 0x0000 ; Blue = 0xFFFF ; };
+};
+
// Menus -----------------------------------------------------------------
Menu RID_FILEVIEW_CONTEXTMENU
diff --git a/svtools/source/contnr/foldertree.cxx b/svtools/source/contnr/foldertree.cxx
index 50df76b..63cc7e0 100644
--- a/svtools/source/contnr/foldertree.cxx
+++ b/svtools/source/contnr/foldertree.cxx
@@ -14,6 +14,7 @@
FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits )
: SvTreeListBox( pParent, nBits | WB_SORT | WB_TABSTOP )
, m_aFolderImage( SvtResId( IMG_SVT_FOLDER ) )
+ , m_aFolderExpandedImage( SvtResId( IMG_SVT_FOLDER_OPEN ) )
{
Reference< XComponentContext > xContext = ::comphelper::getProcessComponentContext();
Reference< XInteractionHandler > xInteractionHandler(
@@ -21,7 +22,7 @@ FolderTree::FolderTree( vcl::Window* pParent, WinBits nBits )
m_xEnv = new ::ucbhelper::CommandEnvironment( xInteractionHandler, Reference< XProgressHandler >() );
SetDefaultCollapsedEntryBmp( m_aFolderImage );
- SetDefaultExpandedEntryBmp( m_aFolderImage );
+ SetDefaultExpandedEntryBmp( m_aFolderExpandedImage );
}
void FolderTree::RequestingChildren( SvTreeListEntry* pEntry )
commit e03aa96fda65d831a6ecb961e7529ef5d268f1a2
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Tue Jul 21 09:40:49 2015 +0200
check pointers
Change-Id: Iacf9213d833a0a3c2d951c667108a5e2538f4215
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 1662758..7f0447a 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -689,30 +689,35 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, DoubleClickHdl )
IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl )
{
SvTreeListEntry* pEntry = m_pFileView->FirstSelected();
- if (!pEntry)
- return 1;
- SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
- if( ( pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_PATHDLG ) )
- || ( !pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_FILEDLG ) ) )
+ if( pEntry )
{
- // url must contain user info, because we need this info in recent files entry
- // (to fill user field in login box by default)
- INetURLObject aURL( pData->maURL );
- INetURLObject aCurrentURL( m_sLastServiceUrl );
- aURL.SetUser( aCurrentURL.GetUser() );
+ SvtContentEntry* pData = static_cast< SvtContentEntry* >( pEntry->GetUserData() );
- m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
+ if( pData )
+ {
+ if( ( pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_PATHDLG ) )
+ || ( !pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_FILEDLG ) ) )
+ {
+ // url must contain user info, because we need this info in recent files entry
+ // (to fill user field in login box by default)
+ INetURLObject aURL( pData->maURL );
+ INetURLObject aCurrentURL( m_sLastServiceUrl );
+ aURL.SetUser( aCurrentURL.GetUser() );
- m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) );
- }
- else
- {
- m_sPath.clear();
- m_pName_ed->SetText( "" );
- }
+ m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
- EnableControls();
+ m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) );
+ }
+ else
+ {
+ m_sPath.clear();
+ m_pName_ed->SetText( "" );
+ }
+
+ EnableControls();
+ }
+ }
return 1;
}
commit 1d628c59d832d0af49a1e86035855ec495845d75
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Jul 20 16:01:09 2015 +0200
default label for service
Change-Id: Iad4ad161765c943a035dcc15232c4dcbef1cc68c
diff --git a/include/svtools/PlaceEditDialog.hxx b/include/svtools/PlaceEditDialog.hxx
index b601b9b..e492978 100644
--- a/include/svtools/PlaceEditDialog.hxx
+++ b/include/svtools/PlaceEditDialog.hxx
@@ -53,7 +53,9 @@ private:
unsigned int m_nCurrentType;
-public:
+ bool bLabelChanged;
+
+public :
PlaceEditDialog( vcl::Window* pParent);
PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Place> &rPlace );
@@ -69,11 +71,13 @@ public:
private:
void InitDetails( );
+ void UpdateLabel( );
DECL_LINK ( OKHdl, Button * );
DECL_LINK ( DelHdl, Button * );
DECL_LINK ( EditHdl, void * );
DECL_LINK ( SelectTypeHdl, void * );
+ DECL_LINK ( EditLabelHdl, void * );
DECL_LINK ( EditUsernameHdl, void * );
};
diff --git a/include/svtools/svtools.hrc b/include/svtools/svtools.hrc
index 23cf007..5ddb4dd 100644
--- a/include/svtools/svtools.hrc
+++ b/include/svtools/svtools.hrc
@@ -51,6 +51,9 @@
#define STR_SVT_ESTIMATED_SIZE_VEC (RID_SVTOOLS_START + 41)
// FREE
+
+#define STR_SVT_DEFAULT_SERVICE_LABEL (RID_SVTOOLS_START+57)
+
#define STRARY_SVT_DOCINFO (RID_SVTOOLS_START+58)
#define STR_BASICKEY_FORMAT_ON (RID_SVTOOLS_START+103)
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 15034dd..cb90be7 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -13,6 +13,7 @@
#include <com/sun/star/uno/Sequence.hxx>
#include <officecfg/Office/Common.hxx>
#include <svtools/svtresid.hxx>
+#include <svtools/svtools.hrc>
#include <vcl/msgbox.hxx>
using namespace com::sun::star::uno;
@@ -21,6 +22,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
: ModalDialog(pParent, "PlaceEditDialog", "svt/ui/placeedit.ui")
, m_xCurrentDetails()
, m_nCurrentType( 0 )
+ , bLabelChanged( false )
{
get( m_pEDServerName, "name" );
get( m_pLBServerType, "type" );
@@ -33,7 +35,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
m_pBTOk->SetClickHdl( LINK( this, PlaceEditDialog, OKHdl) );
m_pBTOk->Enable( false );
- m_pEDServerName->SetModifyHdl( LINK( this, PlaceEditDialog, EditHdl) );
+ m_pEDServerName->SetModifyHdl( LINK( this, PlaceEditDialog, EditLabelHdl) );
// This constructor is called when user request a place creation, so
// delete button is hidden.
@@ -48,6 +50,7 @@ PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent)
PlaceEditDialog::PlaceEditDialog(vcl::Window* pParent, const std::shared_ptr<Place>& rPlace)
: ModalDialog(pParent, "PlaceEditDialog", "svt/ui/placeedit.ui")
, m_xCurrentDetails( )
+ , bLabelChanged( true )
{
get( m_pEDServerName, "name" );
get( m_pLBServerType, "type" );
@@ -188,6 +191,26 @@ void PlaceEditDialog::InitDetails( )
SelectTypeHdl( m_pLBServerType );
}
+void PlaceEditDialog::UpdateLabel( )
+{
+ if( !bLabelChanged )
+ {
+ if( !m_pEDUsername->GetText().isEmpty( ) )
+ {
+ OUString sLabel = SvtResId( STR_SVT_DEFAULT_SERVICE_LABEL );
+ sLabel = sLabel.replaceFirst( "$user$", m_pEDUsername->GetText() );
+ sLabel = sLabel.replaceFirst( "$service$", m_pLBServerType->GetSelectEntry() );
+
+ m_pEDServerName->SetText( sLabel );
+ bLabelChanged = false;
+ }
+ else
+ {
+ m_pEDServerName->SetText( m_pLBServerType->GetSelectEntry( ) );
+ }
+ }
+}
+
IMPL_LINK ( PlaceEditDialog, OKHdl, Button *, )
{
if ( m_xCurrentDetails.get() )
@@ -234,12 +257,22 @@ IMPL_LINK ( PlaceEditDialog, DelHdl, Button *, )
IMPL_LINK_NOARG( PlaceEditDialog, EditHdl )
{
+ UpdateLabel( );
+
OUString sUrl = GetServerUrl( );
OUString sName = OUString( m_pEDServerName->GetText() ).trim( );
m_pBTOk->Enable( !sName.isEmpty( ) && !sUrl.isEmpty( ) );
return 1;
}
+IMPL_LINK_NOARG( PlaceEditDialog, EditLabelHdl )
+{
+ bLabelChanged = true;
+ EditHdl(NULL);
+
+ return 1;
+}
+
IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl )
{
for ( std::vector< std::shared_ptr< DetailsContainer > >::iterator it = m_aDetailsContainers.begin( );
@@ -247,7 +280,9 @@ IMPL_LINK_NOARG( PlaceEditDialog, EditUsernameHdl )
{
( *it )->setUsername( OUString( m_pEDUsername->GetText() ) );
}
+
EditHdl(NULL);
+
return 1;
}
diff --git a/svtools/source/dialogs/filedlg2.src b/svtools/source/dialogs/filedlg2.src
index 6e68db0..795da0e 100644
--- a/svtools/source/dialogs/filedlg2.src
+++ b/svtools/source/dialogs/filedlg2.src
@@ -18,6 +18,7 @@
*/
#include <svtools/filedlg2.hrc>
+#include <svtools/svtools.hrc>
String STR_FILEDLG_OPEN
{
@@ -32,4 +33,9 @@ String STR_FILEDLG_SAVE
Text [ en-US ] = "Save" ;
};
+String STR_SVT_DEFAULT_SERVICE_LABEL
+{
+ Text [ en-US ] = "$user$'s $service$" ;
+};
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 4438d1bd2a7927d5f53c90ec43b70e12def693db
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Jul 20 14:26:41 2015 +0200
string: 'Remote File' -> 'Save Remote File...'
Change-Id: I30e664e6fa16cdcbdffa97c57905b73224d42636
diff --git a/framework/source/classes/resource.src b/framework/source/classes/resource.src
index 4f8ce0e..44e0c70 100644
--- a/framework/source/classes/resource.src
+++ b/framework/source/classes/resource.src
@@ -121,7 +121,7 @@ String STR_OPEN_REMOTE
String STR_REMOTE_FILE
{
- Text [ en-US ] = "Remote file";
+ Text [ en-US ] = "Save Remote File...";
};
String STR_TOOLBAR_TITLE_ADDON
commit 9cd1280cc58ce21cc19a01cd4aa0f8e0c01d6533
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Jul 20 14:19:54 2015 +0200
remember user name in recent files
Change-Id: I55b340e90d51b614b8f46c06e3dc1961b3bac2ba
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 28200bb..1662758 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -696,8 +696,13 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, SelectHdl )
if( ( pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_PATHDLG ) )
|| ( !pData->mbIsFolder && ( m_eType == REMOTEDLG_TYPE_FILEDLG ) ) )
{
+ // url must contain user info, because we need this info in recent files entry
+ // (to fill user field in login box by default)
INetURLObject aURL( pData->maURL );
- m_sPath = pData->maURL;
+ INetURLObject aCurrentURL( m_sLastServiceUrl );
+ aURL.SetUser( aCurrentURL.GetUser() );
+
+ m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
m_pName_ed->SetText( INetURLObject::decode( aURL.GetLastName(), INetURLObject::DECODE_WITH_CHARSET ) );
}
@@ -815,6 +820,14 @@ IMPL_LINK_NOARG ( RemoteFilesDialog, OkHdl )
m_sPath = sCurrentPath;
else
m_sPath = sSelectedItem;
+
+ // url must contain user info, because we need this info in recent files entry
+ // (to fill user field in login box by default)
+ INetURLObject aURL( m_sPath );
+ INetURLObject aCurrentURL( m_sLastServiceUrl );
+ aURL.SetUser( aCurrentURL.GetUser() );
+
+ m_sPath = aURL.GetMainURL( INetURLObject::NO_DECODE );
}
bool bExists = false;
@@ -973,7 +986,13 @@ std::vector<OUString> RemoteFilesDialog::GetPathList() const
while( pEntry )
{
- aList.push_back( SvtFileView::GetURL( pEntry ) );
+ // url must contain user info, because we need this info in recent files entry
+ // (to fill user field in login box by default)
+ INetURLObject aURL( SvtFileView::GetURL( pEntry ) );
+ INetURLObject aCurrentURL( m_sLastServiceUrl );
+ aURL.SetUser( aCurrentURL.GetUser() );
+
+ aList.push_back( aURL.GetMainURL( INetURLObject::NO_DECODE ) );
pEntry = m_pFileView->NextSelected( pEntry );
}
commit 12ca8db010a25eb41c041ddf9821ef194f72e7c7
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Jul 20 11:30:49 2015 +0200
Show 'Add service' dialog when there is no service added yet
Change-Id: I72d294e9c09b0d02b829b91fb188c1c7965d1d45
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index bb2587d..28200bb 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -318,6 +318,19 @@ void RemoteFilesDialog::Resize()
}
}
+short RemoteFilesDialog::Execute()
+{
+ if( m_pServices_lb->GetEntryCount() == 0 )
+ {
+ Show();
+ AddServiceHdl( NULL );
+ }
+
+ short nRet = SvtFileDialog_Base::Execute();
+
+ return nRet;
+}
+
OUString lcl_GetServiceType( ServicePtr pService )
{
INetProtocol aProtocol = pService->GetUrlObject().GetProtocol();
diff --git a/fpicker/source/office/RemoteFilesDialog.hxx b/fpicker/source/office/RemoteFilesDialog.hxx
index ba48b8e..ede30c7 100644
--- a/fpicker/source/office/RemoteFilesDialog.hxx
+++ b/fpicker/source/office/RemoteFilesDialog.hxx
@@ -64,6 +64,7 @@ public:
virtual void dispose() SAL_OVERRIDE;
virtual void Resize() SAL_OVERRIDE;
+ virtual short Execute() SAL_OVERRIDE;
OUString GetPath() const;
commit ca77a3424ef3555c22fe4be6ae18c32d7d32045c
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Mon Jul 20 10:04:09 2015 +0200
accessibility: correct tab-order
Change-Id: Ib554e8bb73367d5f85253f0deb083fbc5a5d454b
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 86be522..bb2587d 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -11,13 +11,22 @@
class FileViewContainer : public vcl::Window
{
+ enum FocusState
+ {
+ Prev = 0,
+ TreeView,
+ FileView,
+ Next,
+ FocusCount
+ };
+
private:
VclPtr< SvtFileView > m_pFileView;
VclPtr< FolderTree > m_pTreeView;
VclPtr< Splitter > m_pSplitter;
int m_nCurrentFocus;
- VclPtr<vcl::Window> m_pFocusWidgets[4];
+ VclPtr<vcl::Window> m_pFocusWidgets[FocusState::FocusCount];
public:
FileViewContainer( vcl::Window *pParent )
@@ -51,10 +60,10 @@ class FileViewContainer : public vcl::Window
m_pFileView = pFileView;
m_pTreeView = pTreeView;
m_pSplitter = pSplitter;
- m_pFocusWidgets[0] = pPrevSibling;
- m_pFocusWidgets[1] = pTreeView;
- m_pFocusWidgets[2] = pFileView;
- m_pFocusWidgets[3] = pNextSibling;
+ m_pFocusWidgets[FocusState::Prev] = pPrevSibling;
+ m_pFocusWidgets[FocusState::TreeView] = pTreeView;
+ m_pFocusWidgets[FocusState::FileView] = pFileView;
+ m_pFocusWidgets[FocusState::Next] = pNextSibling;
}
virtual void Resize() SAL_OVERRIDE
@@ -89,14 +98,20 @@ class FileViewContainer : public vcl::Window
if( !m_pFileView || !m_pTreeView )
return;
- if( !bReverse && m_nCurrentFocus < 3 )
+ if( bReverse && m_nCurrentFocus > FocusState::Prev && m_nCurrentFocus <= FocusState::Next )
{
- m_pFocusWidgets[++m_nCurrentFocus]->SetFakeFocus( true );
+ m_pFocusWidgets[m_nCurrentFocus]->SetFakeFocus(false);
+ m_pFocusWidgets[m_nCurrentFocus]->LoseFocus();
+
+ m_pFocusWidgets[--m_nCurrentFocus]->SetFakeFocus( true );
m_pFocusWidgets[m_nCurrentFocus]->GrabFocus();
}
- else if( m_nCurrentFocus > 0 )
+ else if( !bReverse && m_nCurrentFocus >= FocusState::Prev && m_nCurrentFocus < FocusState::Next )
{
- m_pFocusWidgets[--m_nCurrentFocus]->SetFakeFocus( true );
+ m_pFocusWidgets[m_nCurrentFocus]->SetFakeFocus(false);
+ m_pFocusWidgets[m_nCurrentFocus]->LoseFocus();
+
+ m_pFocusWidgets[++m_nCurrentFocus]->SetFakeFocus( true );
m_pFocusWidgets[m_nCurrentFocus]->GrabFocus();
}
}
@@ -106,13 +121,38 @@ class FileViewContainer : public vcl::Window
if( !m_pFileView || !m_pTreeView )
return;
- m_nCurrentFocus = 1;
- m_pFocusWidgets[m_nCurrentFocus]->SetFakeFocus( true );
- m_pFocusWidgets[m_nCurrentFocus]->GrabFocus();
+ GetFocusFlags aFlags = GetGetFocusFlags();
+
+ if( aFlags & GetFocusFlags::Forward )
+ m_nCurrentFocus = FocusState::TreeView;
+ else if( aFlags & GetFocusFlags::Backward )
+ m_nCurrentFocus = FocusState::FileView;
+
+ if( m_nCurrentFocus >= FocusState::Prev && m_nCurrentFocus <= FocusState::Next )
+ {
+ m_pFocusWidgets[m_nCurrentFocus]->SetFakeFocus( true );
+ m_pFocusWidgets[m_nCurrentFocus]->GrabFocus();
+ }
}
virtual bool Notify( NotifyEvent& rNEvt ) SAL_OVERRIDE
{
+ if( rNEvt.GetType() == MouseNotifyEvent::GETFOCUS )
+ {
+ // we must also update counter when user change focus using mouse
+ for(int i = FocusState::Prev; i <= FocusState::Next; i++)
+ {
+ if( rNEvt.GetWindow() == m_pFocusWidgets[i] )
+ {
+ m_nCurrentFocus = i;
+ return true;
+ }
+ }
+
+ // GETFOCUS for one of FileView's subcontrols
+ m_nCurrentFocus = FocusState::FileView;
+ return true;
+ }
if( rNEvt.GetType() == MouseNotifyEvent::KEYINPUT )
{
const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
commit a6b36fd899d814a460b69a9d488da89f45c34d78
Author: Maxim Monastirsky <momonasmon at gmail.com>
Date: Fri Jul 17 10:12:06 2015 +0300
Don't show open remote entry in the recent doc menu
We use the same menu controller for both the Open toolbar
button and the Recent Documents menu. While it's
reasonable to put the open remote file command under the
open button, it has nothing to do with recent documents,
so it shouldn't appear there.
Also don't add the "No Document" entry in case the open
remote entry is visible. The whole point of the "No
Document" entry is that we can't leave the menu empty,
but if there is another visible entry, it's not needed.
Change-Id: Ibefbdc6dc7d1d49f555d8ee23f67b47eba19b445
Signed-off-by: Szymon Kłos <eszkadev at gmail.com>
diff --git a/framework/source/uielement/recentfilesmenucontroller.cxx b/framework/source/uielement/recentfilesmenucontroller.cxx
index a2c3432..61d2f02 100644
--- a/framework/source/uielement/recentfilesmenucontroller.cxx
+++ b/framework/source/uielement/recentfilesmenucontroller.cxx
@@ -60,7 +60,8 @@ class RecentFilesMenuController : public svt::PopupMenuControllerBase
using svt::PopupMenuControllerBase::disposing;
public:
- RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext );
+ RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext,
+ const uno::Sequence< uno::Any >& args );
virtual ~RecentFilesMenuController();
// XServiceInfo
@@ -115,12 +116,25 @@ private:
std::vector< RecentFile > m_aRecentFilesItems;
bool m_bDisabled : 1;
+ bool m_bShowRemote;
};
-RecentFilesMenuController::RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext ) :
+RecentFilesMenuController::RecentFilesMenuController( const uno::Reference< uno::XComponentContext >& xContext,
+ const uno::Sequence< uno::Any >& args ) :
svt::PopupMenuControllerBase( xContext ),
- m_bDisabled( false )
+ m_bDisabled( false ),
+ m_bShowRemote( false )
{
+ css::beans::PropertyValue aPropValue;
+ for ( sal_Int32 i = 0; i < args.getLength(); ++i )
+ {
+ args[i] >>= aPropValue;
+ if ( aPropValue.Name == "ShowRemote" )
+ {
+ aPropValue.Value >>= m_bShowRemote;
+ break;
+ }
+ }
}
RecentFilesMenuController::~RecentFilesMenuController()
@@ -227,26 +241,30 @@ void RecentFilesMenuController::fillPopupMenu( Reference< css::awt::XPopupMenu >
FWK_RESSTR(STR_CLEAR_RECENT_FILES_HELP) );
// Open remote menu entry
- pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 2 ),
- FWK_RESSTR(STR_OPEN_REMOTE) );
- pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 2 ),
- OUString( CMD_OPEN_REMOTE ) );
+ if ( m_bShowRemote )
+ {
+ pVCLPopupMenu->InsertItem( sal_uInt16( nCount + 2 ),
+ FWK_RESSTR(STR_OPEN_REMOTE) );
+ pVCLPopupMenu->SetItemCommand( sal_uInt16( nCount + 2 ),
+ OUString( CMD_OPEN_REMOTE ) );
+ }
}
else
{
- // No recent documents => insert "no document" string
- pVCLPopupMenu->InsertItem( 1, FWK_RESSTR(STR_NODOCUMENT) );
- // Do not disable it, otherwise the Toolbar controller and MenuButton
- // will display SV_RESID_STRING_NOSELECTIONPOSSIBLE instead of STR_NODOCUMENT
- pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MenuItemBits::NOSELECT );
-
- pVCLPopupMenu->InsertSeparator();
-
- // Open remote menu entry
- pVCLPopupMenu->InsertItem( sal_uInt16( 2 ),
- FWK_RESSTR(STR_OPEN_REMOTE) );
- pVCLPopupMenu->SetItemCommand( sal_uInt16( 2 ),
- OUString( CMD_OPEN_REMOTE ) );
+ if ( m_bShowRemote )
+ {
+ // Open remote menu entry
+ pVCLPopupMenu->InsertItem( 1, FWK_RESSTR(STR_OPEN_REMOTE) );
+ pVCLPopupMenu->SetItemCommand( 1, CMD_OPEN_REMOTE );
+ }
+ else
+ {
+ // No recent documents => insert "no document" string
+ pVCLPopupMenu->InsertItem( 1, FWK_RESSTR(STR_NODOCUMENT) );
+ // Do not disable it, otherwise the Toolbar controller and MenuButton
+ // will display SV_RESID_STRING_NOSELECTIONPOSSIBLE instead of STR_NODOCUMENT
+ pVCLPopupMenu->SetItemBits( 1, pVCLPopupMenu->GetItemBits( 1 ) | MenuItemBits::NOSELECT );
+ }
}
}
}
@@ -444,9 +462,9 @@ IMPL_STATIC_LINK( RecentFilesMenuController, ExecuteHdl_Impl, LoadRecentFile*, p
extern "C" SAL_DLLPUBLIC_EXPORT css::uno::XInterface * SAL_CALL
com_sun_star_comp_framework_RecentFilesMenuController_get_implementation(
css::uno::XComponentContext *context,
- css::uno::Sequence<css::uno::Any> const &)
+ css::uno::Sequence<css::uno::Any> const &args)
{
- return cppu::acquire(new RecentFilesMenuController(context));
+ return cppu::acquire(new RecentFilesMenuController(context, args));
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/sfx2/source/toolbox/tbxitem.cxx b/sfx2/source/toolbox/tbxitem.cxx
index ed53d96..2906100 100644
--- a/sfx2/source/toolbox/tbxitem.cxx
+++ b/sfx2/source/toolbox/tbxitem.cxx
@@ -1153,6 +1153,10 @@ VclPtr<SfxPopupWindow> SfxRecentFilesToolBoxControl::CreatePopupWindow()
aPropValue.Value <<= m_xFrame;
aArgs[1] <<= aPropValue;
+ aPropValue.Name = "ShowRemote";
+ aPropValue.Value <<= true;
+ aArgs[2] <<= aPropValue;
+
uno::Reference< frame::XPopupMenuController > xPopupController( m_xContext->getServiceManager()->createInstanceWithArgumentsAndContext(
"com.sun.star.comp.framework.RecentFilesMenuController", aArgs, m_xContext ), UNO_QUERY );
@@ -1191,7 +1195,7 @@ VclPtr<SfxPopupWindow> SfxSaveAsToolBoxControl::CreatePopupWindow()
sal_uInt16 nItemId = GetId();
::Rectangle aRect( rBox.GetItemRect( nItemId ) );
- Sequence< Any > aArgs( 2 );
+ Sequence< Any > aArgs( 3 );
PropertyValue aPropValue;
aPropValue.Name = "CommandURL";
commit 0e9dc73bd76824435c12533836447e7839d9519f
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 17 12:09:05 2015 +0200
File > Save As Remote - Calc and Writer
Change-Id: I03dc6592015dea4b4c5e77650ec8378ee0853a63
diff --git a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
index a8d5d1f..3ee4ec3 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/GenericCommands.xcu
@@ -1972,6 +1972,14 @@
<value>1</value>
</prop>
</node>
+ <node oor:name=".uno:SaveAsRemote" oor:op="replace">
+ <prop oor:name="Label" oor:type="xs:string">
+ <value xml:lang="en-US">~Save As Remote File...</value>
+ </prop>
+ <prop oor:name="Properties" oor:type="xs:int">
+ <value>1</value>
+ </prop>
+ </node>
<node oor:name=".uno:CircleCut" oor:op="replace">
<prop oor:name="Label" oor:type="xs:string">
<value xml:lang="en-US">Circle Segment</value>
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index 8369c10..43d6392 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -40,6 +40,7 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveACopy"/>
+ <menu:menuitem menu:id=".uno:SaveAsRemote"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuitem menu:id=".uno:CancelCheckOut"/>
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index fd233cf..8300196 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -39,6 +39,7 @@
<menu:menuitem menu:id=".uno:Save"/>
<menu:menuitem menu:id=".uno:SaveAs"/>
<menu:menuitem menu:id=".uno:SaveACopy"/>
+ <menu:menuitem menu:id=".uno:SaveAsRemote"/>
<menu:menuitem menu:id=".uno:SaveAll"/>
<menu:menuitem menu:id=".uno:CheckOut"/>
<menu:menuitem menu:id=".uno:CancelCheckOut"/>
commit 42d00bbb983bc5cf0a4d978e393151c896e947e8
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 17 10:42:31 2015 +0200
Open Remote file in Calc's menubar
Change-Id: Ie0e98768724edca02cfe7dc9fda682ce125e1a9e
diff --git a/sc/uiconfig/scalc/menubar/menubar.xml b/sc/uiconfig/scalc/menubar/menubar.xml
index a474f98..8369c10 100644
--- a/sc/uiconfig/scalc/menubar/menubar.xml
+++ b/sc/uiconfig/scalc/menubar/menubar.xml
@@ -21,6 +21,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:AddDirect"/>
<menu:menuitem menu:id=".uno:OpenFromCalc"/>
+ <menu:menuitem menu:id=".uno:OpenRemote"/>
<menu:menuitem menu:id=".uno:RecentFileList"/>
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuseparator/>
commit 2e92c174984394858b8ab557ad28a67460355735
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 17 10:01:19 2015 +0200
Open Remote file in Writer's menubar
Change-Id: I5cda8661a44e4c33fab3263c17c1a7900241e70b
diff --git a/sw/uiconfig/swriter/menubar/menubar.xml b/sw/uiconfig/swriter/menubar/menubar.xml
index 7ae2617..fd233cf 100644
--- a/sw/uiconfig/swriter/menubar/menubar.xml
+++ b/sw/uiconfig/swriter/menubar/menubar.xml
@@ -21,6 +21,7 @@
<menu:menupopup>
<menu:menuitem menu:id=".uno:AddDirect"/>
<menu:menuitem menu:id=".uno:OpenFromWriter"/>
+ <menu:menuitem menu:id=".uno:OpenRemote"/>
<menu:menuitem menu:id=".uno:RecentFileList"/>
<menu:menuitem menu:id=".uno:CloseDoc"/>
<menu:menuseparator/>
commit 487ba7332e836189f3feffdf50097a764d9ef723
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 17 09:34:06 2015 +0200
Separator should not be the default selection
Change-Id: Id879e795d3b6722ca0d86f8f6a8a32b0ef6f12bd
diff --git a/svtools/source/dialogs/PlaceEditDialog.cxx b/svtools/source/dialogs/PlaceEditDialog.cxx
index 482b763..15034dd 100644
--- a/svtools/source/dialogs/PlaceEditDialog.cxx
+++ b/svtools/source/dialogs/PlaceEditDialog.cxx
@@ -140,7 +140,6 @@ void PlaceEditDialog::InitDetails( )
bool bSkipOneDrive= OUString( ONEDRIVE_CLIENT_ID ).isEmpty() ||
OUString( ONEDRIVE_CLIENT_SECRET ).isEmpty();
-
Sequence< OUString > aTypesUrlsList( officecfg::Office::Common::Misc::CmisServersUrls::get( xContext ) );
Sequence< OUString > aTypesNamesList( officecfg::Office::Common::Misc::CmisServersNames::get( xContext ) );
@@ -182,6 +181,10 @@ void PlaceEditDialog::InitDetails( )
// Set default to first value
m_pLBServerType->SelectEntryPos( 0 );
+
+ if ( m_pLBServerType->GetSelectEntry() == "--------------------" )
+ m_pLBServerType->SelectEntryPos( 1 );
+
SelectTypeHdl( m_pLBServerType );
}
commit a932092b8807a8ce45f6d0a6138eba63df1cc853
Author: Szymon Kłos <eszkadev at gmail.com>
Date: Fri Jul 17 08:46:31 2015 +0200
question if delete the service
Change-Id: I49e5a93ba1d58b898ec1c7b9a4682c9e86302bd0
diff --git a/fpicker/source/office/RemoteFilesDialog.cxx b/fpicker/source/office/RemoteFilesDialog.cxx
index 2fabadc..86be522 100644
--- a/fpicker/source/office/RemoteFilesDialog.cxx
+++ b/fpicker/source/office/RemoteFilesDialog.cxx
@@ -581,21 +581,26 @@ IMPL_LINK_TYPED ( RemoteFilesDialog, EditServiceMenuHdl, MenuButton *, pButton,
if( nPos >= 0 )
{
- // TODO: Confirm dialog
-
- m_aServices.erase( m_aServices.begin() + nPos );
- m_pServices_lb->RemoveEntry( nSelected );
+ OUString sMsg = ResId( STR_SVT_DELETESERVICE, *ResMgrHolder::getOrCreate() );
+ sMsg = sMsg.replaceFirst( "$servicename$", m_pServices_lb->GetSelectEntry() );
+ ScopedVclPtrInstance< MessageDialog > aBox( this, sMsg, VCL_MESSAGE_QUESTION, VCL_BUTTONS_YES_NO );
- if( m_pServices_lb->GetEntryCount() > 0 )
+ if( aBox->Execute() == RET_YES )
{
- m_pServices_lb->SelectEntryPos( 0 );
- }
- else
- {
- m_pServices_lb->SetNoSelection();
- }
+ m_aServices.erase( m_aServices.begin() + nPos );
+ m_pServices_lb->RemoveEntry( nSelected );
- m_bIsUpdated = true;
+ if( m_pServices_lb->GetEntryCount() > 0 )
+ {
+ m_pServices_lb->SelectEntryPos( 0 );
+ }
+ else
+ {
+ m_pServices_lb->SetNoSelection();
+ }
+
+ m_bIsUpdated = true;
+ }
}
}
diff --git a/fpicker/source/office/iodlg.src b/fpicker/source/office/iodlg.src
index e09fe0b..bc43b98 100644
--- a/fpicker/source/office/iodlg.src
+++ b/fpicker/source/office/iodlg.src
@@ -105,6 +105,11 @@ String STR_SVT_ALREADYEXISTOVERWRITE
Text [ en-US ] = "A file named \"$filename$\" already exists.\n\nDo you want to replace it?" ;
};
+String STR_SVT_DELETESERVICE
+{
+ Text [ en-US ] = "Are you sure you want to delete the service?\n\"$servicename$\"" ;
+};
+
String STR_SVT_NEW_FOLDER
{
Text [ en-US ] = "Folder" ;
diff --git a/include/vcl/fpicker.hrc b/include/vcl/fpicker.hrc
index 387b389..7d4bd16 100644
--- a/include/vcl/fpicker.hrc
+++ b/include/vcl/fpicker.hrc
@@ -27,6 +27,7 @@
#define STR_SVT_FOLDERPICKER_DEFAULT_TITLE (STR_SVT_FILEPICKER_START+12)
#define STR_SVT_FOLDERPICKER_DEFAULT_DESCRIPTION (STR_SVT_FILEPICKER_START+13)
#define STR_SVT_ALREADYEXISTOVERWRITE (STR_SVT_FILEPICKER_START+14)
+#define STR_SVT_DELETESERVICE (STR_SVT_FILEPICKER_START+15)
#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
commit 74d7136325ca00534bbb76351bf79cf43afc8a56
Author: Markus Mohrhard <markus.mohrhard at googlemail.com>
Date: Thu Jul 23 18:32:31 2015 +0200
add unhandled case in switch
Change-Id: I1e6c2263cb8e6b4d58a3f63ca129d4e9c403fce2
diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx
index ebfe2cd..6982ec3 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -383,6 +383,7 @@ XclExpExtCalcPr::XclExpExtCalcPr( const XclExpRoot& rRoot, formula::FormulaGramm
case formula::FormulaGrammar::CONV_XL_OOX:
case formula::FormulaGrammar::CONV_LOTUS_A1:
case formula::FormulaGrammar::CONV_LAST:
+ case formula::FormulaGrammar::CONV_A1_XL_A1:
maSyntax = OString("Unspecified");
break;
}
commit c2e48be7e54efd33ad4dae0c24185597521efd46
Author: Katarina Behrens <Katarina.Behrens at cib.de>
Date: Mon Jul 20 11:50:54 2015 +0200
tdf#92256: OOXML save/load syntax for string reference
+ introduce a separate LibO namespace for that
Change-Id: Ie62da0746e81ea0d861680863beb03094649d41c
Reviewed-on: https://gerrit.libreoffice.org/17216
Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
Tested-by: Markus Mohrhard <markus.mohrhard at googlemail.com>
diff --git a/oox/source/core/xmlfilterbase.cxx b/oox/source/core/xmlfilterbase.cxx
index f1c80df..535c811 100644
--- a/oox/source/core/xmlfilterbase.cxx
+++ b/oox/source/core/xmlfilterbase.cxx
@@ -118,7 +118,8 @@ struct NamespaceIds: public rtl::StaticWithInit<
"http://schemas.openxmlformats.org/markup-compatibility/2006",
"http://schemas.openxmlformats.org/spreadsheetml/2006/main/v2",
"http://schemas.microsoft.com/office/drawing/2008/diagram",
- "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main"
+ "http://schemas.microsoft.com/office/spreadsheetml/2009/9/main",
+ "http://schemas.libreoffice.org/"
};
static const sal_Int32 namespaceIds[] = {
@@ -145,7 +146,8 @@ struct NamespaceIds: public rtl::StaticWithInit<
NMSP_mce,
NMSP_mceTest,
NMSP_dsp,
- NMSP_xls14Lst
+ NMSP_xls14Lst,
+ NMSP_loext
};
Sequence< beans::Pair< OUString, sal_Int32 > > aRet(SAL_N_ELEMENTS(namespaceIds));
diff --git a/oox/source/token/namespaces-strict.txt b/oox/source/token/namespaces-strict.txt
index 9359f8b..026fcfe 100644
--- a/oox/source/token/namespaces-strict.txt
+++ b/oox/source/token/namespaces-strict.txt
@@ -80,3 +80,6 @@ a14 http://schemas.microsoft.com/office/drawingml/2010/main
# xls14Lst for features introduced by excel 2010
xls14Lst http://schemas.microsoft.com/office/spreadsheetml/2009/9/main
+
+# LibreOffice's own extensions
+loext http://schemas.libreoffice.org/
diff --git a/oox/source/token/namespaces.hxx.tail b/oox/source/token/namespaces.hxx.tail
index de5cc21..24de645 100644
--- a/oox/source/token/namespaces.hxx.tail
+++ b/oox/source/token/namespaces.hxx.tail
@@ -55,6 +55,7 @@ inline sal_Int32 getNamespace( sal_Int32 nToken ) { return nToken & NMSP_MASK; }
#define WPS_TOKEN( token ) OOX_TOKEN( wps, token )
#define WPG_TOKEN( token ) OOX_TOKEN( wpg, token )
#define W_TOKEN( token ) OOX_TOKEN( doc, token )
+#define LOEXT_TOKEN( token ) OOX_TOKEN( loext, token )
diff --git a/oox/source/token/namespaces.txt b/oox/source/token/namespaces.txt
index face9d6..2c61d60 100644
--- a/oox/source/token/namespaces.txt
+++ b/oox/source/token/namespaces.txt
@@ -80,3 +80,6 @@ a14 http://schemas.microsoft.com/office/drawing/2010/main
# xls14Lst for features introduced by excel 2010
xls14Lst http://schemas.microsoft.com/office/spreadsheetml/2009/9/main
+
+# LibreOffice's own extensions
+loext http://schemas.libreoffice.org/
diff --git a/oox/source/token/tokens.txt b/oox/source/token/tokens.txt
index c26e957..1ed1681 100644
--- a/oox/source/token/tokens.txt
+++ b/oox/source/token/tokens.txt
@@ -69,6 +69,7 @@ BroadcastTitle
Broadcaster
Button
CF
+CalcA1
Camera
Cancel
Caption
@@ -141,6 +142,8 @@ Editor
ElectronicSource
Embed
EnhancedMetaFile
+ExcelA1
+ExcelR1C1
Extend
Extension
External
@@ -392,6 +395,7 @@ True
Type
Types
UIObj
+Unspecified
URI
URL
UpdateMode
@@ -2137,6 +2141,7 @@ exp
explosion
expression
ext
+extCalcPr
extLst
extend
extendable
@@ -3165,6 +3170,7 @@ lockWindows
locked
lockedCanvas
lockrotationcenter
+loext
log
logBase
lon
@@ -4954,6 +4960,7 @@ strikeH
strikeTLBR
strikeV
string
+stringRefSyntax
stringValue1
stringValue2
stripedRightArrow
diff --git a/sc/source/filter/excel/excdoc.cxx b/sc/source/filter/excel/excdoc.cxx
index b9788d7..b56c9b1 100644
--- a/sc/source/filter/excel/excdoc.cxx
+++ b/sc/source/filter/excel/excdoc.cxx
@@ -445,6 +445,11 @@ void ExcTable::FillAsHeaderXml( ExcBoundsheetList& rBoundsheetList )
aRecList.AppendRecord( GetObjectManager().CreateDrawingGroup() );
// Shared string table: SST, EXTSST
aRecList.AppendRecord( CreateRecord( EXC_ID_SST ) );
+
+ XclExtLstRef xExtLst( new XclExtLst( GetRoot() ) );
+ const ScCalcConfig& rCalcConfig = rDoc.GetCalcConfig();
+ xExtLst->AddRecord( XclExpExtRef( new XclExpExtCalcPr( GetRoot(), rCalcConfig.meStringRefAddressSyntax )) );
+ aRecList.AppendRecord( xExtLst );
}
void ExcTable::FillAsTableBinary( SCTAB nCodeNameIdx )
diff --git a/sc/source/filter/excel/xeextlst.cxx b/sc/source/filter/excel/xeextlst.cxx
index 2639bec..ebfe2cd 100644
--- a/sc/source/filter/excel/xeextlst.cxx
+++ b/sc/source/filter/excel/xeextlst.cxx
@@ -361,6 +361,48 @@ void XclExpExtConditionalFormatting::SaveXml( XclExpXmlStream& rStrm )
rWorksheet->endElementNS( XML_x14, XML_conditionalFormatting );
}
+XclExpExtCalcPr::XclExpExtCalcPr( const XclExpRoot& rRoot, formula::FormulaGrammar::AddressConvention eConv ):
+ XclExpExt( rRoot ),
+ meConv( eConv )
+{
+ maURI = OString("{7626C862-2A13-11E5-B345-FEFF819CDC9F}");
+
+ switch (meConv)
+ {
+ case formula::FormulaGrammar::CONV_OOO:
+ maSyntax = OString("CalcA1");
+ break;
+ case formula::FormulaGrammar::CONV_XL_A1:
+ maSyntax = OString("ExcelA1");
+ break;
+ case formula::FormulaGrammar::CONV_XL_R1C1:
+ maSyntax = OString("ExcelR1C1");
+ break;
+ case formula::FormulaGrammar::CONV_UNSPECIFIED:
+ case formula::FormulaGrammar::CONV_ODF:
+ case formula::FormulaGrammar::CONV_XL_OOX:
+ case formula::FormulaGrammar::CONV_LOTUS_A1:
+ case formula::FormulaGrammar::CONV_LAST:
+ maSyntax = OString("Unspecified");
+ break;
+ }
+}
+
+void XclExpExtCalcPr::SaveXml( XclExpXmlStream& rStrm )
+{
+ sax_fastparser::FSHelperPtr& rWorksheet = rStrm.GetCurrentStream();
+ rWorksheet->startElement( XML_ext,
+ FSNS( XML_xmlns, XML_loext ), "http://schemas.libreoffice.org/",
+ XML_uri, maURI.getStr(),
+ FSEND );
+
+ rWorksheet->singleElementNS( XML_loext, XML_extCalcPr,
+ XML_stringRefSyntax, maSyntax.getStr(),
+ FSEND );
+
+ rWorksheet->endElement( XML_ext );
+}
+
XclExpExtCondFormat::XclExpExtCondFormat( const XclExpRoot& rRoot ):
XclExpExt( rRoot )
{
diff --git a/sc/source/filter/inc/extlstcontext.hxx b/sc/source/filter/inc/extlstcontext.hxx
index 598adbd..d77d51a 100644
--- a/sc/source/filter/inc/extlstcontext.hxx
+++ b/sc/source/filter/inc/extlstcontext.hxx
@@ -12,6 +12,7 @@
#include "excelhandlers.hxx"
#include "worksheetfragment.hxx"
+#include "workbookfragment.hxx"
#include <boost/ptr_container/ptr_vector.hpp>
@@ -103,6 +104,27 @@ protected:
virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
};
+class ExtGlobalWorkbookContext : public WorkbookContextBase
+{
+public:
+ explicit ExtGlobalWorkbookContext( WorkbookContextBase& rFragment );
+
+protected:
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
+ virtual void onStartElement( const AttributeList& rAttribs ) SAL_OVERRIDE;
+
+private:
+};
+
+class ExtLstGlobalWorkbookContext : public WorkbookContextBase
+{
+public:
+ explicit ExtLstGlobalWorkbookContext( WorkbookFragment& rFragment );
+
+protected:
+ virtual ::oox::core::ContextHandlerRef onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs ) SAL_OVERRIDE;
+};
+
} //namespace xls
} //namespace oox
diff --git a/sc/source/filter/inc/xeextlst.hxx b/sc/source/filter/inc/xeextlst.hxx
index f148f83..d31fb4d 100644
--- a/sc/source/filter/inc/xeextlst.hxx
+++ b/sc/source/filter/inc/xeextlst.hxx
@@ -14,12 +14,14 @@
#include "xeroot.hxx"
#include "colorscale.hxx"
+#include "formulaopt.hxx"
#include <memory>
enum XclExpExtType
{
- XclExpExtDataBarType
+ XclExpExtDataBarType,
+ XclExpExtDataFooType
};
struct XclExpExtCondFormatData
@@ -167,6 +169,19 @@ private:
XclExpRecordList< XclExpExtConditionalFormatting > maCF;
};
+class XclExpExtCalcPr : public XclExpExt
+{
+public:
+ XclExpExtCalcPr( const XclExpRoot& rRoot, formula::FormulaGrammar::AddressConvention eConv );
+ virtual void SaveXml( XclExpXmlStream& rStrm ) SAL_OVERRIDE;
+
+ virtual XclExpExtType GetType() SAL_OVERRIDE { return XclExpExtDataFooType; }
+
+private:
+ formula::FormulaGrammar::AddressConvention meConv;
+ OString maSyntax;
+};
+
class XclExtLst : public XclExpRecordBase, public XclExpRoot
{
public:
diff --git a/sc/source/filter/oox/extlstcontext.cxx b/sc/source/filter/oox/extlstcontext.cxx
index 7371f99..81590b4 100644
--- a/sc/source/filter/oox/extlstcontext.cxx
+++ b/sc/source/filter/oox/extlstcontext.cxx
@@ -249,6 +249,57 @@ ContextHandlerRef ExtLstGlobalContext::onCreateContext( sal_Int32 nElement, cons
return this;
}
+ExtGlobalWorkbookContext::ExtGlobalWorkbookContext( WorkbookContextBase& rFragment ):
+ WorkbookContextBase(rFragment)
+{
+}
+
+ContextHandlerRef ExtGlobalWorkbookContext::onCreateContext( sal_Int32 nElement, const AttributeList& rAttribs )
+{
+ if (nElement == LOEXT_TOKEN(extCalcPr))
+ {
+ ScDocument* pDoc = &getScDocument();
+ sal_Int32 nToken = rAttribs.getToken( XML_stringRefSyntax, XML_CalcA1 );
+ ScCalcConfig aCalcConfig = pDoc->GetCalcConfig();
+
+ switch( nToken )
+ {
+ case XML_CalcA1:
+ aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_OOO;
+ break;
+ case XML_ExcelA1:
+ aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_XL_A1;
+ break;
+ case XML_ExcelR1C1:
+ aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_XL_R1C1;
+ break;
+ default:
+ aCalcConfig.meStringRefAddressSyntax = formula::FormulaGrammar::CONV_UNSPECIFIED;
+ break;
+ }
+ pDoc->SetCalcConfig(aCalcConfig);
+ }
+
+ return this;
+}
+
+void ExtGlobalWorkbookContext::onStartElement( const AttributeList& /*rAttribs*/ )
+{
+}
+
+ExtLstGlobalWorkbookContext::ExtLstGlobalWorkbookContext( WorkbookFragment& rFragment ):
+ WorkbookContextBase(rFragment)
+{
+}
+
+ContextHandlerRef ExtLstGlobalWorkbookContext::onCreateContext( sal_Int32 nElement, const AttributeList& )
+{
+ if (nElement == XLS_TOKEN( ext ))
+ return new ExtGlobalWorkbookContext( *this );
+
+ return this;
+}
+
} //namespace oox
} //namespace xls
diff --git a/sc/source/filter/oox/workbookfragment.cxx b/sc/source/filter/oox/workbookfragment.cxx
index 4b37d0f..06881c0 100644
--- a/sc/source/filter/oox/workbookfragment.cxx
+++ b/sc/source/filter/oox/workbookfragment.cxx
@@ -46,6 +46,7 @@
#include "worksheethelper.hxx"
#include "worksheetfragment.hxx"
#include "sheetdatacontext.hxx"
+#include "extlstcontext.hxx"
#include "officecfg/Office/Common.hxx"
#include "document.hxx"
@@ -110,6 +111,8 @@ ContextHandlerRef WorkbookFragment::onCreateContext( sal_Int32 nElement, const A
case XLS_TOKEN( workbookPr ): getWorkbookSettings().importWorkbookPr( rAttribs ); break;
case XLS_TOKEN( calcPr ): getWorkbookSettings().importCalcPr( rAttribs ); break;
case XLS_TOKEN( oleSize ): getViewSettings().importOleSize( rAttribs ); break;
+
+ case XLS_TOKEN( extLst ): return new ExtLstGlobalWorkbookContext( *this );
}
break;
commit bf5d569bb6af90195a339bb3b1a19d763d2210af
Author: Varun <varun.dhall at studentpartner.com>
Date: Wed Jul 22 13:58:53 2015 +0530
Added test for tdf#57197 table row/column insert undo crash
Change-Id: I143d657239dd983396847eb67019e84a202f0bcb
Reviewed-on: https://gerrit.libreoffice.org/17284
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Michael Stahl <mstahl at redhat.com>
diff --git a/sw/qa/extras/uiwriter/uiwriter.cxx b/sw/qa/extras/uiwriter/uiwriter.cxx
index 08158cc..16bd01f 100644
--- a/sw/qa/extras/uiwriter/uiwriter.cxx
+++ b/sw/qa/extras/uiwriter/uiwriter.cxx
@@ -118,6 +118,7 @@ public:
void testUnoParagraph();
void testSearchWithTransliterate();
void testTdf80663();
+ void testTdf57197();
void testTdf90808();
void testTdf75137();
void testTdf83798();
@@ -177,6 +178,7 @@ public:
CPPUNIT_TEST(testUnoParagraph);
CPPUNIT_TEST(testSearchWithTransliterate);
CPPUNIT_TEST(testTdf80663);
+ CPPUNIT_TEST(testTdf57197);
CPPUNIT_TEST(testTdf90808);
CPPUNIT_TEST(testTdf75137);
CPPUNIT_TEST(testTdf83798);
@@ -1520,6 +1522,88 @@ void SwUiWriterTest::testTdf80663()
CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getColumns()->getCount());
}
+void SwUiWriterTest::testTdf57197()
+{
+ SwDoc* pDoc = createDoc();
+ SwWrtShell* pWrtShell = pDoc->GetDocShell()->GetWrtShell();
+ //Inserting 1x1 Table
+ sw::UndoManager& rUndoManager = pDoc->GetUndoManager();
+ SwInsertTableOptions TableOpt(tabopts::DEFAULT_BORDER, 0);
+ pWrtShell->InsertTable(TableOpt, 1, 1);
+ //Checking for the number of rows and columns
+ uno::Reference<text::XTextTable> xTable(getParagraphOrTable(1), uno::UNO_QUERY);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Inserting one row before the existing row
+ pWrtShell->SttDoc(); //moves the cursor to the start of Doc
+ pWrtShell->InsertRow(1, false);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Undo changes
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Redo changes
+ rUndoManager.Redo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Undo changes
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Insering one row after the existing row
+ pWrtShell->SttDoc(); //moves the cursor to the start of Doc
+ pWrtShell->InsertRow(1, true);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Undo changes
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Redo changes
+ rUndoManager.Redo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Undo changes
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Inserting one column before the existing column
+ pWrtShell->SttDoc(); //moves the cursor to the start of Doc
+ pWrtShell->InsertCol(1, false);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getColumns()->getCount());
+ //Undo changes
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Redo changes
+ rUndoManager.Redo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getColumns()->getCount());
+ //Undo changes
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Inserting one column after the existing column
+ pWrtShell->SttDoc(); //moves the cursor to the start of Doc
+ pWrtShell->InsertCol(1, true);
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getColumns()->getCount());
+ //Undo changes
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+ //Redo changes
+ rUndoManager.Redo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(2), xTable->getColumns()->getCount());
+ //Undo changes
+ rUndoManager.Undo();
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getRows()->getCount());
+ CPPUNIT_ASSERT_EQUAL(sal_Int32(1), xTable->getColumns()->getCount());
+}
+
void SwUiWriterTest::testTdf90808()
{
createDoc();
commit d77947929c7f02cebe3d3e5d79c78642a8a439ba
Author: Eike Rathke <erack at redhat.com>
Date: Thu Jul 23 14:29:20 2015 +0200
TableRef: generate error for header-less column references, tdf#91278 related
... instead of using an arbitray first data record's string as column
name. We don't support header-less tables properly yet, so don't pretend
to.
Change-Id: Ia42619ec800291b6617a61c8a89a2d54ef231cec
diff --git a/sc/source/core/tool/compiler.cxx b/sc/source/core/tool/compiler.cxx
index 901261b..dc46edb 100644
--- a/sc/source/core/tool/compiler.cxx
+++ b/sc/source/core/tool/compiler.cxx
@@ -3517,35 +3517,38 @@ bool ScCompiler::IsTableRefColumn( const OUString& rName ) const
aRange.aEnd.SetTab( aRange.aStart.Tab());
aRange.aEnd.SetRow( aRange.aStart.Row());
- // Quite similar to IsColRowName() but limited to one row of headers.
- ScCellIterator aIter( pDoc, aRange);
- for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
+ if (pDBData->HasHeader())
{
- CellType eType = aIter.getType();
- bool bOk = false;
- if (eType == CELLTYPE_FORMULA)
+ // Quite similar to IsColRowName() but limited to one row of headers.
+ ScCellIterator aIter( pDoc, aRange);
+ for (bool bHas = aIter.first(); bHas; bHas = aIter.next())
{
- ScFormulaCell* pFC = aIter.getFormulaCell();
- bOk = (pFC->GetCode()->GetCodeLen() > 0) && (pFC->aPos != aPos);
- }
- else
- bOk = true;
+ CellType eType = aIter.getType();
+ bool bOk = false;
+ if (eType == CELLTYPE_FORMULA)
+ {
+ ScFormulaCell* pFC = aIter.getFormulaCell();
+ bOk = (pFC->GetCode()->GetCodeLen() > 0) && (pFC->aPos != aPos);
+ }
+ else
+ bOk = true;
- if (bOk && aIter.hasString())
- {
- OUString aStr = aIter.getString();
- if (ScGlobal::GetpTransliteration()->isEqual( aStr, aName))
+ if (bOk && aIter.hasString())
{
- /* XXX NOTE: we could init the column as relative so copying a
- * formula across columns would point to the relative column,
- * but do it absolute because:
- * a) it makes the reference work in named expressions without
- * having to distinguish
- * b) Excel does it the same. */
- ScSingleRefData aRef;
- aRef.InitAddress( aIter.GetPos());
- maRawToken.SetSingleReference( aRef );
- return true;
+ OUString aStr = aIter.getString();
+ if (ScGlobal::GetpTransliteration()->isEqual( aStr, aName))
+ {
+ /* XXX NOTE: we could init the column as relative so copying a
+ * formula across columns would point to the relative column,
+ * but do it absolute because:
+ * a) it makes the reference work in named expressions without
+ * having to distinguish
+ * b) Excel does it the same. */
+ ScSingleRefData aRef;
+ aRef.InitAddress( aIter.GetPos());
+ maRawToken.SetSingleReference( aRef );
+ return true;
+ }
}
}
}
... etc. - the rest is truncated
More information about the Libreoffice-commits
mailing list