summaryrefslogtreecommitdiff
path: root/sc/source/ui/vba/vbawindow.cxx
diff options
context:
space:
mode:
authorAndreas Heinisch <andreas.heinisch@yahoo.de>2021-01-07 22:51:54 +0100
committerAndreas Heinisch <andreas.heinisch@yahoo.de>2021-05-25 12:55:22 +0200
commitb2f7187e04a6b6c6183b42230a0119569f069dcf (patch)
tree8d7e7fc4c42f30ee4e37e2e2dd3e5ef9ba68aab5 /sc/source/ui/vba/vbawindow.cxx
parent0a126b4c661d65860fd2de92f8cc49bdb65a957c (diff)
tdf#118129 - return only the caption property of the frame
Change-Id: I3dc875d54c49f233e2784dcd778c2b6fc42e59cd Reviewed-on: https://gerrit.libreoffice.org/c/core/+/108958 Tested-by: Jenkins Reviewed-by: Andreas Heinisch <andreas.heinisch@yahoo.de>
Diffstat (limited to 'sc/source/ui/vba/vbawindow.cxx')
-rw-r--r--sc/source/ui/vba/vbawindow.cxx34
1 files changed, 2 insertions, 32 deletions
diff --git a/sc/source/ui/vba/vbawindow.cxx b/sc/source/ui/vba/vbawindow.cxx
index ec76e2aca68b..1691fbbc3bf3 100644
--- a/sc/source/ui/vba/vbawindow.cxx
+++ b/sc/source/ui/vba/vbawindow.cxx
@@ -301,39 +301,9 @@ ScVbaWindow::ScrollWorkbookTabs( const uno::Any& /*Sheets*/, const uno::Any& /*P
uno::Any SAL_CALL
ScVbaWindow::getCaption()
{
- static const char sCrud[] = " - OpenOffice.org Calc";
- static const sal_Int32 nCrudLen = strlen(sCrud);
-
+ // tdf#118129 - return only the caption property of the frame
OUString sTitle;
- getFrameProps()->getPropertyValue( SC_UNONAME_TITLE ) >>= sTitle;
- sal_Int32 nCrudIndex = sTitle.indexOf( sCrud );
- // adjust title ( by removing crud )
- // sCrud string present
- if ( nCrudIndex != -1 )
- {
- // and ends with sCrud
- if ( ( nCrudLen + nCrudIndex ) == sTitle.getLength() )
- {
- sTitle = sTitle.copy( 0, nCrudIndex );
- rtl::Reference< ScVbaWorkbook > workbook( new ScVbaWorkbook( uno::Reference< XHelperInterface >( Application(), uno::UNO_QUERY_THROW ), mxContext, m_xModel ) );
- OUString sName = workbook->getName();
- // rather bizarre hack to make sure the name behavior
- // is like XL
- // if the adjusted title == workbook name, use name
- // if the adjusted title != workbook name but ...
- // name == title + extension ( .csv, ,odt, .xls )
- // etc. then also use the name
-
- if ( sTitle != sName )
- {
- // starts with title
- if ( sName.startsWith( sTitle ) )
- // extension starts immediately after
- if ( sName.match( ".", sTitle.getLength() ) )
- sTitle = sName;
- }
- }
- }
+ getFrameProps()->getPropertyValue(SC_UNONAME_TITLE) >>= sTitle;
return uno::makeAny( sTitle );
}