Skip to content

Commit c2b9ada

Browse files
ACI0104195 and ACI0104196 integration
1 parent 6d490a4 commit c2b9ada

File tree

2 files changed

+58
-45
lines changed

2 files changed

+58
-45
lines changed

Project/Sources/Methods/WP_CopyPasteMenu.4dm

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -45,15 +45,6 @@ Else
4545
$hasPasteMenu2:=False:C215
4646
End if
4747

48-
//If ($context="FrameBackground")
49-
//$oSettings2:=(OBJECT Get pointer(Object named;"oSettings2"))->
50-
//If (Not(OB Is empty($oSettings2)))
51-
//$hasPasteMenu2:=True
52-
//Else
53-
//$hasPasteMenu2:=False
54-
//End if
55-
//End if
56-
5748
// get the RANGE according to context ----------------------------------------------------------------------------------------------
5849

5950
Case of
@@ -123,19 +114,21 @@ Case of
123114
: ($context="Background")
124115

125116
APPEND MENU ITEM:C411($menu; Get localized string:C991("CopyBackground"))
126-
SET MENU ITEM PARAMETER:C1004($menu; -1; "Copy1")
117+
SET MENU ITEM PARAMETER:C1004($menu; -1; "CopyBackground") //<ACI0104196>
127118

128119
If ($hasPasteMenu1)
129120
APPEND MENU ITEM:C411($menu; "(-")
130121
End if
131122

132123
If ($hasPasteMenu1)
133124
APPEND MENU ITEM:C411($menu; Get localized string:C991("PasteBackground"))
134-
SET MENU ITEM PARAMETER:C1004($menu; -1; "Paste1")
125+
SET MENU ITEM PARAMETER:C1004($menu; -1; "PasteBackground") //<ACI0104196>
126+
135127
End if
136128

137129
End case
138130

131+
139132
// call the menu ------------------------------------------------------------------------------------------------------------------------------
140133
$Parameter:=Dynamic pop up menu:C1006($menu)
141134
RELEASE MENU:C978($menu)
@@ -313,6 +306,11 @@ Case of
313306

314307
: ($context="Background")
315308

309+
$oCurrent:=Form:C1466.selection // 2023/09/05 RL
310+
If (Not:C34(Undefined:C82($oCurrent.container)))
311+
$oCurrent:=$oCurrent.container
312+
End if
313+
316314
CLEAR VARIABLE:C89(oSettings1)
317315

318316
// numeric values
@@ -335,6 +333,8 @@ Case of
335333
ARRAY TEXT:C222($_attributes; 0)
336334
APPEND TO ARRAY:C911($_attributes; wk background width:K81:27)
337335
APPEND TO ARRAY:C911($_attributes; wk background height:K81:28)
336+
APPEND TO ARRAY:C911($_attributes; wk background image url:K81:220) // <ACI0104196>
337+
338338
$n:=Size of array:C274($_attributes)
339339
For ($i; 1; $n)
340340
WP GET ATTRIBUTES:C1345($oCurrent; $_attributes{$i}; $textValue)
@@ -344,9 +344,6 @@ Case of
344344
End for
345345
oSettings1:=oSettings1
346346

347-
// +++
348-
(OBJECT Get pointer:C1124(Object named:K67:5; "bgndPictPreviewCopy"))->:=(OBJECT Get pointer:C1124(Object named:K67:5; "bgndPictPreview"))->
349-
350347

351348
End case
352349

@@ -360,6 +357,20 @@ Case of
360357
Case of
361358
: ($Parameter="Paste1")
362359
$oSettings:=oSettings1
360+
361+
: ($Parameter="PasteBackground") // <ACI0104196>
362+
363+
$oSettings:=oSettings1
364+
365+
$oCurrent:=Form:C1466.selection // 2023/09/05 RL
366+
If (Not:C34(Undefined:C82($oCurrent.container)))
367+
$oCurrent:=$oCurrent.container
368+
Else
369+
If ($oCurrent.type=wk type character:K81:296)
370+
$oCurrent:=WP Paragraph range:C1346(Form:C1466.selection)
371+
End if
372+
End if
373+
363374
: ($Parameter="Paste2")
364375
$oSettings:=oSettings2
365376
End case
@@ -421,14 +432,6 @@ Case of
421432
End for
422433
End if
423434

424-
If ($context="Background")
425-
426-
//$ptrPreview:=(OBJECT Get pointer(Object named;"bgndPictPreview"))
427-
$ptrPreviewCopy:=(OBJECT Get pointer:C1124(Object named:K67:5; "bgndPictPreviewCopy"))
428-
//$ptrPreview->:=$ptrPreviewCopy->
429-
WP_SetBackgroundPicture($oCurrent; $ptrPreviewCopy->)
430-
431-
End if
432435

433436
SET TIMER:C645(-1)
434437

Project/Sources/Methods/WP_GetBackgroundSize.4dm

Lines changed: 33 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -22,34 +22,44 @@ If (Not:C34(OB Is empty:C1297($range)))
2222
$refUnit:=oForm.verticalSizeUnits
2323
End if
2424

25-
// <ACI0104082>
2625

27-
If ($size="auto") | ($size="cover") | ($size="contain")
26+
// <ACI0104195> NOT multiple units
27+
If ($size#"")
2828

29-
OBJECT SET VALUE:C1742($refValue; 0)
30-
$refUnit.index:=$refUnit.css.indexOf($size)
31-
$refUnit.memoUnit:=""
32-
33-
Else // ex 50%, 10mm, 2.5cm, 5in or 120pt
34-
35-
$n:=Length:C16($size)
36-
For ($i; 1; $n)
37-
$char:=$size[[$i]]
38-
If (($char>="0") & ($char<="9")) | ($char=".")
39-
$sizeVal:=$sizeVal+$char
40-
Else
41-
$sizeUnit:=Substring:C12($size; $i)
42-
$i:=$n
43-
End if
44-
End for
45-
46-
OBJECT SET VALUE:C1742($refValue; Num:C11($sizeVal; "."))
47-
$refUnit.index:=$refUnit.css.indexOf($sizeUnit)
48-
$refUnit.memoUnit:=$refUnit.css[$refUnit.index] // "%","mm","cm","in" or "pt"
29+
// <ACI0104082>
30+
If ($size="auto") | ($size="cover") | ($size="contain")
31+
OBJECT SET VALUE:C1742($refValue; 0)
32+
$refUnit.index:=$refUnit.css.indexOf($size)
33+
$refUnit.memoUnit:=""
34+
Else // ex 50%, 10mm, 2.5cm, 5in or 120pt
35+
36+
$n:=Length:C16($size)
37+
For ($i; 1; $n)
38+
$char:=$size[[$i]]
39+
If (($char>="0") & ($char<="9")) | ($char=".")
40+
$sizeVal:=$sizeVal+$char
41+
Else
42+
$sizeUnit:=Substring:C12($size; $i)
43+
$i:=$n
44+
End if
45+
End for
46+
47+
OBJECT SET VALUE:C1742($refValue; Num:C11($sizeVal; "."))
48+
$refUnit.index:=$refUnit.css.indexOf($sizeUnit)
49+
$refUnit.memoUnit:=$refUnit.css[$refUnit.index] // "%","mm","cm","in" or "pt"
50+
51+
End if
52+
// </ACI0104082>
4953

54+
Else
55+
// multiple units… do nothing.
5056
End if
51-
// </ACI0104082>
57+
// </ACI0104195>
5258

5359
End for
5460

5561
End if
62+
63+
64+
65+

0 commit comments

Comments
 (0)