[PATCH] fdo#62099 UI: More intuitive text for menu 'Insert - File' C...

2013-04-03 Thread Vishv Brahmbhatt (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/3193

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/93/3193/1

fdo#62099 UI: More intuitive text for menu 'Insert - File'
Change-Id: I80a1aef56b3a8fa0e1939e63dd2607e18757687d
---
M officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
M scripting/workben/bindings/drawmenubar.xml
M sd/inc/app.hrc
M sd/sdi/_drvwsh.sdi
M sd/sdi/sdraw.sdi
M sd/source/ui/view/drviews8.cxx
M sd/source/ui/view/outlnvs2.cxx
M sd/uiconfig/sdraw/menubar/menubar.xml
M sd/uiconfig/sdraw/toolbar/insertbar.xml
9 files changed, 57 insertions(+), 5 deletions(-)



diff --git 
a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu 
b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
index d52bafc..86d84ea 100644
--- a/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
+++ b/officecfg/registry/data/org/openoffice/Office/UI/DrawImpressCommands.xcu
@@ -733,8 +733,14 @@
 
 
   1
-
+
   
+  
+
+
+  ~Drawing File...
+
+   
   
 
 
diff --git a/scripting/workben/bindings/drawmenubar.xml 
b/scripting/workben/bindings/drawmenubar.xml
index 4f0d1e9..fa05dbf 100644
--- a/scripting/workben/bindings/drawmenubar.xml
+++ b/scripting/workben/bindings/drawmenubar.xml
@@ -197,7 +197,7 @@



-   
+   
   
  
  
diff --git a/sd/inc/app.hrc b/sd/inc/app.hrc
index 950a930..d68384e 100644
--- a/sd/inc/app.hrc
+++ b/sd/inc/app.hrc
@@ -74,6 +74,7 @@
 #define SID_DIAMODE (SID_SD_START+11)
 #define SID_INSERTPAGE  (SID_SD_START+14)
 #define SID_INSERTFILE  (SID_SD_START+15)
+#define SID_INSERTDRAWFILE  (SID_SD_START+150)
 #define SID_INSERTSYMBOL(SID_SD_START+16)
 #define SID_ZOOM_PANNING(SID_SD_START+17)
 #define SID_PRESENTATION_END(SID_SD_START+18)
diff --git a/sd/sdi/_drvwsh.sdi b/sd/sdi/_drvwsh.sdi
index 98f1539..3155b06 100644
--- a/sd/sdi/_drvwsh.sdi
+++ b/sd/sdi/_drvwsh.sdi
@@ -1334,6 +1334,11 @@
 ExecMethod = FuTemporary ;
 StateMethod = GetMenuState ;
 ]
+SID_INSERTDRAWFILE // ole : no, status : todo
+[
+ExecMethod = FuTemporary ;
+StateMethod = GetMenuState ;
+]
 SID_STYLE_FAMILY2 // ole : no, status : ?
 [
 ExecMethod = FuTemporary ;
diff --git a/sd/sdi/sdraw.sdi b/sd/sdi/sdraw.sdi
index d59d62d..71fad6e 100644
--- a/sd/sdi/sdraw.sdi
+++ b/sd/sdi/sdraw.sdi
@@ -3317,6 +3317,29 @@
 ToolBoxConfig = TRUE,
 GroupId = GID_INSERT;
 ]
+SfxVoidItem ImportFromDrawFile SID_INSERTDRAWFILE
+(SfxStringItem FileName ID_VAL_DUMMY1,SfxStringItem FilterName ID_VAL_DUMMY2)
+[
+/* flags: */
+AutoUpdate = FALSE,
+Cachable = Cachable,
+FastCall = FALSE,
+HasCoreId = FALSE,
+HasDialog = TRUE,
+ReadOnlyDoc = FALSE,
+Toggle = FALSE,
+Container = FALSE,
+RecordAbsolute = FALSE,
+RecordPerSet;
+Synchron;
+
+/* config: */
+AccelConfig = TRUE,
+MenuConfig = TRUE,
+StatusBarConfig = FALSE,
+ToolBoxConfig = TRUE,
+GroupId = GID_INSERT;
+]
 
 //--
 SfxVoidItem InsertAuthorField SID_INSERT_FLD_AUTHOR
diff --git a/sd/source/ui/view/drviews8.cxx b/sd/source/ui/view/drviews8.cxx
index ab297b7..ab6a293 100644
--- a/sd/source/ui/view/drviews8.cxx
+++ b/sd/source/ui/view/drviews8.cxx
@@ -225,6 +225,18 @@
 }
 break;
 
+case SID_INSERTDRAWFILE:  
+{
+Broadcast 
(ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_START));
+SetCurrentFunction( FuInsertFile::Create( this, GetActiveWindow(), 
mpDrawView, GetDoc(), rReq ) );
+Broadcast 
(ViewShellHint(ViewShellHint::HINT_COMPLEX_MODEL_CHANGE_END));
+Cancel();
+rReq.Done ();
+
+Invalidate(SID_DRAWTBX_INSERT);
+}
+break;
+
 case SID_SELECT_BACKGROUND:
 case SID_PAGESETUP:  // BASIC ??
 {
diff --git a/sd/source/ui/view/outlnvs2.cxx b/sd/source/ui/view/outlnvs2.cxx
index 5a2061e..6b7511d 100644
--- a/sd/source/ui/view/outlnvs2.cxx
+++ b/sd/source/ui/view/outlnvs2.cxx
@@ -398,7 +398,12 @@
 Cancel();
 }
 break;
-
+case SID_INSERTDRAWFILE:
+{
+SetCurrentFunction( FuInsertFile::Create(this, GetActiveWindow(), 
pOlView, GetDoc(), rReq) );
+Cancel();
+}
+break;
 case SID_PRESENTATIONOBJECT:
 {
 SetCurrentFunction( FuPresentationObjects::Create(this, 
GetActiveWindow(), pOlView, GetDoc(), rReq) );
diff --git a/sd/uiconfig/sdraw/menubar/menubar.xml 
b/sd/uiconfig/sdraw/menubar/menubar.xml
index 85ea0e0..0d72f14 100644
--- a/sd/uiconfig/sdraw/menubar/me

Change in core[master]: fdo#59397 Use more precise wording at 'Find & Replace - Mor...

2013-01-28 Thread Vishv Brahmbhatt (via Code Review)
Hi,

I have submitted a patch for review:

https://gerrit.libreoffice.org/1905

To pull it, you can do:

git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/05/1905/1

fdo#59397 Use more precise wording at 'Find & Replace - More Options - Styles'
Change-Id: I5013e8b2ce99478f2445756e181f009b93d4e746
---
M svx/inc/svx/dialogs.hrc
M svx/inc/svx/srchdlg.hxx
M svx/source/dialog/srchdlg.cxx
M svx/source/dialog/srchdlg.src
4 files changed, 71 insertions(+), 6 deletions(-)



diff --git a/svx/inc/svx/dialogs.hrc b/svx/inc/svx/dialogs.hrc
index d9420b5..2ab14c7 100644
--- a/svx/inc/svx/dialogs.hrc
+++ b/svx/inc/svx/dialogs.hrc
@@ -265,8 +265,8 @@
 #define RID_SVXSTR_SEARCH_STYLES(RID_SVX_START +  80)
 #define RID_SVXSTR_SEARCH   (RID_SVX_START +  81)
 #define RID_SVXSTR_REPLACE  (RID_SVX_START +  82)
-
-
+#define RID_SVXSTR_WRITER_STYLES(RID_SVX_START +  83)
+#define RID_SVXSTR_CALC_STYLES  (RID_SVX_START +  85)
 // ResIds for the PageDialog
 
 // Strings of the ToolBox-Controls from tbcontrl.cxx
diff --git a/svx/inc/svx/srchdlg.hxx b/svx/inc/svx/srchdlg.hxx
index f95626f..b34dd89 100644
--- a/svx/inc/svx/srchdlg.hxx
+++ b/svx/inc/svx/srchdlg.hxx
@@ -203,6 +203,8 @@
 sal_uIntPtr nModifyFlag;
 String  aStylesStr;
 String  aLayoutStr;
+String  aLayoutWriterStr;
+String  aLayoutCalcStr;
 String aCalcStr;
 
 std::vector aSearchStrings;
diff --git a/svx/source/dialog/srchdlg.cxx b/svx/source/dialog/srchdlg.cxx
index 6b29f4d..f9eb850 100644
--- a/svx/source/dialog/srchdlg.cxx
+++ b/svx/source/dialog/srchdlg.cxx
@@ -371,6 +371,8 @@
 aCalcStr += aWordBtn.GetText();
 
 aLayoutStr = SVX_RESSTR( RID_SVXSTR_SEARCH_STYLES );
+aLayoutWriterStr = SVX_RESSTR( RID_SVXSTR_WRITER_STYLES );
+aLayoutCalcStr = SVX_RESSTR( RID_SVXSTR_CALC_STYLES );
 aStylesStr = aLayoutBtn.GetText();
 
 // Get stored search-strings from the application
@@ -1985,6 +1987,23 @@
 IMPL_LINK( SvxSearchDialog, FocusHdl_Impl, Control *, pCtrl )
 {
 sal_Int32 nTxtLen;
+bool bDrawApp = false;
+bool bCalcApp = false;
+bool bWriterApp = false;
+bool bImpressApp = false;
+const uno::Reference< frame::XFrame > xFrame = rBindings.GetActiveFrame();
+uno::Reference< frame::XModuleManager2 > xModuleManager( 
frame::ModuleManager::create(::comphelper::getProcessComponentContext()) );
+try
+{
+::rtl::OUString aModuleIdentifier = xModuleManager->identify( xFrame );
+bCalcApp = aModuleIdentifier == 
"com.sun.star.sheet.SpreadsheetDocument";
+bDrawApp = aModuleIdentifier == "com.sun.star.drawing.DrawingDocument";
+bImpressApp = aModuleIdentifier == 
"com.sun.star.presentation.PresentationDocument";
+bWriterApp = aModuleIdentifier == "com.sun.star.text.TextDocument";
+}
+catch ( uno::Exception& )
+{
+}
 
 if ( !pImpl->bMultiLineEdit )
 nTxtLen = aSearchAttrText.GetText().getLength();
@@ -2022,8 +2041,16 @@
 aSearchLB.SetSelection( Selection( SELECTION_MIN, SELECTION_MAX ) );
 
 ModifyHdl_Impl( (ComboBox*)pCtrl );
-
-aLayoutBtn.SetText( bFormat && nTxtLen ? aLayoutStr : aStylesStr );
+
+if(bWriterApp)
+aLayoutBtn.SetText( bFormat && nTxtLen ? aLayoutStr : aLayoutWriterStr 
);
+else
+{
+if(bCalcApp)
+aLayoutBtn.SetText( bFormat && nTxtLen ? aLayoutStr : 
aLayoutCalcStr );
+else
+aLayoutBtn.SetText( bFormat && nTxtLen ? aLayoutStr : aStylesStr );
+}
 return 0;
 }
 
@@ -2134,8 +2161,36 @@
 // ---
 
 IMPL_LINK_NOARG(SvxSearchDialog, NoFormatHdl_Impl)
-{
-aLayoutBtn.SetText( aStylesStr );
+{   
+bool bDrawApp = false;
+bool bCalcApp = false;
+bool bWriterApp = false;
+bool bImpressApp = false;
+const uno::Reference< frame::XFrame > xFrame = rBindings.GetActiveFrame();
+uno::Reference< frame::XModuleManager2 > xModuleManager( 
frame::ModuleManager::create(::comphelper::getProcessComponentContext()) );
+try
+{
+::rtl::OUString aModuleIdentifier = xModuleManager->identify( xFrame );
+bCalcApp = aModuleIdentifier == 
"com.sun.star.sheet.SpreadsheetDocument";
+bDrawApp = aModuleIdentifier == "com.sun.star.drawing.DrawingDocument";
+bImpressApp = aModuleIdentifier == 
"com.sun.star.presentation.PresentationDocument";
+bWriterApp = aModuleIdentifier == "com.sun.star.text.TextDocument";
+}
+catch ( uno::Exception& )
+{
+}
+
+if(bCalcApp)
+aLayoutBtn.SetText( aLayoutCalcStr );
+else 
+{
+if(bWriterApp)
+aLayoutBtn.SetText( aLayoutWriterStr);
+else
+aLayoutBtn.SetText( aStylesStr );
+}
+
+
 bFormat = sal_False;
 aLayoutBtn.Check( sal_False );
 
diff --git a/svx/source/dia