[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-03-30 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

Xisco FaulĂ­  changed:

   What|Removed |Added

 Ever confirmed|0   |1
   Severity|normal  |enhancement
 CC||xiscofa...@libreoffice.org
 Status|UNCONFIRMED |NEW

--- Comment #16 from Xisco FaulĂ­  ---
(In reply to Andreas Heinisch from comment #15)
> Could be a valid enhancement request, but it may break exisiting (but wrong)
> macros. However, the function does what the documentation states.

Moving to NEW then

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #15 from Andreas Heinisch  ---
Could be a valid enhancement request, but it may break exisiting (but wrong)
macros. However, the function does what the documentation states.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #14 from Uwe Auer  ---
(In reply to Andreas Heinisch from comment #12)
> But we could throw a runtime error ...

that's ok, but then it is not a bug but an enhancement request. I stick with
the statements that the code is wrong and documentation is clear about correct
usage of IsMissing - it tests whether a optional function parameter has been
passed to the function or not and that. And the function as defined in the
report has no optional parameter which could be tested.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #13 from An-Kh  ---
(In reply to Andreas Heinisch from comment #12)
> But we could throw a runtime error ...

Yess.. I think some kind of indication should be there

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #12 from Andreas Heinisch  ---
But we could throw a runtime error ...

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #11 from Andreas Heinisch  ---
Imho, the behaviour is correct, since, if IsMissing is used on a non optional
parameter it always gives false.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #10 from himajin100...@gmail.com ---
IMHO, It looks at least to me that in order to give compile-time error
"IsMissing" has to be a language construct rather than a function.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #9 from An-Kh  ---
(In reply to himajin10 from comment #6)
> note:
> 
> https://opengrok.libreoffice.org/xref/core/basic/source/runtime/methods.
> cxx?r=3482f590#2500

Hii

I saw the code in the above link. It should give an error message if the
parameters are entered wrongly in IfMissing(). 
But here it is neither giving the error message nor the protection is applied.

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #8 from An-Kh  ---
(In reply to Uwe Auer from comment #7)
> (In reply to An-Kh from comment #5)
> 
> > I saw this code in the Bug 133257
> 
> You saw it in a bug, which indicates that it did not work

That bug was unrelated to this one. It was related to UI in Calc during
protection

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #7 from Uwe Auer  ---
(In reply to An-Kh from comment #5)

> I saw this code in the Bug 133257

You saw it in a bug, which indicates that it did not work

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #6 from himajin100...@gmail.com ---
note:

https://opengrok.libreoffice.org/xref/core/basic/source/runtime/methods.cxx?r=3482f590#2500

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #5 from An-Kh  ---
Hi

I think that in this case, some kind of dialog box should pop up telling that 

Dim pPassword   As String
If IsMissing(pPassword)

is not allowed.

I saw this code in the Bug 133257

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #4 from Uwe Auer  ---
(In reply to An-Kh from comment #2)
> 
> Therefore provided a solution (which you obviously did not check) to change:
> 

Change to my previous comment:

 - Dim pPassword  As String
 - Function LockSheet(passedSheetname) 
 + Function LockSheet(passedSheetname, optional pPassword )

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #3 from Uwe Auer  ---
(In reply to An-Kh from comment #2)

I did understand your code, but probably you did not understand my answer. To
be precise and clear: Your code is wrong and I explained why.

> If IsMissing(pPassword) Then pPassword = "SomePassword"
is not doing what you understand / assume it is doing. It doesn *not* test
whether variable is set. Runtime function IsMissing() tests for  *optional*
parameter in your function definition (i.e. it tests, whether *pPassword* has
been passed to function LockSheet(passedSheetname)) - but your function doesn't
have that optional parameter at all. 

Therefore provided a solution (which you obviously did not check) to change:

- Function LockSheet(passedSheetname) 
+ Function LockSheet(passedSheetname, optional pPassword ) 

In other words: The declaration of your function *LockSheet* is incorrect with
respect of using runtime function *IsMissing()*

Explanation
- means "remove" from your code
+ means "add" to your code

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #2 from An-Kh  ---
(In reply to Uwe Auer from comment #1)
> The problem is with
> 
> > If IsMissing(pPassword) Then pPassword = "SomePassword" 
> 
> which does not set the password pPassword to "SomePassword". Runtime
> function "IsMissing" tests if a function is called with an _optional_
> parameter and function "LockSheet" has no optional parameter. called
> pPassword. Therefore pPassword stays empty and protection is activated with
> an "empty" password. Change the code to something like:
> 
> >Sub LockThisSheet
> >LockSheet("Sheet1")
> >End Sub
> >
> >Function LockSheet(passedSheetname, optional pPassword ) 
> >
> >Dim oDocAs Object : oDoc= ThisComponent
> >Dim oSheet  As Object : oSheet  = 
> > oDoc.Sheets.getByName(passedSheetname)
> >
> >If IsMissing(pPassword) Then pPassword = "SomePassword" 
I think that in this line it says that if the pPassword is missing set the
pPassword to "SomePassword". Since here pPassword is missing, pPassword is set
to "SomePassword".
> >oSheet.UnProtect(pPassword)
> >oSheet.Protect(pPassword)
Here it protects the sheet with pPassword
> >
> >End Function
> 
> From my perspective not a bug

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-18 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

--- Comment #1 from Uwe Auer  ---
The problem is with

> If IsMissing(pPassword) Then pPassword = "SomePassword" 

which does not set the password pPassword to "SomePassword". Runtime function
"IsMissing" tests if a function is called with an _optional_ parameter and
function "LockSheet" has no optional parameter called pPassword. Therefore
pPassword stays empty and protection is activated with an "empty" password.
Change the code to something like:

>Sub LockThisSheet
>LockSheet("Sheet1")
>End Sub
>
>Function LockSheet(passedSheetname, optional pPassword ) 
>
>Dim oDocAs Object : oDoc= ThisComponent
>Dim oSheet  As Object : oSheet  = 
> oDoc.Sheets.getByName(passedSheetname)
>
>If IsMissing(pPassword) Then pPassword = "SomePassword" 
>oSheet.UnProtect(pPassword)
>oSheet.Protect(pPassword)
>
>End Function

>From my perspective not a bug

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-17 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

An-Kh  changed:

   What|Removed |Added

   Assignee|anshukhar...@gmail.com  |libreoffice-b...@lists.free
   ||desktop.org

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-17 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

An-Kh  changed:

   What|Removed |Added

   Assignee|libreoffice-b...@lists.free |anshukhar...@gmail.com
   |desktop.org |

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-17 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

An-Kh  changed:

   What|Removed |Added

   Assignee|anshukhar...@gmail.com  |libreoffice-b...@lists.free
   ||desktop.org

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs


[Libreoffice-bugs] [Bug 140485] Password does not get set to Protect Sheet when added through LibreOffice BASIC

2021-02-17 Thread bugzilla-daemon
https://bugs.documentfoundation.org/show_bug.cgi?id=140485

An-Kh  changed:

   What|Removed |Added

   Assignee|libreoffice-b...@lists.free |anshukhar...@gmail.com
   |desktop.org |

-- 
You are receiving this mail because:
You are the assignee for the bug.___
Libreoffice-bugs mailing list
Libreoffice-bugs@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice-bugs