Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
ec583253
Kaydet (Commit)
ec583253
authored
Mar 01, 2013
tarafından
Noel Power
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
raise warning when saving macro laden doc as a macro-free format bnc#791777
Change-Id: Ic947ceef71c86e31fbf0bce74b064aaf91f47178
üst
58c30a35
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
100 additions
and
11 deletions
+100
-11
docmacromode.hxx
sfx2/inc/sfx2/docmacromode.hxx
+1
-0
docmacromode.cxx
sfx2/source/doc/docmacromode.cxx
+22
-7
guisaveas.cxx
sfx2/source/doc/guisaveas.cxx
+55
-0
sfxecode.hxx
svtools/inc/svtools/sfxecode.hxx
+1
-1
iahndl.cxx
uui/source/iahndl.cxx
+16
-1
ids.hrc
uui/source/ids.hrc
+1
-1
ids.src
uui/source/ids.src
+4
-1
No files found.
sfx2/inc/sfx2/docmacromode.hxx
Dosyayı görüntüle @
ec583253
...
...
@@ -287,6 +287,7 @@ namespace sfx2
static
sal_Bool
storageHasMacros
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
embed
::
XStorage
>&
_rxStorage
);
static
sal_Bool
containerHasBasicMacros
(
const
::
com
::
sun
::
star
::
uno
::
Reference
<
::
com
::
sun
::
star
::
script
::
XLibraryContainer
>&
xContainter
);
/** checks the macro execution mode while loading the document.
This must be called when the loading is effectively finished, but before any macro action
...
...
sfx2/source/doc/docmacromode.cxx
Dosyayı görüntüle @
ec583253
...
...
@@ -318,17 +318,11 @@ namespace sfx2
}
//--------------------------------------------------------------------
sal_Bool
DocumentMacroMode
::
hasMacroLibrary
()
const
sal_Bool
DocumentMacroMode
::
containerHasBasicMacros
(
const
Reference
<
XLibraryContainer
>&
xContainer
)
{
sal_Bool
bHasMacroLib
=
sal_False
;
#ifndef DISABLE_SCRIPTING
try
{
Reference
<
XEmbeddedScripts
>
xScripts
(
m_pData
->
m_rDocumentAccess
.
getEmbeddedDocumentScripts
()
);
Reference
<
XLibraryContainer
>
xContainer
;
if
(
xScripts
.
is
()
)
xContainer
.
set
(
xScripts
->
getBasicLibraries
(),
UNO_QUERY_THROW
);
if
(
xContainer
.
is
()
)
{
// a library container exists; check if it's empty
...
...
@@ -368,6 +362,27 @@ namespace sfx2
{
DBG_UNHANDLED_EXCEPTION
();
}
return
bHasMacroLib
;
}
//--------------------------------------------------------------------
sal_Bool
DocumentMacroMode
::
hasMacroLibrary
()
const
{
sal_Bool
bHasMacroLib
=
sal_False
;
#ifndef DISABLE_SCRIPTING
try
{
Reference
<
XEmbeddedScripts
>
xScripts
(
m_pData
->
m_rDocumentAccess
.
getEmbeddedDocumentScripts
()
);
Reference
<
XLibraryContainer
>
xContainer
;
if
(
xScripts
.
is
()
)
xContainer
.
set
(
xScripts
->
getBasicLibraries
(),
UNO_QUERY_THROW
);
bHasMacroLib
=
containerHasBasicMacros
(
xContainer
);
}
catch
(
const
Exception
&
)
{
DBG_UNHANDLED_EXCEPTION
();
}
#endif
return
bHasMacroLib
;
}
...
...
sfx2/source/doc/guisaveas.cxx
Dosyayı görüntüle @
ec583253
...
...
@@ -79,6 +79,13 @@
#include <sfxtypes.hxx>
#include "alienwarn.hxx"
#include <sfx2/docmacromode.hxx>
#include <svx/svxerr.hxx>
#include <comphelper/interaction.hxx>
#include <com/sun/star/task/ErrorCodeRequest.hpp>
#include <rtl/ref.hxx>
#include <framework/interaction.hxx>
#include <svtools/sfxecode.hxx>
#include "../appl/app.hrc"
// flags that specify requested operation
...
...
@@ -707,6 +714,19 @@ sal_Int8 ModelData_Impl::CheckStateForSave()
return
nResult
;
}
sal_Bool
hasMacros
(
const
uno
::
Reference
<
frame
::
XModel
>&
xModel
)
{
sal_Bool
bHasMacros
=
sal_False
;
uno
::
Reference
<
script
::
XLibraryContainer
>
xContainer
;
uno
::
Reference
<
beans
::
XPropertySet
>
xProps
(
xModel
,
uno
::
UNO_QUERY
);
if
(
xProps
.
is
()
)
{
xProps
->
getPropertyValue
(
"BasicLibraries"
)
>>=
xContainer
;
bHasMacros
=
sfx2
::
DocumentMacroMode
::
containerHasBasicMacros
(
xContainer
);
}
return
bHasMacros
;
}
sal_Int8
ModelData_Impl
::
CheckFilter
(
const
::
rtl
::
OUString
&
aFilterName
)
{
::
comphelper
::
SequenceAsHashMap
aFiltPropsHM
;
...
...
@@ -754,6 +774,41 @@ sal_Int8 ModelData_Impl::CheckFilter( const ::rtl::OUString& aFilterName )
::
rtl
::
OUString
()
);
if
(
!
aPreusedFilterName
.
equals
(
aFilterName
)
&&
!
aUIName
.
equals
(
aDefUIName
)
)
{
// is it possible to get these names from somewhere and not just
// hardcode them?
OUString
sXLSXFilter
(
"Calc MS Excel 2007 XML"
);
OUString
sOtherXLSXFilter
(
"Calc Office Open XML"
);
bool
bHasMacros
=
hasMacros
(
GetModel
()
);
if
(
bHasMacros
&&
(
aFilterName
==
sXLSXFilter
||
aFilterName
==
sOtherXLSXFilter
)
)
{
uno
::
Reference
<
task
::
XInteractionHandler
>
xHandler
;
GetMediaDescr
()[
OUString
(
"InteractionHandler"
)
]
>>=
xHandler
;
bool
bResult
=
false
;
if
(
xHandler
.
is
()
)
{
try
{
task
::
ErrorCodeRequest
aErrorCode
;
aErrorCode
.
ErrCode
=
ERRCODE_SFX_VBASIC_CANTSAVE_STORAGE
;
uno
::
Any
aRequest
=
uno
::
makeAny
(
aErrorCode
);
uno
::
Sequence
<
uno
::
Reference
<
task
::
XInteractionContinuation
>
>
aContinuations
(
2
);
::
rtl
::
Reference
<
::
comphelper
::
OInteractionApprove
>
pApprove
(
new
::
comphelper
::
OInteractionApprove
);
aContinuations
[
0
]
=
pApprove
.
get
();
::
rtl
::
Reference
<
::
comphelper
::
OInteractionAbort
>
pAbort
(
new
::
comphelper
::
OInteractionAbort
);
aContinuations
[
1
]
=
pAbort
.
get
();
xHandler
->
handle
(
::
framework
::
InteractionRequest
::
CreateRequest
(
aRequest
,
aContinuations
));
bResult
=
pApprove
->
wasSelected
();
}
catch
(
const
uno
::
Exception
&
)
{
}
if
(
!
bResult
)
return
STATUS_SAVEAS
;
}
}
if
(
!
SfxStoringHelper
::
WarnUnacceptableFormat
(
GetModel
(),
aUIName
,
aDefUIName
,
sal_True
)
)
return
STATUS_SAVEAS_STANDARDNAME
;
}
...
...
svtools/inc/svtools/sfxecode.hxx
Dosyayı görüntüle @
ec583253
...
...
@@ -77,7 +77,7 @@
#define ERRCODE_SFX_INCOMPLETE_ENCRYPTION (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 55)
#define ERRCODE_SFX_DOCUMENT_MACRO_DISABLED_MAC (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 56)
#define ERRCODE_SFX_FORMAT_ROWCOL (ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 57)
#define ERRCODE_SFX_VBASIC_CANTSAVE_STORAGE (ERRCODE_WARNING_MASK | ERRCODE_AREA_SFX | ERRCODE_CLASS_NONE | 58)
//Dies und das
...
...
uui/source/iahndl.cxx
Dosyayı görüntüle @
ec583253
...
...
@@ -784,11 +784,26 @@ UUIInteractionHelper::handleRequest_impl(
task
::
ErrorCodeRequest
aErrorCodeRequest
;
if
(
aAnyRequest
>>=
aErrorCodeRequest
)
{
handleGenericErrorRequest
(
aErrorCodeRequest
.
ErrCode
,
// Sucky special handling for xlsx macro filter warning
if
(
(
sal_uInt32
)
ERRCODE_SFX_VBASIC_CANTSAVE_STORAGE
==
(
sal_uInt32
)
aErrorCodeRequest
.
ErrCode
)
{
std
::
vector
<
rtl
::
OUString
>
aArguments
;
handleErrorHandlerRequest
(
task
::
InteractionClassification_WARNING
,
ERRCODE_UUI_IO_WARN_CANTSAVE_MACROS
,
aArguments
,
rRequest
->
getContinuations
(),
bObtainErrorStringOnly
,
bHasErrorString
,
rErrorString
);
}
else
{
handleGenericErrorRequest
(
aErrorCodeRequest
.
ErrCode
,
rRequest
->
getContinuations
(),
bObtainErrorStringOnly
,
bHasErrorString
,
rErrorString
);
}
return
true
;
}
...
...
uui/source/ids.hrc
Dosyayı görüntüle @
ec583253
...
...
@@ -137,7 +137,7 @@
#define ERRCODE_UUI_LOCKING_NOT_LOCKED (ERRCODE_AREA_UUI + 61)
#define ERRCODE_UUI_LOCKING_LOCK_EXPIRED (ERRCODE_AREA_UUI + 62)
#define ERRCODE_UUI_CANNOT_ACTIVATE_FACTORY (ERRCODE_AREA_UUI + 63)
#define ERRCODE_UUI_IO_WARN_CANTSAVE_MACROS (ERRCODE_WARNING_MASK | ( ERRCODE_AREA_UUI + 64))
#define ERRCODE_AREA_UUI_UNKNOWNAUTH 25000
#define SSLWARN_TYPE_DOMAINMISMATCH 10
#define SSLWARN_TYPE_EXPIRED 20
...
...
uui/source/ids.src
Dosyayı görüntüle @
ec583253
...
...
@@ -30,7 +30,6 @@ String RID_SAVE_PASSWORD
Text [ en-US ] = "~Remember password";
};
String STR_WARNING_BROKENSIGNATURE_TITLE
{
Text [ en-US ] = "Invalid Document Signature" ;
...
...
@@ -397,5 +396,9 @@ Resource RID_UUI_ERRHDL
Text [ en-US ] = "Component cannot be loaded, possibly broken or incomplete installation.\nFull error message:\n\n $(ARG1).";
};
String (ERRCODE_UUI_IO_WARN_CANTSAVE_MACROS & ERRCODE_RES_MASK)
{
Text [ en-US ] = "You are saving to a macro-free document format, the macros contained in this document will not be saved.\nDo you wish to continue?";
};
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment