Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#1737 Convert to Picture: Unsupported Object #1764

Conversation

YuPeiHenry
Copy link
Contributor

Fixes #1737

Ready for review (test cases included). Tested on Powerpoint 2016.

Outline of Solution
As mentioned in issue, the line if (!ShapeUtil.IsSelectionShapeOrText(selection)) from CustomShapePane.cs conflicts with if (ShapeUtil.IsShapeRangeShapeOrText(selectedShapes)) from ConvertToPicture.cs. This seems to be the cause. Both now use if (!ShapeUtil.IsShapeRangeShapeOrText(...)).

Added tests to confirm that the error pops up only when adding placeholder objects, in ShapesLab FT: TestSavePlaceholderToShapesLabWithAddShapesButton.
Added functions to MessageBoxUtil.cs: ExpectMessageBoxWillNotPopUp

@blewjy
Copy link
Contributor

blewjy commented Feb 1, 2019

Code LGTM. Noticed that this PR has been reviewed previously in #1740. I have re-tested this on Windows 10, PPT2013. Bug is fixed and all FTs and UTs passed.

@ChesterSng I'll let you review and approve this since you were reviewing the previous version of this PR.

@blewjy blewjy added the ok-2013 label Feb 1, 2019
@@ -178,7 +178,9 @@ public void AddShapeFromSelection(Selection selection, ThisAddIn addIn)
// Check this so that it is the same requirements as ConvertToPicture which is used when adding shapes
if (!ShapeUtil.IsSelectionShapeOrText(selection))
{
MessageBox.Show(ShapesLabText.ErrorAddSelectionInvalid, ShapesLabText.ErrorDialogTitle);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the blank line here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

@ChesterSng
Copy link
Contributor

ChesterSng commented Feb 1, 2019

LGTM! Just one small deletion will do.

ChesterSng
ChesterSng previously approved these changes Feb 1, 2019
@leeyh20
Copy link
Contributor

leeyh20 commented Feb 3, 2019

LGTM :)

@leeyh20 leeyh20 merged commit c033993 into PowerPointLabs:dev-release Feb 3, 2019
ChesterSng pushed a commit to ChesterSng/PowerPointLabs that referenced this pull request Feb 13, 2019
…tLabs#1764)

* Add ShapesLabFT for error dialog.

* Add method in MessageBoxUtil.

* Modify CustomShapePane AddShapeFromSelection.

* Fix contradiction in ConvertToPicture ConvertAndSave.

* Fix code mistake in CustomShapePane

* Remove redundant whitespace.
leeyh20 pushed a commit that referenced this pull request Mar 9, 2019
* Update ThisAddIn.cs

* Update ShapesLabText.cs

* Update SyncPaneWPF.xaml.cs

* Update SyncPane.designer.cs

* Update CustomShapePane.designer.cs

* Update Resources.resx

* Update ShapesLabActionHandler.cs

* Add variable inside CustomShapePane.cs

* Add event handler for CustomShapePane MouseMove

* Add SelectionChange Function inside CustomShapePane.cs

* Update CustomShapePane.cs

* Update CustomShapePane.cs

* Update PowerPointLabs.csproj and Resources.Designer.cs

* Update SyncPaneWPF.xaml

* Revert "Update PowerPointLabs.csproj and Resources.Designer.cs"

This reverts commit 9123940.

* Update PowerPointLabs.csproj

* Update Resources.designer.cs

* Update Resources.Designer.cs

* Update Resources.Designer.cs

* Use seperate variables names for function

* Remove trailing whitespaces

* Use two different texts for enabled and disabled button

* Remove trailing whitespaces

* Standardise methods to use selection from ThisAddIn.cs and disable button when only slide is selected too

* Init new lab with placeholder menu: TooltipsLab

* Create skeleton for adding trigger animation to shape

* Add AttachTriggerAnimation.cs

* Create basic shape

* Change from CreateTooltip to AssignTooltip

* Add Textbox adding functionality to tooltips.

* Edit to use trigger animation

* Add attach trigger functionality

* Allow multiple shapes to be appear on click of triggerShape

* Update supertips and text constants and add messagebox for wrong
selection

* #1749 Update DevTeam.md (#1750)

* Update DevTeam.md

* Update DevTeam.md

* Update DevTeam.md

* #1737 Convert to Picture: Unsupported Object (#1764)

* Add ShapesLabFT for error dialog.

* Add method in MessageBoxUtil.

* Modify CustomShapePane AddShapeFromSelection.

* Fix contradiction in ConvertToPicture ConvertAndSave.

* Fix code mistake in CustomShapePane

* Remove redundant whitespace.

* Integrate Azure speech services to narrations lab (#1725)

* integrate Azure speech services to narrations lab

* Simply endpoint selection by choosing region from dropdown list

* Disable cloud-based voice if user is not logged in

* Show error message to user when network fails

* Fix bugs:
 - fix default voice option not selected after human voice is selected
 - fix text input not cleared on login page if "cancel" button is clicked
 - add the option to log out

* Remove network error messagebox because of its  unstable behavior at times.

* Change human voice to cloud voice and fix bugs:
 - voice generation progress bar overflows
 - exception when user logout and click "cancel"

* Add Retries to http code 429 when max request limit is reached

* Add context info for exception handling and refactor code.

* Standardize static sync methods

- Old sync methods do not log the exception. Some returns are not consistent.
- Current standardized exception logging and return style.

* Replace if/else with switch in FillFormat Sync.

* Fix typos for Sync Object exceptions.

* #195 Increase resolution of images in ZoomLab (#1761)

* Change slide copy and paste to export and insert

* Catch possible exception when creating/deleting files

* Wrap DeleteFile method call in try-catch

* Init new lab with placeholder menu: TooltipsLab

* dev-release-4.4.0.0

* Create skeleton for adding trigger animation to shape

* Add AttachTriggerAnimation.cs

* #1604 Disable SyncLab/ShapesLab button when there is no selection (#1760)

* Update ThisAddIn.cs

* Update ShapesLabText.cs

* Update SyncPaneWPF.xaml.cs

* Update SyncPane.designer.cs

* Update CustomShapePane.designer.cs

* Update Resources.resx

* Update ShapesLabActionHandler.cs

* Add variable inside CustomShapePane.cs

* Add event handler for CustomShapePane MouseMove

* Add SelectionChange Function inside CustomShapePane.cs

* Update CustomShapePane.cs

* Update CustomShapePane.cs

* Update PowerPointLabs.csproj and Resources.Designer.cs

* Update SyncPaneWPF.xaml

* Revert "Update PowerPointLabs.csproj and Resources.Designer.cs"

This reverts commit 9123940.

* Update PowerPointLabs.csproj

* Update Resources.designer.cs

* Update Resources.Designer.cs

* Update Resources.Designer.cs

* Use seperate variables names for function

* Remove trailing whitespaces

* Use two different texts for enabled and disabled button

* Remove trailing whitespaces

* Standardise methods to use selection from ThisAddIn.cs and disable button when only slide is selected too

* Add Tests for Copy Button Status for SyncLab

* Add Tests for Add Button Status for ShapesLab

* Add wait in both SyncLab and ShapesLab test

* Uncomment test lines in BaseFunctionalTest.cs

* #1432 Close background ppts on closing of main window (#1746)

* Additional check to close background ppts on closing of main window

* Account for multiple windows when closing background ppt

* Add comment to explain condition check when closing presentation

* Remove redundant reference

* Remove redundant PPT2010 logic when closing presentation

* Change from CreateTooltip to AssignTooltip

* Add Textbox adding functionality to tooltips.

* Edit to use trigger animation

* Add attach trigger functionality

* Allow multiple shapes to be appear on click of triggerShape

* Update supertips and text constants and add messagebox for wrong
selection

* Add opening of animation pane on successful assigning of tooltip

* Align created trigger shape and callout

* Support callout generation for multiple selection

* Prevent closing of animation pane on subsequent usage of assign tooltip

* Prevent opening of animation pane when no tooltip added

* Refactor action handler for create tooltip

* Disable Assign Tooltip button when no selection

* Disable CreateTooltip Button when there are no slides

* Integrate assigning of tooltip into creating tooltip

* Expose function to add textbox

- Takes slide, shape as argument.

* Omit use of Globals.

* Integrate resizable text textbox into Create Tooltip

* Refactor code in EnabledHandlers

* Add exit animations to callout shapes

* Change behaviour of assigning tooltip on subsequent assignments

A new assignment will appear together with the first callout shape
It will also disappear together with the first callout shape

* Refactor code and fix bug caused by using `i` instead of `j`

* Add new menu buttons: Create Callout, Create Trigger

* Rephrase comment on CreateTriggerActionHandler.cs

* Update AddTextBox to central alignment.

- Also hides the button while leaving the functionality exposed.

* Fix csproj file to remove addTextbox classes.

- Removed from actionFramework.

* Remove AddTextbox files

* Change settings of Tooltipslab to show not implemented yet

* Update PowerPointLabs.csproj

* Update PowerPointLabs.csproj

* Update PowerPointLabs.csproj

* Remove changes to .csproj file

* Remove duplicate line in .csproj

* Clean up comments and add guard clause

* Rename function

* Change function to return bool
Add display error box when exception is caught

* Move constants to TooltipsLabConstants

* Rename class
Add summary to AssignToolTip.cs
leeyh20 pushed a commit that referenced this pull request Apr 10, 2019
* Update ThisAddIn.cs

* Update ShapesLabText.cs

* Update SyncPaneWPF.xaml.cs

* Update SyncPane.designer.cs

* Update CustomShapePane.designer.cs

* Update Resources.resx

* Update ShapesLabActionHandler.cs

* Add variable inside CustomShapePane.cs

* Add event handler for CustomShapePane MouseMove

* Add SelectionChange Function inside CustomShapePane.cs

* Update CustomShapePane.cs

* Update CustomShapePane.cs

* Update PowerPointLabs.csproj and Resources.Designer.cs

* Update SyncPaneWPF.xaml

* Revert "Update PowerPointLabs.csproj and Resources.Designer.cs"

This reverts commit 9123940.

* Update PowerPointLabs.csproj

* Update Resources.designer.cs

* Update Resources.Designer.cs

* Update Resources.Designer.cs

* Use seperate variables names for function

* Remove trailing whitespaces

* Use two different texts for enabled and disabled button

* Remove trailing whitespaces

* Standardise methods to use selection from ThisAddIn.cs and disable button when only slide is selected too

* Init new lab with placeholder menu: TooltipsLab

* Create skeleton for adding trigger animation to shape

* Add AttachTriggerAnimation.cs

* Create basic shape

* Change from CreateTooltip to AssignTooltip

* Add Textbox adding functionality to tooltips.

* Edit to use trigger animation

* Add attach trigger functionality

* Allow multiple shapes to be appear on click of triggerShape

* Update supertips and text constants and add messagebox for wrong
selection

* #1749 Update DevTeam.md (#1750)

* Update DevTeam.md

* Update DevTeam.md

* Update DevTeam.md

* #1737 Convert to Picture: Unsupported Object (#1764)

* Add ShapesLabFT for error dialog.

* Add method in MessageBoxUtil.

* Modify CustomShapePane AddShapeFromSelection.

* Fix contradiction in ConvertToPicture ConvertAndSave.

* Fix code mistake in CustomShapePane

* Remove redundant whitespace.

* Integrate Azure speech services to narrations lab (#1725)

* integrate Azure speech services to narrations lab

* Simply endpoint selection by choosing region from dropdown list

* Disable cloud-based voice if user is not logged in

* Show error message to user when network fails

* Fix bugs:
 - fix default voice option not selected after human voice is selected
 - fix text input not cleared on login page if "cancel" button is clicked
 - add the option to log out

* Remove network error messagebox because of its  unstable behavior at times.

* Change human voice to cloud voice and fix bugs:
 - voice generation progress bar overflows
 - exception when user logout and click "cancel"

* Add Retries to http code 429 when max request limit is reached

* Add context info for exception handling and refactor code.

* Standardize static sync methods

- Old sync methods do not log the exception. Some returns are not consistent.
- Current standardized exception logging and return style.

* Replace if/else with switch in FillFormat Sync.

* Fix typos for Sync Object exceptions.

* #195 Increase resolution of images in ZoomLab (#1761)

* Change slide copy and paste to export and insert

* Catch possible exception when creating/deleting files

* Wrap DeleteFile method call in try-catch

* Init new lab with placeholder menu: TooltipsLab

* dev-release-4.4.0.0

* Create skeleton for adding trigger animation to shape

* Add AttachTriggerAnimation.cs

* #1604 Disable SyncLab/ShapesLab button when there is no selection (#1760)

* Update ThisAddIn.cs

* Update ShapesLabText.cs

* Update SyncPaneWPF.xaml.cs

* Update SyncPane.designer.cs

* Update CustomShapePane.designer.cs

* Update Resources.resx

* Update ShapesLabActionHandler.cs

* Add variable inside CustomShapePane.cs

* Add event handler for CustomShapePane MouseMove

* Add SelectionChange Function inside CustomShapePane.cs

* Update CustomShapePane.cs

* Update CustomShapePane.cs

* Update PowerPointLabs.csproj and Resources.Designer.cs

* Update SyncPaneWPF.xaml

* Revert "Update PowerPointLabs.csproj and Resources.Designer.cs"

This reverts commit 9123940.

* Update PowerPointLabs.csproj

* Update Resources.designer.cs

* Update Resources.Designer.cs

* Update Resources.Designer.cs

* Use seperate variables names for function

* Remove trailing whitespaces

* Use two different texts for enabled and disabled button

* Remove trailing whitespaces

* Standardise methods to use selection from ThisAddIn.cs and disable button when only slide is selected too

* Add Tests for Copy Button Status for SyncLab

* Add Tests for Add Button Status for ShapesLab

* Add wait in both SyncLab and ShapesLab test

* Uncomment test lines in BaseFunctionalTest.cs

* #1432 Close background ppts on closing of main window (#1746)

* Additional check to close background ppts on closing of main window

* Account for multiple windows when closing background ppt

* Add comment to explain condition check when closing presentation

* Remove redundant reference

* Remove redundant PPT2010 logic when closing presentation

* Change from CreateTooltip to AssignTooltip

* Add Textbox adding functionality to tooltips.

* Edit to use trigger animation

* Add attach trigger functionality

* Allow multiple shapes to be appear on click of triggerShape

* Update supertips and text constants and add messagebox for wrong
selection

* Add opening of animation pane on successful assigning of tooltip

* Align created trigger shape and callout

* Support callout generation for multiple selection

* Prevent closing of animation pane on subsequent usage of assign tooltip

* Prevent opening of animation pane when no tooltip added

* Refactor action handler for create tooltip

* Disable Assign Tooltip button when no selection

* Disable CreateTooltip Button when there are no slides

* Integrate assigning of tooltip into creating tooltip

* Expose function to add textbox

- Takes slide, shape as argument.

* Omit use of Globals.

* Integrate resizable text textbox into Create Tooltip

* Refactor code in EnabledHandlers

* Add exit animations to callout shapes

* Change behaviour of assigning tooltip on subsequent assignments

A new assignment will appear together with the first callout shape
It will also disappear together with the first callout shape

* Refactor code and fix bug caused by using `i` instead of `j`

* Add new menu buttons: Create Callout, Create Trigger

* Rephrase comment on CreateTriggerActionHandler.cs

* Update AddTextBox to central alignment.

- Also hides the button while leaving the functionality exposed.

* Fix csproj file to remove addTextbox classes.

- Removed from actionFramework.

* Remove AddTextbox files

* Change settings of Tooltipslab to show not implemented yet

* Update PowerPointLabs.csproj

* Update PowerPointLabs.csproj

* Update PowerPointLabs.csproj

* Remove changes to .csproj file

* Add custom WPF.

* Add half-working solution.

* Revert "Add half-working solution."

This reverts commit 2d5b44d.

* Revert "Add custom WPF."

This reverts commit 3b4d333.

* Remove duplicate line in .csproj

* Clean up comments and add guard clause

* Rename function

* Change function to return bool
Add display error box when exception is caught

* Move constants to TooltipsLabConstants

* Rename class
Add summary to AssignToolTip.cs

* Add support for specifying shape.

* Complete settings support for animations.

* Integrate settings into tooltips lab.

* Extract constants.

* Fix animation settings.

* Add callout animation heading.

* Remove redundant animation images.

* Remove Image from animations and format animation display name.

* Add back missing settings.

* Remove all shapes that are not callouts.

* Add selected animation types.

* Remove duplicate line in CreateTooltip.

* Change animation thumbnail images.

* Remove ambiguity in var name type.

* Remove ambiguity in shapeType and animType.

* Move image size constants into TooltipsLabConstants.

* Fix missing data tag in Resources.resx.

* Change formatting to match default style.
@YuPeiHenry YuPeiHenry deleted the 1737-convert-picture-unsupported_ branch May 4, 2019 15:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants