[Pardus] tdf#112482 ability to add slides to impress
This patch is sponsored by ULAKBIM/PARDUS project. Signed-off-by: Mert Tümer <merttumer7@gmail.com> Change-Id: I3c8b55d032604b30117573ac447776a1a0e5205f Reviewed-on: https://gerrit.libreoffice.org/48500 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
This commit is contained in:
committed by
Thorsten Behrens
parent
8b98991a66
commit
976b48e9e7
@@ -35,6 +35,11 @@
|
||||
<item android:id="@+id/action_save"
|
||||
android:title="@string/action_save"
|
||||
android:orderInCategory="100" />
|
||||
|
||||
<item android:id="@+id/action_add_slide"
|
||||
android:title="@string/action_add_slide"
|
||||
android:orderInCategory="100"
|
||||
android:enabled="false" />
|
||||
</group>
|
||||
|
||||
|
||||
|
@@ -136,6 +136,7 @@
|
||||
|
||||
<!-- Presentation Mode Strings -->
|
||||
<string name="action_presentation">Slide show</string>
|
||||
<string name="action_add_slide">Add Slide</string>
|
||||
<string name="alert_copy_svg_slide_show_to_clipboard">Your Android device doesn\'t support in-app svg slideshow. We copied the slideshow link to clipboard. Please press home button, open a modern web browser, paste in the address bar, and go.</string>
|
||||
<string name="alert_copy_svg_slide_show_to_clipboard_dismiss">OK</string>
|
||||
<string name="slideshow_action_back">Back</string>
|
||||
|
@@ -114,6 +114,7 @@ class LOKitTileProvider implements TileProvider {
|
||||
|
||||
if (mDocument.getDocumentType() == Document.DOCTYPE_PRESENTATION) {
|
||||
mContext.getToolbarController().disableMenuItem(R.id.action_presentation, false);
|
||||
mContext.getToolbarController().disableMenuItem(R.id.action_add_slide, false);
|
||||
}
|
||||
|
||||
// Writer documents always have one part, so hide the navigation drawer.
|
||||
@@ -160,6 +161,19 @@ class LOKitTileProvider implements TileProvider {
|
||||
});
|
||||
}
|
||||
|
||||
public void addPart(){
|
||||
int parts = mDocument.getParts();
|
||||
LOKitShell.sendEvent(new LOEvent(LOEvent.UNO_COMMAND, ".uno:InsertPage"));
|
||||
String partName = mDocument.getPartName(parts);
|
||||
if (partName.isEmpty()) {
|
||||
partName = getGenericPartName(parts);
|
||||
}
|
||||
mDocument.setPart(parts);
|
||||
resetDocumentSize();
|
||||
final DocumentPartView partView = new DocumentPartView(parts, partName);
|
||||
mContext.getDocumentPartView().add(partView);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void saveDocumentAs(String filePath, String format) {
|
||||
final String newFilePath = "file://" + filePath;
|
||||
|
@@ -685,6 +685,12 @@ public class LibreOfficeMainActivity extends AppCompatActivity implements Settin
|
||||
aboutDialogFragment.show(getSupportFragmentManager(), "AboutDialogFragment");
|
||||
}
|
||||
|
||||
public void addSlide(){
|
||||
mTileProvider.addPart();
|
||||
mDocumentPartViewListAdapter.notifyDataSetChanged();
|
||||
setDocumentChanged(true);
|
||||
}
|
||||
|
||||
public void showSettings() {
|
||||
startActivity(new Intent(getApplicationContext(), SettingsActivity.class));
|
||||
}
|
||||
|
@@ -135,6 +135,9 @@ public class ToolbarController implements Toolbar.OnMenuItemClickListener {
|
||||
case R.id.action_presentation:
|
||||
mContext.preparePresentation();
|
||||
return true;
|
||||
case R.id.action_add_slide:
|
||||
mContext.addSlide();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
Reference in New Issue
Block a user